diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31c5452..494b869 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,21 +12,17 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - cache: true - - run: dart format --set-exit-if-changed lib test + - run: | + flutter pub get + dart format --set-exit-if-changed . analyze: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - cache: true - run: flutter analyze lib test # END LINTING STAGE @@ -34,11 +30,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - cache: true - run: flutter test # END TESTING STAGE - diff --git a/analysis_options.yaml b/analysis_options.yaml index c63831d..a74fe7a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,8 @@ -include: package:very_good_analysis/analysis_options.2.4.0.yaml +include: package:very_good_analysis/analysis_options.7.0.0.yaml + +analyzer: + errors: + document_ignores: ignore linter: rules: @@ -8,4 +12,4 @@ linter: only_throw_errors: false avoid_returning_this: false prefer_function_declarations_over_variables: false - no_logic_in_create_state: false \ No newline at end of file + no_logic_in_create_state: false diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 0000000..a74fe7a --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,15 @@ +include: package:very_good_analysis/analysis_options.7.0.0.yaml + +analyzer: + errors: + document_ignores: ignore + +linter: + rules: + public_member_api_docs: false + sort_constructors_first: false + avoid_positional_boolean_parameters: false + only_throw_errors: false + avoid_returning_this: false + prefer_function_declarations_over_variables: false + no_logic_in_create_state: false diff --git a/example/lib/widgets/message_card.dart b/example/lib/widgets/message_card.dart index eb9a937..c717d78 100644 --- a/example/lib/widgets/message_card.dart +++ b/example/lib/widgets/message_card.dart @@ -15,12 +15,12 @@ class MessageCard extends StatelessWidget { final Color infoColor; const MessageCard({ - Key? key, required this.message, required this.type, + super.key, this.errorColor = const Color(0xFFCC6941), this.infoColor = const Color(0xFF5E89FF), - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e65ed82..161c578 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,8 +6,8 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.13.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: dashbook: @@ -19,7 +19,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^5.1.0 + very_good_analysis: ^7.0.0 flutter: uses-material-design: true diff --git a/lib/src/story.dart b/lib/src/story.dart index daa2391..9cc5dc4 100644 --- a/lib/src/story.dart +++ b/lib/src/story.dart @@ -93,17 +93,12 @@ class ListProperty extends Property { final List list; ListProperty( - String name, - T defaultValue, + super.name, + super.defaultValue, this.list, { - String? tooltipMessage, - ControlProperty? visibilityControlProperty, - }) : super( - name, - defaultValue, - tooltipMessage: tooltipMessage, - visibilityControlProperty: visibilityControlProperty, - ); + super.tooltipMessage, + super.visibilityControlProperty, + }); @override Widget createPropertyEditor({required PropertyChanged onChanged, Key? key}) { @@ -119,17 +114,12 @@ class OptionsProperty extends Property { final List> list; OptionsProperty( - String name, - T defaultValue, + super.name, + super.defaultValue, this.list, { - String? tooltipMessage, - ControlProperty? visibilityControlProperty, - }) : super( - name, - defaultValue, - tooltipMessage: tooltipMessage, - visibilityControlProperty: visibilityControlProperty, - ); + super.tooltipMessage, + super.visibilityControlProperty, + }); @override Widget createPropertyEditor({required PropertyChanged onChanged, Key? key}) { @@ -154,7 +144,7 @@ class PropertyOption { } class DashbookContext { - Map properties = {}; + Map> properties = {}; Map actions = {}; void action(String name, void Function(BuildContext) callback) { @@ -375,7 +365,7 @@ class Story { String? info, bool pinInfo = false, }) { - final _chapter = Chapter( + final chapter = Chapter( name, buildFn, this, @@ -383,7 +373,7 @@ class Story { info: info, pinInfo: pinInfo, ); - chapters.add(_chapter); + chapters.add(chapter); return this; } diff --git a/lib/src/widgets/actions_container.dart b/lib/src/widgets/actions_container.dart index 9ffc5c0..9e5345a 100644 --- a/lib/src/widgets/actions_container.dart +++ b/lib/src/widgets/actions_container.dart @@ -6,10 +6,10 @@ import 'package:flutter/material.dart'; class ActionsContainer extends StatelessWidget { const ActionsContainer({ - Key? key, required this.onCancel, required this.currentChapter, - }) : super(key: key); + super.key, + }); final VoidCallback onCancel; final Chapter currentChapter; diff --git a/lib/src/widgets/device_preview.dart b/lib/src/widgets/device_preview.dart index 64e1875..0ce6f2e 100644 --- a/lib/src/widgets/device_preview.dart +++ b/lib/src/widgets/device_preview.dart @@ -8,12 +8,12 @@ class DevicePreview extends StatelessWidget { final bool showDeviceFrame; const DevicePreview({ - Key? key, required this.child, required this.deviceInfo, required this.deviceOrientation, required this.showDeviceFrame, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -33,7 +33,7 @@ class DevicePreview extends StatelessWidget { isFrameVisible: showDeviceFrame, screen: MediaQuery( data: mediaQuery, - child: Container( + child: ColoredBox( color: Theme.of(context).scaffoldBackgroundColor, child: child, ), diff --git a/lib/src/widgets/device_settings_container.dart b/lib/src/widgets/device_settings_container.dart index f3d56aa..801812e 100644 --- a/lib/src/widgets/device_settings_container.dart +++ b/lib/src/widgets/device_settings_container.dart @@ -12,9 +12,9 @@ class DeviceSettingsContainer extends StatefulWidget { final VoidCallback onCancel; const DeviceSettingsContainer({ - Key? key, required this.onCancel, - }) : super(key: key); + super.key, + }); @override State createState() => diff --git a/lib/src/widgets/intructions_dialog.dart b/lib/src/widgets/intructions_dialog.dart index ba085e3..6b49a6c 100644 --- a/lib/src/widgets/intructions_dialog.dart +++ b/lib/src/widgets/intructions_dialog.dart @@ -38,9 +38,9 @@ class InstructionsDialog extends StatelessWidget { final String instructions; const InstructionsDialog({ - Key? key, required this.instructions, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/link.dart b/lib/src/widgets/link.dart index 9d3bc41..8f445ce 100644 --- a/lib/src/widgets/link.dart +++ b/lib/src/widgets/link.dart @@ -8,13 +8,13 @@ class Link extends StatelessWidget { final EdgeInsets padding; const Link({ - Key? key, required this.label, required this.textStyle, required this.textAlign, + super.key, this.onTap, this.padding = const EdgeInsets.all(10), - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/properties_container.dart b/lib/src/widgets/properties_container.dart index 0b69419..04ed438 100644 --- a/lib/src/widgets/properties_container.dart +++ b/lib/src/widgets/properties_container.dart @@ -11,11 +11,11 @@ class PropertiesContainer extends StatefulWidget { final VoidCallback onCancel; const PropertiesContainer({ - Key? key, required this.currentChapter, required this.onPropertyChange, required this.onCancel, - }) : super(key: key); + super.key, + }); @override State createState() => _PropertiesContainerState(); @@ -41,17 +41,17 @@ class _PropertiesContainerState extends State { } } - final _propertyKey = + final propertyKey = Key('${widget.currentChapter.id}#${entry.value.name}'); - final _onChanged = () { + final onChanged = () { setState(() {}); widget.onPropertyChange(); }; children.add( entry.value.createPropertyEditor( - onChanged: _onChanged, - key: _propertyKey, + onChanged: onChanged, + key: propertyKey, ), ); } diff --git a/lib/src/widgets/property_widgets/bool_property.dart b/lib/src/widgets/property_widgets/bool_property.dart index 2782c57..e5b18d4 100644 --- a/lib/src/widgets/property_widgets/bool_property.dart +++ b/lib/src/widgets/property_widgets/bool_property.dart @@ -8,8 +8,8 @@ class BoolProperty extends StatefulWidget { const BoolProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => BoolPropertyState(property.getValue()); diff --git a/lib/src/widgets/property_widgets/border_radius_property.dart b/lib/src/widgets/property_widgets/border_radius_property.dart index e5c0f12..317660d 100644 --- a/lib/src/widgets/property_widgets/border_radius_property.dart +++ b/lib/src/widgets/property_widgets/border_radius_property.dart @@ -10,8 +10,8 @@ class BorderRadiusProperty extends StatefulWidget { const BorderRadiusProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => @@ -60,7 +60,7 @@ class _BorderRadiusPropertyState extends State { bottomRight: Radius.circular(bottomRight), ); } - } catch (err) { + } on Exception catch (_) { return null; } } diff --git a/lib/src/widgets/property_widgets/color_property.dart b/lib/src/widgets/property_widgets/color_property.dart index 8896f84..4720257 100644 --- a/lib/src/widgets/property_widgets/color_property.dart +++ b/lib/src/widgets/property_widgets/color_property.dart @@ -11,8 +11,8 @@ class ColorProperty extends StatefulWidget { const ColorProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => diff --git a/lib/src/widgets/property_widgets/edge_insets_property.dart b/lib/src/widgets/property_widgets/edge_insets_property.dart index 689ebd6..8d48c63 100644 --- a/lib/src/widgets/property_widgets/edge_insets_property.dart +++ b/lib/src/widgets/property_widgets/edge_insets_property.dart @@ -10,8 +10,8 @@ class EdgeInsetsProperty extends StatefulWidget { const EdgeInsetsProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => @@ -53,7 +53,7 @@ class _EdgeInsetsPropertyState extends State { return EdgeInsets.fromLTRB(left, top, right, bottom); } - } catch (err) { + } on Exception catch (_) { return null; } } diff --git a/lib/src/widgets/property_widgets/list_property.dart b/lib/src/widgets/property_widgets/list_property.dart index 0c0986c..6a8369c 100644 --- a/lib/src/widgets/property_widgets/list_property.dart +++ b/lib/src/widgets/property_widgets/list_property.dart @@ -8,8 +8,8 @@ class ListPropertyWidget extends StatefulWidget { const ListPropertyWidget({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => ListPropertyState(); diff --git a/lib/src/widgets/property_widgets/number_property.dart b/lib/src/widgets/property_widgets/number_property.dart index 65d31a9..8b2a588 100644 --- a/lib/src/widgets/property_widgets/number_property.dart +++ b/lib/src/widgets/property_widgets/number_property.dart @@ -9,8 +9,8 @@ class NumberProperty extends StatefulWidget { const NumberProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => diff --git a/lib/src/widgets/property_widgets/options_property.dart b/lib/src/widgets/property_widgets/options_property.dart index c4ee69b..72256cc 100644 --- a/lib/src/widgets/property_widgets/options_property.dart +++ b/lib/src/widgets/property_widgets/options_property.dart @@ -8,14 +8,14 @@ class OptionsPropertyWidget extends StatefulWidget { const OptionsPropertyWidget({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => OptionsPropertyState(); } -class OptionsPropertyState extends State { +class OptionsPropertyState extends State> { @override Widget build(BuildContext context) { return PropertyScaffold( diff --git a/lib/src/widgets/property_widgets/text_property.dart b/lib/src/widgets/property_widgets/text_property.dart index 630ca40..0464bc1 100644 --- a/lib/src/widgets/property_widgets/text_property.dart +++ b/lib/src/widgets/property_widgets/text_property.dart @@ -8,8 +8,8 @@ class TextProperty extends StatefulWidget { const TextProperty({ required this.property, required this.onChanged, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => TextPropertyState(property.getValue()); diff --git a/lib/src/widgets/property_widgets/widgets/property_4_integer_form.dart b/lib/src/widgets/property_widgets/widgets/property_4_integer_form.dart index 8223158..5933942 100644 --- a/lib/src/widgets/property_widgets/widgets/property_4_integer_form.dart +++ b/lib/src/widgets/property_widgets/widgets/property_4_integer_form.dart @@ -32,8 +32,8 @@ class FourIntegerForm extends StatefulWidget { this._label2, this._label3, this._label4, { - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() { diff --git a/lib/src/widgets/property_widgets/widgets/property_dialog.dart b/lib/src/widgets/property_widgets/widgets/property_dialog.dart index 087f51f..6fedc3b 100644 --- a/lib/src/widgets/property_widgets/widgets/property_dialog.dart +++ b/lib/src/widgets/property_widgets/widgets/property_dialog.dart @@ -6,11 +6,11 @@ class PropertyDialog extends StatelessWidget { final List actions; const PropertyDialog({ - Key? key, required this.title, required this.content, required this.actions, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/property_widgets/widgets/property_scaffold.dart b/lib/src/widgets/property_widgets/widgets/property_scaffold.dart index 9462909..b4b935a 100644 --- a/lib/src/widgets/property_widgets/widgets/property_scaffold.dart +++ b/lib/src/widgets/property_widgets/widgets/property_scaffold.dart @@ -13,11 +13,11 @@ class PropertyScaffold extends StatelessWidget { final String? tooltipMessage; const PropertyScaffold({ - Key? key, required this.label, required this.child, + super.key, this.tooltipMessage, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/property_widgets/widgets/title_with_tooltip.dart b/lib/src/widgets/property_widgets/widgets/title_with_tooltip.dart index 46bf1b3..683495f 100644 --- a/lib/src/widgets/property_widgets/widgets/title_with_tooltip.dart +++ b/lib/src/widgets/property_widgets/widgets/title_with_tooltip.dart @@ -5,10 +5,10 @@ class TitleWithTooltip extends StatelessWidget { final String tooltipMessage; const TitleWithTooltip({ - Key? key, required this.label, required this.tooltipMessage, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/select_device/custom_device.dart b/lib/src/widgets/select_device/custom_device.dart index 79bde36..b14cd32 100644 --- a/lib/src/widgets/select_device/custom_device.dart +++ b/lib/src/widgets/select_device/custom_device.dart @@ -8,8 +8,8 @@ class CustomDevice extends StatefulWidget { const CustomDevice({ required this.changeToList, required this.formKey, - Key? key, - }) : super(key: key); + super.key, + }); final VoidCallback changeToList; final GlobalKey formKey; @@ -98,8 +98,7 @@ class _FormField extends StatelessWidget { this.controller, { required this.label, required this.onUpdate, - Key? key, - }) : super(key: key); + }); final TextEditingController controller; final String label; final void Function(num) onUpdate; @@ -134,8 +133,7 @@ class _FormField extends StatelessWidget { class _PickPlatform extends StatelessWidget { const _PickPlatform({ required this.onSelect, - Key? key, - }) : super(key: key); + }); final void Function(TargetPlatform) onSelect; @override diff --git a/lib/src/widgets/select_device/device_dialog_buttons.dart b/lib/src/widgets/select_device/device_dialog_buttons.dart index cd9c121..7cc6fdf 100644 --- a/lib/src/widgets/select_device/device_dialog_buttons.dart +++ b/lib/src/widgets/select_device/device_dialog_buttons.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; class DeviceDialogButtons extends StatelessWidget { const DeviceDialogButtons({ - Key? key, required this.onSelect, required this.onClear, required this.onCancel, - }) : super(key: key); + super.key, + }); final VoidCallback onSelect; final VoidCallback onClear; final VoidCallback onCancel; diff --git a/lib/src/widgets/select_device/device_settings.dart b/lib/src/widgets/select_device/device_settings.dart index a838b72..20adb77 100644 --- a/lib/src/widgets/select_device/device_settings.dart +++ b/lib/src/widgets/select_device/device_settings.dart @@ -56,7 +56,7 @@ class DeviceSettingsData { class DeviceSettings extends StatefulWidget { final Widget child; - const DeviceSettings({super.key, required this.child}); + const DeviceSettings({required this.child, super.key}); static DeviceSettingsState of(BuildContext context, {bool listen = true}) { final _DeviceSettings? result; diff --git a/lib/src/widgets/select_device/select_device.dart b/lib/src/widgets/select_device/select_device.dart index dd39a3a..bc2839f 100644 --- a/lib/src/widgets/select_device/select_device.dart +++ b/lib/src/widgets/select_device/select_device.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; class SelectDevice extends StatelessWidget { const SelectDevice({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -33,11 +33,11 @@ class DevicePropertyScaffold extends StatelessWidget { final String? tooltipMessage; const DevicePropertyScaffold({ - Key? key, required this.label, required this.child, + super.key, this.tooltipMessage, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/side_bar_panel.dart b/lib/src/widgets/side_bar_panel.dart index 16ed372..2c79b29 100644 --- a/lib/src/widgets/side_bar_panel.dart +++ b/lib/src/widgets/side_bar_panel.dart @@ -6,23 +6,23 @@ class SideBarPanel extends StatelessWidget { final String title; final Widget child; final VoidCallback? onCancel; - final PageStorageKey? scrollViewKey; + final PageStorageKey? scrollViewKey; final Key? onCloseKey; final double width; final DashbookIcon? titleIcon; final bool sideBarIsAlwaysShown; const SideBarPanel({ - Key? key, required this.title, required this.child, + required this.width, + super.key, this.onCancel, this.scrollViewKey, this.onCloseKey, this.titleIcon, - required this.width, this.sideBarIsAlwaysShown = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/stories_list.dart b/lib/src/widgets/stories_list.dart index ba18efa..9fa6673 100644 --- a/lib/src/widgets/stories_list.dart +++ b/lib/src/widgets/stories_list.dart @@ -6,8 +6,8 @@ import 'package:dashbook/src/widgets/link.dart'; import 'package:dashbook/src/widgets/side_bar_panel.dart'; import 'package:flutter/material.dart'; -typedef OnSelectChapter = Function(Chapter chapter); -typedef OnBookmarkChapter = Function(String chapter); +typedef OnSelectChapter = void Function(Chapter chapter); +typedef OnBookmarkChapter = void Function(String chapter); class StoriesList extends StatefulWidget { final List stories; @@ -35,9 +35,9 @@ class StoriesList extends StatefulWidget { required this.storyPanelPinned, required this.onStoryPinChange, required this.storiesAreAlwaysShown, - Key? key, + super.key, this.selectedChapter, - }) : super(key: key); + }); @override State createState() { diff --git a/lib/src/widgets/widget.dart b/lib/src/widgets/widget.dart index ff3494b..63f39cf 100644 --- a/lib/src/widgets/widget.dart +++ b/lib/src/widgets/widget.dart @@ -58,7 +58,7 @@ class Dashbook extends StatefulWidget { final OnChapterChange? onChapterChange; Dashbook({ - Key? key, + super.key, this.theme, this.title = '', this.usePreviewSafeArea = false, @@ -68,13 +68,12 @@ class Dashbook extends StatefulWidget { this.localizationsDelegates, this.supportedLocales = const [Locale('en', 'US')], }) : _dualTheme = null, - _multiTheme = null, - super(key: key); + _multiTheme = null; Dashbook.dualTheme({ - Key? key, required ThemeData light, required ThemeData dark, + super.key, bool initWithLight = true, this.title = '', this.usePreviewSafeArea = false, @@ -89,12 +88,11 @@ class Dashbook extends StatefulWidget { initWithLight: initWithLight, ), theme = null, - _multiTheme = null, - super(key: key); + _multiTheme = null; Dashbook.multiTheme({ - Key? key, required Map themes, + super.key, String? initialTheme, this.title = '', this.usePreviewSafeArea = false, @@ -106,8 +104,7 @@ class Dashbook extends StatefulWidget { }) : _multiTheme = _DashbookMultiTheme(themes: themes, initialTheme: initialTheme), theme = null, - _dualTheme = null, - super(key: key); + _dualTheme = null; Story storiesOf(String name) { final story = Story(name); @@ -145,13 +142,13 @@ class _DashbookState extends State { if (widget.theme != null) { _currentTheme = widget.theme; } else if (widget._dualTheme != null) { - final _dualTheme = widget._dualTheme; + final dualTheme = widget._dualTheme; _currentTheme = - _dualTheme!.initWithLight ? _dualTheme.light : _dualTheme.dark; + dualTheme!.initWithLight ? dualTheme.light : dualTheme.dark; } else if (widget._multiTheme != null) { - final _multiTheme = widget._multiTheme; - _currentTheme = _multiTheme!.themes[_multiTheme.initialTheme] ?? - _multiTheme.themes.values.first; + final multiTheme = widget._multiTheme; + _currentTheme = multiTheme!.themes[multiTheme.initialTheme] ?? + multiTheme.themes.values.first; } _finishLoading(); } @@ -280,7 +277,7 @@ class _DashbookState extends State { CurrentView.properties || _currentView == CurrentView.actions || _currentView == CurrentView.deviceSettings, - info: _currentChapter?.pinInfo == true + info: (_currentChapter?.pinInfo ?? false) ? _currentChapter?.info : null, child: chapterWidget!, @@ -511,7 +508,7 @@ class _DashbookRightIconList extends StatelessWidget { class _DashbookDualThemeIcon extends StatelessWidget { final _DashbookDualTheme dualTheme; final ThemeData currentTheme; - final Function(ThemeData) onChangeTheme; + final void Function(ThemeData) onChangeTheme; const _DashbookDualThemeIcon({ required this.dualTheme, diff --git a/pubspec.yaml b/pubspec.yaml index e2a0529..7a75aae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,22 +4,22 @@ version: 0.1.16 homepage: https://github.com/bluefireteam/dashbook environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.13.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: - device_frame: ^1.1.0 + device_frame: ^1.2.0 flutter: sdk: flutter flutter_colorpicker: ^1.1.0 - flutter_markdown: ^0.6.17+3 - shared_preferences: ^2.2.1 - url_launcher: ^6.1.14 - web: ^1.1.0 + flutter_markdown: ^0.7.7+1 + shared_preferences: ^2.5.3 + url_launcher: ^6.3.1 + web: ^1.1.1 dev_dependencies: flutter_test: sdk: flutter - mockingjay: ^0.3.0 - mocktail: ^0.3.0 - very_good_analysis: ^5.1.0 + mockingjay: ^1.0.0 + mocktail: ^1.0.4 + very_good_analysis: ^7.0.0 diff --git a/test/widget/device_dialog_test.dart b/test/widget/device_dialog_test.dart index 84fd627..0aa9baf 100644 --- a/test/widget/device_dialog_test.dart +++ b/test/widget/device_dialog_test.dart @@ -10,7 +10,7 @@ import '../helpers.dart'; import '../helpers/helpers.dart'; void main() { - Dashbook _getDashbook({ + Dashbook getDashbook({ void Function(DeviceSettingsData?)? onDeviceSettingsChanged, }) { final dashbook = Dashbook(); @@ -29,7 +29,7 @@ void main() { return dashbook; } - Future _openCustomSetup(WidgetTester tester) async { + Future openCustomSetup(WidgetTester tester) async { final customDeviceButtonLabel = find.text('Custom device'); await tester.tap(customDeviceButtonLabel); await tester.pumpAndSettle(); @@ -38,7 +38,7 @@ void main() { group('Device settings', () { testWidgets('show select device settings', (tester) async { tester.setScreenSize(const Size(2000, 1000)); - await tester.pumpDashbook(_getDashbook()); + await tester.pumpDashbook(getDashbook()); await tester.tap(find.byKey(kDevicePreviewIcon)); await tester.pumpAndSettle(); @@ -80,11 +80,11 @@ void main() { 'When click in Custom Device button, ' 'should toggle to form to customize device info', (tester) async { tester.setScreenSize(const Size(2000, 1000)); - await tester.pumpDashbook(_getDashbook()); + await tester.pumpDashbook(getDashbook()); await tester.tap(find.byKey(kDevicePreviewIcon)); await tester.pumpAndSettle(); - await _openCustomSetup(tester); + await openCustomSetup(tester); final toggleKey = find.byKey(kCustomDeviceToggle); final toggleWidget = tester.widget(toggleKey) as CheckboxListTile; @@ -117,7 +117,7 @@ void main() { DeviceSettingsData? settings; tester.setScreenSize(const Size(2000, 1000)); await tester.pumpDashbook( - _getDashbook( + getDashbook( onDeviceSettingsChanged: (selected) async { settings = selected; }, @@ -128,7 +128,7 @@ void main() { await tester.tap(find.byKey(kDevicePreviewIcon)); await tester.pumpAndSettle(); - await _openCustomSetup(tester); + await openCustomSetup(tester); final formFields = ['Height', 'Width']; for (final label in formFields) {