diff --git a/analysis_options.yaml b/analysis_options.yaml index 473f77fa..65563c98 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,3 +5,7 @@ analyzer: - example/ - packages/ - "**/*.g.dart" + +linter: + rules: + - require_trailing_commas diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index ba91a970..24b2dee9 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -3,3 +3,7 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: - "**/*.g.dart" + +linter: + rules: + - require_trailing_commas diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..cccf817a --- /dev/null +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,10 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { +} diff --git a/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 00000000..194d81b9 --- /dev/null +++ b/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/joshua/fvm/versions/3.16.5 +FLUTTER_APPLICATION_PATH=/Users/joshua/code/appainter/example +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/example/macos/Flutter/ephemeral/flutter_export_environment.sh b/example/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100755 index 00000000..fda4822d --- /dev/null +++ b/example/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/joshua/fvm/versions/3.16.5" +export "FLUTTER_APPLICATION_PATH=/Users/joshua/code/appainter/example" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/lib/abstract_text_style/cubit/abstract_text_style_cubit.dart b/lib/abstract_text_style/cubit/abstract_text_style_cubit.dart index b66d39c9..3e78df31 100644 --- a/lib/abstract_text_style/cubit/abstract_text_style_cubit.dart +++ b/lib/abstract_text_style/cubit/abstract_text_style_cubit.dart @@ -15,11 +15,13 @@ abstract class AbstractTextStyleCubit extends Cubit { AbstractTextStyleCubit({ required this.typeScale, this.isBaseStyleBlack = true, - }) : super(TextStyleState( - style: isBaseStyleBlack - ? kBlackTextStyles[typeScale]! - : kWhiteTextStyles[typeScale]!, - )); + }) : super( + TextStyleState( + style: isBaseStyleBlack + ? kBlackTextStyles[typeScale]! + : kWhiteTextStyles[typeScale]!, + ), + ); final TypeScale typeScale; final bool isBaseStyleBlack; diff --git a/lib/app_bar_theme/widgets/system_overlay_style_card.dart b/lib/app_bar_theme/widgets/system_overlay_style_card.dart index 5e2bff88..cb6e7ce9 100644 --- a/lib/app_bar_theme/widgets/system_overlay_style_card.dart +++ b/lib/app_bar_theme/widgets/system_overlay_style_card.dart @@ -66,8 +66,9 @@ class _StatusBarBrightnessDropdown extends StatelessWidget { return DropdownListTile( title: 'Status bar brightness', value: UtilService.enumToString( - (state.theme.systemOverlayStyle ?? _defaultSystemOverlayStyle) - .statusBarBrightness), + (state.theme.systemOverlayStyle ?? _defaultSystemOverlayStyle) + .statusBarBrightness, + ), values: UtilService.getEnumStrings(Brightness.values), onChanged: context.read().statusBarBrightnessChanged, @@ -92,8 +93,9 @@ class _StatusBarIconBrightnessDropdown extends StatelessWidget { return DropdownListTile( title: 'Status bar icon brightness', value: UtilService.enumToString( - (state.theme.systemOverlayStyle ?? _defaultSystemOverlayStyle) - .statusBarIconBrightness), + (state.theme.systemOverlayStyle ?? _defaultSystemOverlayStyle) + .statusBarIconBrightness, + ), values: UtilService.getEnumStrings(Brightness.values), onChanged: context.read().statusBarIconBrightnessChanged, diff --git a/lib/basic_theme/cubit/basic_theme_cubit.dart b/lib/basic_theme/cubit/basic_theme_cubit.dart index 1fa790ff..880f4846 100644 --- a/lib/basic_theme/cubit/basic_theme_cubit.dart +++ b/lib/basic_theme/cubit/basic_theme_cubit.dart @@ -39,10 +39,12 @@ class BasicThemeCubit extends Cubit { } void themeReset() { - emit(state.copyWith( - seedColor: BasicThemeState.defaultSeedColor, - colorScheme: BasicThemeState.getColorScheme(state.isDark), - )); + emit( + state.copyWith( + seedColor: BasicThemeState.defaultSeedColor, + colorScheme: BasicThemeState.getColorScheme(state.isDark), + ), + ); } void seedColorChanged(Color color) { diff --git a/lib/bottom_navigation_bar_theme/view/bottom_navigation_bar_theme_editor.dart b/lib/bottom_navigation_bar_theme/view/bottom_navigation_bar_theme_editor.dart index 000e30a6..6c6bb890 100644 --- a/lib/bottom_navigation_bar_theme/view/bottom_navigation_bar_theme_editor.dart +++ b/lib/bottom_navigation_bar_theme/view/bottom_navigation_bar_theme_editor.dart @@ -40,7 +40,7 @@ class BottomNavigationBarThemeEditor extends ExpansionPanelItem { ), ), ], - ) + ), ], ); } diff --git a/lib/color_theme/cubit/color_theme_cubit.dart b/lib/color_theme/cubit/color_theme_cubit.dart index bccb613d..cfb49087 100644 --- a/lib/color_theme/cubit/color_theme_cubit.dart +++ b/lib/color_theme/cubit/color_theme_cubit.dart @@ -13,27 +13,29 @@ class ColorThemeCubit extends Cubit { ColorThemeCubit() : super(ColorThemeState()); void themeChanged(ThemeData theme) { - emit(state.copyWith( - colorScheme: theme.colorScheme, - primaryColor: theme.primaryColor, - primaryColorLight: theme.primaryColorLight, - primaryColorDark: theme.primaryColorDark, - canvasColor: theme.canvasColor, - cardColor: theme.cardColor, - dialogBackgroundColor: theme.dialogBackgroundColor, - disabledColor: theme.disabledColor, - dividerColor: theme.dividerColor, - focusColor: theme.focusColor, - highlightColor: theme.highlightColor, - hintColor: theme.hintColor, - hoverColor: theme.hoverColor, - indicatorColor: theme.indicatorColor, - scaffoldBackgroundColor: theme.scaffoldBackgroundColor, - secondaryHeaderColor: theme.secondaryHeaderColor, - shadowColor: theme.shadowColor, - splashColor: theme.splashColor, - unselectedWidgetColor: theme.unselectedWidgetColor, - )); + emit( + state.copyWith( + colorScheme: theme.colorScheme, + primaryColor: theme.primaryColor, + primaryColorLight: theme.primaryColorLight, + primaryColorDark: theme.primaryColorDark, + canvasColor: theme.canvasColor, + cardColor: theme.cardColor, + dialogBackgroundColor: theme.dialogBackgroundColor, + disabledColor: theme.disabledColor, + dividerColor: theme.dividerColor, + focusColor: theme.focusColor, + highlightColor: theme.highlightColor, + hintColor: theme.hintColor, + hoverColor: theme.hoverColor, + indicatorColor: theme.indicatorColor, + scaffoldBackgroundColor: theme.scaffoldBackgroundColor, + secondaryHeaderColor: theme.secondaryHeaderColor, + shadowColor: theme.shadowColor, + splashColor: theme.splashColor, + unselectedWidgetColor: theme.unselectedWidgetColor, + ), + ); } void primaryColorChanged(Color color, bool isDark) { diff --git a/lib/home/views/home_page.dart b/lib/home/views/home_page.dart index 88c075ad..96b2f24a 100644 --- a/lib/home/views/home_page.dart +++ b/lib/home/views/home_page.dart @@ -116,7 +116,7 @@ class HomePageState extends State { Text( 'Appainter currently supports Flutter SDK: $_sdkVersion', style: Theme.of(context).textTheme.titleSmall, - ) + ), ], ), ); @@ -149,7 +149,7 @@ class _EditorPreview extends StatelessWidget { child: const ThemePreview(), ), ), - ) + ), ], ); } diff --git a/lib/home/widgets/export_button.dart b/lib/home/widgets/export_button.dart index 01bef99c..64f6d8f8 100644 --- a/lib/home/widgets/export_button.dart +++ b/lib/home/widgets/export_button.dart @@ -63,7 +63,8 @@ class ExportButton extends StatelessWidget { style: context.read().state.style, ); final outlinedButtonTheme = OutlinedButtonThemeData( - style: context.read().state.style); + style: context.read().state.style, + ); final textButtonTheme = TextButtonThemeData( style: context.read().state.style, ); diff --git a/lib/input_decoration_theme/view/input_decoration_theme_editor.dart b/lib/input_decoration_theme/view/input_decoration_theme_editor.dart index 313911b3..50913f85 100644 --- a/lib/input_decoration_theme/view/input_decoration_theme_editor.dart +++ b/lib/input_decoration_theme/view/input_decoration_theme_editor.dart @@ -322,7 +322,7 @@ class _BorderRadiusTextFieldState extends State<_BorderRadiusTextField> { current.theme.border?.isOutline != true; }, listener: (context, state) => _controller.clear(), - ) + ), ], child: BlocBuilder( key: const Key('inputDecorationThemeEditor_borderRadiusTextField'), diff --git a/lib/main.dart b/lib/main.dart index e69c8ae0..ffa465b9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -64,9 +64,11 @@ Future _runApp() async { analyticsRepo = EmptyAnalyticsRepository(); } - runApp(MyApp( - homeRepo: HomeRepository(), - fontRepo: FontRepository(), - analyticsRepo: analyticsRepo, - )); + runApp( + MyApp( + homeRepo: HomeRepository(), + fontRepo: FontRepository(), + analyticsRepo: analyticsRepo, + ), + ); } diff --git a/lib/switch_theme/view/switch_theme_editor.dart b/lib/switch_theme/view/switch_theme_editor.dart index d8b5aa0c..d584d17e 100644 --- a/lib/switch_theme/view/switch_theme_editor.dart +++ b/lib/switch_theme/view/switch_theme_editor.dart @@ -21,7 +21,7 @@ class SwitchThemeEditor extends ExpansionPanelItem { SideBySide( left: _MaterialTapTargetSizeDropdown(), right: _SplashRadiusTextField(), - ) + ), ], ); } diff --git a/lib/theme_preview/views/buttons_page.dart b/lib/theme_preview/views/buttons_page.dart index d8712f0b..1dee6f47 100644 --- a/lib/theme_preview/views/buttons_page.dart +++ b/lib/theme_preview/views/buttons_page.dart @@ -155,7 +155,7 @@ class _IconButtons extends StatelessWidget { onPressed: null, ), ], - ) + ), ], ); } diff --git a/lib/widgets/list_tiles/list_tile.dart b/lib/widgets/list_tiles/list_tile.dart index e34064a8..1c89d8e8 100644 --- a/lib/widgets/list_tiles/list_tile.dart +++ b/lib/widgets/list_tiles/list_tile.dart @@ -46,7 +46,7 @@ class MyListTile extends StatelessWidget { ], ), ), - if (trailing != null) trailing! + if (trailing != null) trailing!, ], ); } diff --git a/packages/annotations/analysis_options.yaml b/packages/annotations/analysis_options.yaml index ba91a970..24b2dee9 100644 --- a/packages/annotations/analysis_options.yaml +++ b/packages/annotations/analysis_options.yaml @@ -3,3 +3,7 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: - "**/*.g.dart" + +linter: + rules: + - require_trailing_commas diff --git a/packages/builder/analysis_options.yaml b/packages/builder/analysis_options.yaml index ba91a970..24b2dee9 100644 --- a/packages/builder/analysis_options.yaml +++ b/packages/builder/analysis_options.yaml @@ -3,3 +3,7 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: - "**/*.g.dart" + +linter: + rules: + - require_trailing_commas diff --git a/packages/builder/lib/src/theme_docs_generator.dart b/packages/builder/lib/src/theme_docs_generator.dart index 59cc5b39..d2db7778 100644 --- a/packages/builder/lib/src/theme_docs_generator.dart +++ b/packages/builder/lib/src/theme_docs_generator.dart @@ -20,7 +20,7 @@ class ThemeDocsGenerator extends GeneratorForAnnotation { 'double', 'bool', 'IconThemeData', - 'TextStyle' + 'TextStyle', }; @override @@ -52,11 +52,13 @@ class ThemeDocsGenerator extends GeneratorForAnnotation { className: 'ThemeData', propertyTypes: propertyTypes, )) - ..addAll(await _getThemeProperties( - className: 'ColorScheme', - propertyTypes: propertyTypes, - targetPropertyName: 'secondary', - )); + ..addAll( + await _getThemeProperties( + className: 'ColorScheme', + propertyTypes: propertyTypes, + targetPropertyName: 'secondary', + ), + ); } else if (className == 'AppBarTheme') { props = await _getThemeProperties( className: apiClassName, diff --git a/test/abstract_text_style/abstract_text_style_cubit_test.dart b/test/abstract_text_style/abstract_text_style_cubit_test.dart index c656a197..553a87dc 100644 --- a/test/abstract_text_style/abstract_text_style_cubit_test.dart +++ b/test/abstract_text_style/abstract_text_style_cubit_test.dart @@ -43,7 +43,7 @@ void main() { expect: () => [ TextStyleState( style: isDark ? cubit.whiteTextStyle : cubit.blackTextStyle, - ) + ), ], ); } diff --git a/test/basic_theme/basic_theme_cubit_test.dart b/test/basic_theme/basic_theme_cubit_test.dart index 6d5b0833..8ebe6865 100644 --- a/test/basic_theme/basic_theme_cubit_test.dart +++ b/test/basic_theme/basic_theme_cubit_test.dart @@ -169,7 +169,7 @@ void main() { onSecondary: color, secondaryContainer: color, onSecondaryContainer: color, - ) + ), ], ); @@ -219,7 +219,7 @@ void main() { onTertiary: color, tertiaryContainer: color, onTertiaryContainer: color, - ) + ), ], ); diff --git a/test/bottom_navigation_bar_theme/bottom_navigation_bar_theme_editor_test.dart b/test/bottom_navigation_bar_theme/bottom_navigation_bar_theme_editor_test.dart index d15e3ea3..7174f1be 100644 --- a/test/bottom_navigation_bar_theme/bottom_navigation_bar_theme_editor_test.dart +++ b/test/bottom_navigation_bar_theme/bottom_navigation_bar_theme_editor_test.dart @@ -100,7 +100,7 @@ void main() { for (var key in [ 'bottomNavigationBarThemeEditor_labelTextStyleCard', - 'bottomNavigationBarThemeEditor_unselectedLabelTextStyleCard' + 'bottomNavigationBarThemeEditor_unselectedLabelTextStyleCard', ]) { expect(find.byKey(Key(key)), findsOneWidget); } diff --git a/test/checkbox_theme/checkbox_theme_cubit_test.dart b/test/checkbox_theme/checkbox_theme_cubit_test.dart index 5c535158..719c8c5b 100644 --- a/test/checkbox_theme/checkbox_theme_cubit_test.dart +++ b/test/checkbox_theme/checkbox_theme_cubit_test.dart @@ -125,7 +125,7 @@ void main() { final props = { MaterialState.pressed: color, MaterialState.hovered: overlayHoveredColor, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props); @@ -140,7 +140,7 @@ void main() { final props = { MaterialState.pressed: overlayPressedColor, MaterialState.hovered: color, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props); diff --git a/test/color_theme/color_theme_cubit_test.dart b/test/color_theme/color_theme_cubit_test.dart index 3d7ee10f..d7a08e23 100644 --- a/test/color_theme/color_theme_cubit_test.dart +++ b/test/color_theme/color_theme_cubit_test.dart @@ -49,7 +49,7 @@ void main() { shadowColor: theme.shadowColor, splashColor: theme.splashColor, unselectedWidgetColor: theme.unselectedWidgetColor, - ) + ), ], ); @@ -80,7 +80,7 @@ void main() { primaryColorDark: swatch[700], indicatorColor: color, secondaryHeaderColor: swatch[50], - ) + ), ]; }, ); @@ -103,7 +103,7 @@ void main() { secondary: color, onSecondary: onColor, ), - ) + ), ]; }, ); @@ -181,7 +181,7 @@ void main() { colorScheme: colorThemeCubit.state.colorScheme.copyWith( error: color, ), - ) + ), ], ); diff --git a/test/home/views/home_page_test.dart b/test/home/views/home_page_test.dart index e49b38bc..84ca6d8a 100644 --- a/test/home/views/home_page_test.dart +++ b/test/home/views/home_page_test.dart @@ -144,7 +144,9 @@ void main() { await tester.pumpAndSettle(); expect( - find.byKey(const Key('usageButton_usageFallback')), findsOneWidget); + find.byKey(const Key('usageButton_usageFallback')), + findsOneWidget, + ); }, ); diff --git a/test/radio_theme/radio_theme_cubit_test.dart b/test/radio_theme/radio_theme_cubit_test.dart index 53d368d4..b495ad59 100644 --- a/test/radio_theme/radio_theme_cubit_test.dart +++ b/test/radio_theme/radio_theme_cubit_test.dart @@ -114,7 +114,7 @@ void main() { final props = { MaterialState.pressed: color, MaterialState.hovered: overlayHoveredColor, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props); @@ -129,7 +129,7 @@ void main() { final props = { MaterialState.pressed: overlayPressedColor, MaterialState.hovered: color, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props); diff --git a/test/switch_theme/switch_theme_cubit_test.dart b/test/switch_theme/switch_theme_cubit_test.dart index a92ac7f5..9dc623ce 100644 --- a/test/switch_theme/switch_theme_cubit_test.dart +++ b/test/switch_theme/switch_theme_cubit_test.dart @@ -191,7 +191,7 @@ void main() { final props = { MaterialState.pressed: color, MaterialState.hovered: overlayHoveredColor, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props); @@ -206,7 +206,7 @@ void main() { final props = { MaterialState.pressed: overlayPressedColor, MaterialState.hovered: color, - MaterialState.focused: overlayFocusedColor + MaterialState.focused: overlayFocusedColor, }; verifyMaterialPropertyByMap(cubit.state.theme.overlayColor!, props);