From 7e983334baa3878c7dc653e289a878c4684712ce Mon Sep 17 00:00:00 2001 From: Joshua Tang Date: Tue, 14 Nov 2023 22:32:03 +1100 Subject: [PATCH] style: fix linting errors --- .../view/abstract_icon_theme_editor.dart | 2 +- .../view/abstract_text_style_editor.dart | 2 +- lib/advanced_theme/views/advanced_editor.dart | 2 +- lib/app.dart | 8 ++--- .../view/app_bar_theme_editor.dart | 24 +++++++------- .../widgets/system_overlay_style_card.dart | 6 ++-- lib/basic_theme/view/basic_theme_editor.dart | 2 +- .../bottom_navigation_bar_theme_editor.dart | 6 ++-- .../view/abstract_button_style_editor.dart | 2 +- .../abstract_flat_button_style_cubit.dart | 4 +-- .../abstract_flat_button_style_editor.dart | 2 +- .../elevated_button_theme_cubit.dart | 4 +-- .../elevated_button_theme_editor.dart | 2 +- .../models/outlined_border_enum.dart | 10 +++--- .../outlined_button_theme_cubit.dart | 4 +-- .../outlined_button_theme_editor.dart | 3 +- .../text_button_theme_cubit.dart | 4 +-- .../text_button_theme_editor.dart | 3 +- .../view/checkbox_theme_editor.dart | 2 +- lib/color_theme/view/color_theme_editor.dart | 2 +- .../floating_action_button_theme_editor.dart | 2 +- lib/font/widgets/font_picker.dart | 2 +- lib/home/views/home_page.dart | 10 +++--- lib/home/widgets/app_theme_mode_button.dart | 2 +- lib/home/widgets/export_button.dart | 2 +- lib/home/widgets/github_button.dart | 2 +- lib/home/widgets/import_button.dart | 2 +- lib/home/widgets/material3_switch.dart | 4 +-- lib/home/widgets/random_theme_button.dart | 2 +- lib/home/widgets/reset_theme_button.dart | 2 +- lib/home/widgets/theme_brightness_switch.dart | 4 +-- lib/home/widgets/usage_button.dart | 8 ++--- lib/icon_theme/icon_theme.dart | 2 +- .../view/input_decoration_theme_editor.dart | 28 ++++++++-------- .../widgets/border_side_fields.dart | 4 +-- lib/radio_theme/view/radio_theme_editor.dart | 2 +- .../view/slider_theme_editor.dart | 2 +- .../view/switch_theme_editor.dart | 2 +- .../view/tab_bar_theme_editor.dart | 6 ++-- lib/text_theme/view/text_theme_editor.dart | 32 +++++++++---------- lib/theme_preview/views/buttons_page.dart | 4 +-- lib/theme_preview/views/inputs_page.dart | 2 +- lib/theme_preview/views/preview_body.dart | 2 +- lib/theme_preview/views/selections_page.dart | 2 +- lib/theme_preview/views/text_page.dart | 2 +- lib/theme_preview/views/theme_preview.dart | 2 +- lib/widgets/cards/card.dart | 4 +-- lib/widgets/cards/material_states_card.dart | 11 +++---- lib/widgets/list_tiles/color_list_tile.dart | 4 +-- .../list_tiles/dropdown_list_tile.dart | 4 +-- lib/widgets/list_tiles/list_tile.dart | 7 ++-- lib/widgets/list_tiles/switch_list_tile.dart | 4 +-- .../list_views/expansion_panel_list.dart | 9 +++--- lib/widgets/list_views/list_view.dart | 4 +-- lib/widgets/list_views/nested_list_view.dart | 2 +- lib/widgets/list_views/side_by_side_list.dart | 3 +- lib/widgets/paddings.dart | 6 ++-- lib/widgets/side_by_side.dart | 3 +- lib/widgets/text_form_field.dart | 4 +-- lib/widgets/tooltip.dart | 3 +- test/abstract_icon_theme/mocks.dart | 2 +- test/abstract_text_style/mocks.dart | 2 +- .../abstract_button_style/mocks.dart | 10 +++--- .../abstract_flat_button_style/mocks.dart | 6 ++-- 64 files changed, 147 insertions(+), 169 deletions(-) diff --git a/lib/abstract_icon_theme/view/abstract_icon_theme_editor.dart b/lib/abstract_icon_theme/view/abstract_icon_theme_editor.dart index 4de792e3..18a5245c 100644 --- a/lib/abstract_icon_theme/view/abstract_icon_theme_editor.dart +++ b/lib/abstract_icon_theme/view/abstract_icon_theme_editor.dart @@ -5,7 +5,7 @@ import 'package:appainter/widgets/widgets.dart'; abstract class AbstractIconThemeEditor extends ExpansionPanelItem { - const AbstractIconThemeEditor({Key? key}) : super(key: key); + const AbstractIconThemeEditor({super.key}); String? get keyPrefix; diff --git a/lib/abstract_text_style/view/abstract_text_style_editor.dart b/lib/abstract_text_style/view/abstract_text_style_editor.dart index e8d6ab50..fad4e27b 100644 --- a/lib/abstract_text_style/view/abstract_text_style_editor.dart +++ b/lib/abstract_text_style/view/abstract_text_style_editor.dart @@ -9,7 +9,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; abstract class AbstractTextStyleEditor extends ExpansionPanelItem { - const AbstractTextStyleEditor({Key? key}) : super(key: key); + const AbstractTextStyleEditor({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/advanced_theme/views/advanced_editor.dart b/lib/advanced_theme/views/advanced_editor.dart index 97f87bb0..ac093fd6 100644 --- a/lib/advanced_theme/views/advanced_editor.dart +++ b/lib/advanced_theme/views/advanced_editor.dart @@ -15,7 +15,7 @@ import 'package:appainter/widgets/widgets.dart'; import 'package:flutter/material.dart'; class AdvancedEditor extends StatelessWidget { - const AdvancedEditor({Key? key}) : super(key: key); + const AdvancedEditor({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/app.dart b/lib/app.dart index eb412aec..58928343 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -25,11 +25,11 @@ class MyApp extends StatelessWidget { final AnalyticsRepository analyticsRepo; const MyApp({ - Key? key, + super.key, required this.homeRepo, required this.fontRepo, required this.analyticsRepo, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -206,7 +206,7 @@ class MyApp extends StatelessWidget { } class _MaterialApp extends StatefulWidget { - const _MaterialApp({Key? key}) : super(key: key); + const _MaterialApp(); @override State<_MaterialApp> createState() => _MaterialAppState(); @@ -238,7 +238,7 @@ class _MaterialAppState extends State<_MaterialApp> { } class _LoadingPage extends StatelessWidget { - const _LoadingPage({Key? key}) : super(key: key); + const _LoadingPage(); @override Widget build(BuildContext context) { diff --git a/lib/app_bar_theme/view/app_bar_theme_editor.dart b/lib/app_bar_theme/view/app_bar_theme_editor.dart index 304f586a..fcf183f3 100644 --- a/lib/app_bar_theme/view/app_bar_theme_editor.dart +++ b/lib/app_bar_theme/view/app_bar_theme_editor.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class AppBarThemeEditor extends ExpansionPanelItem { - const AppBarThemeEditor({Key? key}) : super(key: key); + const AppBarThemeEditor({super.key}); @override String get header => 'App bar'; @@ -51,7 +51,7 @@ class AppBarThemeEditor extends ExpansionPanelItem { } class _BackgroundColorPicker extends StatelessWidget { - const _BackgroundColorPicker({Key? key}) : super(key: key); + const _BackgroundColorPicker(); @override Widget build(BuildContext context) { @@ -73,7 +73,7 @@ class _BackgroundColorPicker extends StatelessWidget { } class _ForegroundColorPicker extends StatelessWidget { - const _ForegroundColorPicker({Key? key}) : super(key: key); + const _ForegroundColorPicker(); @override Widget build(BuildContext context) { @@ -95,7 +95,7 @@ class _ForegroundColorPicker extends StatelessWidget { } class _ElevationTextField extends StatelessWidget { - const _ElevationTextField({Key? key}) : super(key: key); + const _ElevationTextField(); @override Widget build(BuildContext context) { @@ -119,7 +119,7 @@ class _ElevationTextField extends StatelessWidget { } class _ShadowColorPicker extends StatelessWidget { - const _ShadowColorPicker({Key? key}) : super(key: key); + const _ShadowColorPicker(); @override Widget build(BuildContext context) { @@ -140,7 +140,7 @@ class _ShadowColorPicker extends StatelessWidget { } class _CenterTitleSwitch extends StatelessWidget { - const _CenterTitleSwitch({Key? key}) : super(key: key); + const _CenterTitleSwitch(); @override Widget build(BuildContext context) { @@ -164,7 +164,7 @@ class _CenterTitleSwitch extends StatelessWidget { } class _TitleSpacingTextField extends StatelessWidget { - const _TitleSpacingTextField({Key? key}) : super(key: key); + const _TitleSpacingTextField(); @override Widget build(BuildContext context) { @@ -189,7 +189,7 @@ class _TitleSpacingTextField extends StatelessWidget { } class _ToolBarHeightTextField extends StatelessWidget { - const _ToolBarHeightTextField({Key? key}) : super(key: key); + const _ToolBarHeightTextField(); @override Widget build(BuildContext context) { @@ -215,7 +215,7 @@ class _ToolBarHeightTextField extends StatelessWidget { class _ActionsIconThemeCard extends AbstractIconThemeEditor { - const _ActionsIconThemeCard({Key? key}) : super(key: key); + const _ActionsIconThemeCard({super.key}); @override String get keyPrefix => 'appBarThemeEditor_actionsIconThemeCard'; @@ -233,7 +233,7 @@ class _ActionsIconThemeCard } class _IconThemeCard extends AbstractIconThemeEditor { - const _IconThemeCard({Key? key}) : super(key: key); + const _IconThemeCard({super.key}); @override String get keyPrefix => 'appBarThemeEditor_iconThemeCard'; @@ -252,7 +252,7 @@ class _IconThemeCard extends AbstractIconThemeEditor { class _TitleTextStyleCard extends AbstractTextStyleEditor { - const _TitleTextStyleCard({Key? key}) : super(key: key); + const _TitleTextStyleCard({super.key}); @override String get header => 'Title text style'; @@ -263,7 +263,7 @@ class _TitleTextStyleCard class _ToolbarTextStyleCard extends AbstractTextStyleEditor { - const _ToolbarTextStyleCard({Key? key}) : super(key: key); + const _ToolbarTextStyleCard({super.key}); @override String get header => 'Toolbar text style'; 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 c88cec52..5e2bff88 100644 --- a/lib/app_bar_theme/widgets/system_overlay_style_card.dart +++ b/lib/app_bar_theme/widgets/system_overlay_style_card.dart @@ -28,7 +28,7 @@ class SystemOverlayStyleCard extends ExpansionPanelItem { } class _StatusBarColorPicker extends StatelessWidget { - const _StatusBarColorPicker({Key? key}) : super(key: key); + const _StatusBarColorPicker(); @override Widget build(BuildContext context) { @@ -52,7 +52,7 @@ class _StatusBarColorPicker extends StatelessWidget { } class _StatusBarBrightnessDropdown extends StatelessWidget { - const _StatusBarBrightnessDropdown({Key? key}) : super(key: key); + const _StatusBarBrightnessDropdown(); @override Widget build(BuildContext context) { @@ -78,7 +78,7 @@ class _StatusBarBrightnessDropdown extends StatelessWidget { } class _StatusBarIconBrightnessDropdown extends StatelessWidget { - const _StatusBarIconBrightnessDropdown({Key? key}) : super(key: key); + const _StatusBarIconBrightnessDropdown(); @override Widget build(BuildContext context) { diff --git a/lib/basic_theme/view/basic_theme_editor.dart b/lib/basic_theme/view/basic_theme_editor.dart index e6a7e12a..2c32719c 100644 --- a/lib/basic_theme/view/basic_theme_editor.dart +++ b/lib/basic_theme/view/basic_theme_editor.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class BasicThemeEditor extends StatelessWidget { - const BasicThemeEditor({Key? key}) : super(key: key); + const BasicThemeEditor({super.key}); @override Widget build(BuildContext context) { 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 b5041833..000e30a6 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 @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class BottomNavigationBarThemeEditor extends ExpansionPanelItem { - const BottomNavigationBarThemeEditor({Key? key}) : super(key: key); + const BottomNavigationBarThemeEditor({super.key}); @override String get header => 'Bottom navigation bar'; @@ -213,7 +213,7 @@ class _ElevationTextField extends StatelessWidget { class _LabelTextStyleCard extends AbstractTextStyleEditor { - const _LabelTextStyleCard({Key? key}) : super(key: key); + const _LabelTextStyleCard({super.key}); @override String get header => 'Label text style'; @@ -224,7 +224,7 @@ class _LabelTextStyleCard class _UnselectedLabelTextStyleCard extends AbstractTextStyleEditor< BottomNavigationBarUnselectedLabelTextStyleCubit> { - const _UnselectedLabelTextStyleCard({Key? key}) : super(key: key); + const _UnselectedLabelTextStyleCard({super.key}); @override String get header => 'Unselected label text style'; diff --git a/lib/button_theme/abstract_button_style/view/abstract_button_style_editor.dart b/lib/button_theme/abstract_button_style/view/abstract_button_style_editor.dart index 77fc0635..1ba56dc4 100644 --- a/lib/button_theme/abstract_button_style/view/abstract_button_style_editor.dart +++ b/lib/button_theme/abstract_button_style/view/abstract_button_style_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; abstract class AbstractButtonStyleEditor extends ExpansionPanelItem { - const AbstractButtonStyleEditor({Key? key}) : super(key: key); + const AbstractButtonStyleEditor({super.key}); Widget buildBackgroundColorPickers(BuildContext context); diff --git a/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_cubit.dart b/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_cubit.dart index fe136311..2f225e45 100644 --- a/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_cubit.dart +++ b/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_cubit.dart @@ -1,10 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:appainter/color_theme/color_theme.dart'; import 'package:flutter/material.dart'; abstract class AbstractFlatButtonStyleCubit extends AbstractButtonStyleCubit { - AbstractFlatButtonStyleCubit({required ColorThemeCubit colorThemeCubit}) - : super(colorThemeCubit: colorThemeCubit); + AbstractFlatButtonStyleCubit({required super.colorThemeCubit}); void backgroundColorChanged(Color color) { emitWithButtonStyle( diff --git a/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_editor.dart b/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_editor.dart index 43867b68..ae059aeb 100644 --- a/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_editor.dart +++ b/lib/button_theme/abstract_flat_button_style/abstract_flat_button_style_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; abstract class AbstractFlatButtonStyleEditor< T extends AbstractFlatButtonStyleCubit> extends AbstractButtonStyleEditor { - const AbstractFlatButtonStyleEditor({Key? key}) : super(key: key); + const AbstractFlatButtonStyleEditor({super.key}); @override Color fallbackForegroundDefaultColor(ColorScheme colorScheme) { diff --git a/lib/button_theme/elevated_button_theme/elevated_button_theme_cubit.dart b/lib/button_theme/elevated_button_theme/elevated_button_theme_cubit.dart index d877cce3..5bd8d610 100644 --- a/lib/button_theme/elevated_button_theme/elevated_button_theme_cubit.dart +++ b/lib/button_theme/elevated_button_theme/elevated_button_theme_cubit.dart @@ -1,10 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:appainter/color_theme/color_theme.dart'; import 'package:flutter/material.dart'; class ElevatedButtonThemeCubit extends AbstractButtonStyleCubit { - ElevatedButtonThemeCubit({required ColorThemeCubit colorThemeCubit}) - : super(colorThemeCubit: colorThemeCubit); + ElevatedButtonThemeCubit({required super.colorThemeCubit}); @override OutlinedBorder get defaultShape { diff --git a/lib/button_theme/elevated_button_theme/elevated_button_theme_editor.dart b/lib/button_theme/elevated_button_theme/elevated_button_theme_editor.dart index 0b8dd70c..8022a066 100644 --- a/lib/button_theme/elevated_button_theme/elevated_button_theme_editor.dart +++ b/lib/button_theme/elevated_button_theme/elevated_button_theme_editor.dart @@ -8,7 +8,7 @@ class ElevatedButtonThemeEditor extends AbstractButtonStyleEditor { static const _baseElevation = 2.0; - const ElevatedButtonThemeEditor({Key? key}) : super(key: key); + const ElevatedButtonThemeEditor({super.key}); @override Color fallbackForegroundDefaultColor(ColorScheme colorScheme) { diff --git a/lib/button_theme/models/outlined_border_enum.dart b/lib/button_theme/models/outlined_border_enum.dart index 180dc991..1eb82150 100644 --- a/lib/button_theme/models/outlined_border_enum.dart +++ b/lib/button_theme/models/outlined_border_enum.dart @@ -15,15 +15,15 @@ class OutlinedBorderEnum extends EnumModel { @override String? convertToString(OutlinedBorder? value) { switch (value.runtimeType) { - case BeveledRectangleBorder: + case const (BeveledRectangleBorder): return 'Beveled rectangle'; - case CircleBorder: + case const (CircleBorder): return 'Circle'; - case ContinuousRectangleBorder: + case const (ContinuousRectangleBorder): return 'Continuous rectangle'; - case RoundedRectangleBorder: + case const (RoundedRectangleBorder): return 'Rounded rectangle'; - case StadiumBorder: + case const (StadiumBorder): return 'Stadium'; default: return null; diff --git a/lib/button_theme/outlined_button_theme/outlined_button_theme_cubit.dart b/lib/button_theme/outlined_button_theme/outlined_button_theme_cubit.dart index 213b7da1..3491e23f 100644 --- a/lib/button_theme/outlined_button_theme/outlined_button_theme_cubit.dart +++ b/lib/button_theme/outlined_button_theme/outlined_button_theme_cubit.dart @@ -1,10 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:appainter/color_theme/color_theme.dart'; import 'package:flutter/material.dart'; class OutlinedButtonThemeCubit extends AbstractFlatButtonStyleCubit { - OutlinedButtonThemeCubit({required ColorThemeCubit colorThemeCubit}) - : super(colorThemeCubit: colorThemeCubit); + OutlinedButtonThemeCubit({required super.colorThemeCubit}); @override OutlinedBorder get defaultShape { diff --git a/lib/button_theme/outlined_button_theme/outlined_button_theme_editor.dart b/lib/button_theme/outlined_button_theme/outlined_button_theme_editor.dart index 199f3b7a..dc3fd1a2 100644 --- a/lib/button_theme/outlined_button_theme/outlined_button_theme_editor.dart +++ b/lib/button_theme/outlined_button_theme/outlined_button_theme_editor.dart @@ -1,9 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:flutter/material.dart'; class OutlinedButtonThemeEditor extends AbstractFlatButtonStyleEditor { - const OutlinedButtonThemeEditor({Key? key}) : super(key: key); + const OutlinedButtonThemeEditor({super.key}); @override String get header => 'Outlined button'; diff --git a/lib/button_theme/text_button_theme/text_button_theme_cubit.dart b/lib/button_theme/text_button_theme/text_button_theme_cubit.dart index 3785e8e8..5726b3c6 100644 --- a/lib/button_theme/text_button_theme/text_button_theme_cubit.dart +++ b/lib/button_theme/text_button_theme/text_button_theme_cubit.dart @@ -1,10 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:appainter/color_theme/color_theme.dart'; import 'package:flutter/material.dart'; class TextButtonThemeCubit extends AbstractFlatButtonStyleCubit { - TextButtonThemeCubit({required ColorThemeCubit colorThemeCubit}) - : super(colorThemeCubit: colorThemeCubit); + TextButtonThemeCubit({required super.colorThemeCubit}); @override OutlinedBorder get defaultShape { diff --git a/lib/button_theme/text_button_theme/text_button_theme_editor.dart b/lib/button_theme/text_button_theme/text_button_theme_editor.dart index b0e6d118..4d357d29 100644 --- a/lib/button_theme/text_button_theme/text_button_theme_editor.dart +++ b/lib/button_theme/text_button_theme/text_button_theme_editor.dart @@ -1,9 +1,8 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:flutter/material.dart'; class TextButtonThemeEditor extends AbstractFlatButtonStyleEditor { - const TextButtonThemeEditor({Key? key}) : super(key: key); + const TextButtonThemeEditor({super.key}); @override String get header => 'Text button'; diff --git a/lib/checkbox_theme/view/checkbox_theme_editor.dart b/lib/checkbox_theme/view/checkbox_theme_editor.dart index ba56669b..b406db05 100644 --- a/lib/checkbox_theme/view/checkbox_theme_editor.dart +++ b/lib/checkbox_theme/view/checkbox_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class CheckboxThemeEditor extends ExpansionPanelItem { - const CheckboxThemeEditor({Key? key}) : super(key: key); + const CheckboxThemeEditor({super.key}); @override String get header => 'Checkbox'; diff --git a/lib/color_theme/view/color_theme_editor.dart b/lib/color_theme/view/color_theme_editor.dart index dcc3a5a2..1d2583f8 100644 --- a/lib/color_theme/view/color_theme_editor.dart +++ b/lib/color_theme/view/color_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class ColorThemeEditor extends ExpansionPanelItem { - const ColorThemeEditor({Key? key}) : super(key: key); + const ColorThemeEditor({super.key}); @override String get header => 'Colors'; diff --git a/lib/floating_action_button_theme/view/floating_action_button_theme_editor.dart b/lib/floating_action_button_theme/view/floating_action_button_theme_editor.dart index 9e71af99..b3ef6023 100644 --- a/lib/floating_action_button_theme/view/floating_action_button_theme_editor.dart +++ b/lib/floating_action_button_theme/view/floating_action_button_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class FloatingActionButtonThemeEditor extends ExpansionPanelItem { - const FloatingActionButtonThemeEditor({Key? key}) : super(key: key); + const FloatingActionButtonThemeEditor({super.key}); @override String get header => 'Floating action button'; diff --git a/lib/font/widgets/font_picker.dart b/lib/font/widgets/font_picker.dart index b42669c0..28cd73ef 100644 --- a/lib/font/widgets/font_picker.dart +++ b/lib/font/widgets/font_picker.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class FontPicker extends StatelessWidget { - const FontPicker({Key? key, required this.onChanged}) : super(key: key); + const FontPicker({super.key, required this.onChanged}); final ValueChanged onChanged; diff --git a/lib/home/views/home_page.dart b/lib/home/views/home_page.dart index 6dc36c5f..405f3b80 100644 --- a/lib/home/views/home_page.dart +++ b/lib/home/views/home_page.dart @@ -9,7 +9,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class HomePage extends StatefulWidget { - const HomePage({Key? key}) : super(key: key); + const HomePage({super.key}); @override HomePageState createState() => HomePageState(); @@ -194,7 +194,7 @@ class _EditorsContainer extends StatelessWidget { } class _Editors extends StatelessWidget { - const _Editors({Key? key}) : super(key: key); + const _Editors(); @override Widget build(BuildContext context) { @@ -218,7 +218,7 @@ class _Editors extends StatelessWidget { } class _EditModeHeader extends StatelessWidget { - const _EditModeHeader({Key? key}) : super(key: key); + const _EditModeHeader(); @override Widget build(BuildContext context) { @@ -256,7 +256,7 @@ class _EditModeTabBar extends StatelessWidget { } class _EditModeActions extends StatelessWidget { - const _EditModeActions({Key? key}) : super(key: key); + const _EditModeActions(); @override Widget build(BuildContext context) { @@ -271,7 +271,7 @@ class _EditModeActions extends StatelessWidget { } class _ThemeConfigs extends StatelessWidget { - const _ThemeConfigs({Key? key}) : super(key: key); + const _ThemeConfigs(); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/app_theme_mode_button.dart b/lib/home/widgets/app_theme_mode_button.dart index 9d50f2c7..0b13ae58 100644 --- a/lib/home/widgets/app_theme_mode_button.dart +++ b/lib/home/widgets/app_theme_mode_button.dart @@ -5,7 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; class AppThemeModeButton extends StatelessWidget { - const AppThemeModeButton({Key? key}) : super(key: key); + const AppThemeModeButton({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/export_button.dart b/lib/home/widgets/export_button.dart index 5b739d5f..01bef99c 100644 --- a/lib/home/widgets/export_button.dart +++ b/lib/home/widgets/export_button.dart @@ -21,7 +21,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart class ExportButton extends StatelessWidget { final Color color; - const ExportButton({Key? key, required this.color}) : super(key: key); + const ExportButton({super.key, required this.color}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/github_button.dart b/lib/home/widgets/github_button.dart index 715e216a..2f6fbef9 100644 --- a/lib/home/widgets/github_button.dart +++ b/lib/home/widgets/github_button.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; class GithubButton extends StatelessWidget { - const GithubButton({Key? key}) : super(key: key); + const GithubButton({super.key}); static const githubUrl = 'https://github.com/zeshuaro/appainter'; diff --git a/lib/home/widgets/import_button.dart b/lib/home/widgets/import_button.dart index 41e1c682..b4c7b410 100644 --- a/lib/home/widgets/import_button.dart +++ b/lib/home/widgets/import_button.dart @@ -7,7 +7,7 @@ import 'package:ndialog/ndialog.dart'; class ImportButton extends StatefulWidget { final Color color; - const ImportButton({Key? key, required this.color}) : super(key: key); + const ImportButton({super.key, required this.color}); @override State createState() => _ImportButtonState(); diff --git a/lib/home/widgets/material3_switch.dart b/lib/home/widgets/material3_switch.dart index e357ba56..c4bb8ac7 100644 --- a/lib/home/widgets/material3_switch.dart +++ b/lib/home/widgets/material3_switch.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class Material3Switch extends StatelessWidget { - const Material3Switch({Key? key}) : super(key: key); + const Material3Switch({super.key}); @override Widget build(BuildContext context) { @@ -22,7 +22,7 @@ class Material3Switch extends StatelessWidget { } class _Switch extends StatelessWidget { - const _Switch({Key? key}) : super(key: key); + const _Switch(); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/random_theme_button.dart b/lib/home/widgets/random_theme_button.dart index c2892683..6a778465 100644 --- a/lib/home/widgets/random_theme_button.dart +++ b/lib/home/widgets/random_theme_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; class RandomThemeButton extends StatelessWidget { - const RandomThemeButton({Key? key}) : super(key: key); + const RandomThemeButton({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/reset_theme_button.dart b/lib/home/widgets/reset_theme_button.dart index edca6a5d..3b7da06f 100644 --- a/lib/home/widgets/reset_theme_button.dart +++ b/lib/home/widgets/reset_theme_button.dart @@ -7,7 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; class ResetThemeButton extends StatelessWidget { - const ResetThemeButton({Key? key}) : super(key: key); + const ResetThemeButton({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/theme_brightness_switch.dart b/lib/home/widgets/theme_brightness_switch.dart index 96be238c..b0c34234 100644 --- a/lib/home/widgets/theme_brightness_switch.dart +++ b/lib/home/widgets/theme_brightness_switch.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class ThemeBrightnessSwitch extends StatelessWidget { - const ThemeBrightnessSwitch({Key? key}) : super(key: key); + const ThemeBrightnessSwitch({super.key}); @override Widget build(BuildContext context) { @@ -22,7 +22,7 @@ class ThemeBrightnessSwitch extends StatelessWidget { } class _Switch extends StatelessWidget { - const _Switch({Key? key}) : super(key: key); + const _Switch(); @override Widget build(BuildContext context) { diff --git a/lib/home/widgets/usage_button.dart b/lib/home/widgets/usage_button.dart index 1cb65899..77db5942 100644 --- a/lib/home/widgets/usage_button.dart +++ b/lib/home/widgets/usage_button.dart @@ -9,7 +9,7 @@ import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; class UsageButton extends StatelessWidget { - const UsageButton({Key? key}) : super(key: key); + const UsageButton({super.key}); @override Widget build(BuildContext context) { @@ -29,7 +29,7 @@ class UsageButton extends StatelessWidget { } class _UsageDialog extends StatelessWidget { - const _UsageDialog({Key? key}) : super(key: key); + const _UsageDialog(); @override Widget build(BuildContext context) { @@ -63,7 +63,7 @@ class _UsageDialog extends StatelessWidget { class _UsageContent extends StatelessWidget { final ThemeUsage usage; - const _UsageContent({Key? key, required this.usage}) : super(key: key); + const _UsageContent({required this.usage}); @override Widget build(BuildContext context) { @@ -82,7 +82,7 @@ class _UsageContent extends StatelessWidget { } class _UsageFallback extends StatelessWidget { - const _UsageFallback({Key? key}) : super(key: key); + const _UsageFallback({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/icon_theme/icon_theme.dart b/lib/icon_theme/icon_theme.dart index 4c5c96a2..b1a4d4f7 100644 --- a/lib/icon_theme/icon_theme.dart +++ b/lib/icon_theme/icon_theme.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class IconThemeCubit extends AbstractIconThemeCubit {} class IconThemeEditor extends AbstractIconThemeEditor { - const IconThemeEditor({Key? key}) : super(key: key); + const IconThemeEditor({super.key}); @override String get keyPrefix => 'iconThemeEditor'; 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 715ea953..313911b3 100644 --- a/lib/input_decoration_theme/view/input_decoration_theme_editor.dart +++ b/lib/input_decoration_theme/view/input_decoration_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class InputDecorationThemeEditor extends ExpansionPanelItem { - const InputDecorationThemeEditor({Key? key}) : super(key: key); + const InputDecorationThemeEditor({super.key}); @override String get header => 'Input decoration'; @@ -42,7 +42,7 @@ class InputDecorationThemeEditor extends ExpansionPanelItem { } class _FloatingLabelBehaviorDropdown extends StatelessWidget { - const _FloatingLabelBehaviorDropdown({Key? key}) : super(key: key); + const _FloatingLabelBehaviorDropdown(); @override Widget build(BuildContext context) { @@ -71,7 +71,7 @@ class _FloatingLabelBehaviorDropdown extends StatelessWidget { } class _FillColorPicker extends StatelessWidget { - const _FillColorPicker({Key? key}) : super(key: key); + const _FillColorPicker(); static const _fillColor = Color(0x0A000000); @@ -96,7 +96,7 @@ class _FillColorPicker extends StatelessWidget { } class _HoverColorPicker extends StatelessWidget { - const _HoverColorPicker({Key? key}) : super(key: key); + const _HoverColorPicker(); @override Widget build(BuildContext context) { @@ -116,7 +116,7 @@ class _HoverColorPicker extends StatelessWidget { } class _AlignLabelWithHintSwitch extends StatelessWidget { - const _AlignLabelWithHintSwitch({Key? key}) : super(key: key); + const _AlignLabelWithHintSwitch(); @override Widget build(BuildContext context) { @@ -141,7 +141,7 @@ class _AlignLabelWithHintSwitch extends StatelessWidget { } class _FilledSwitch extends StatelessWidget { - const _FilledSwitch({Key? key}) : super(key: key); + const _FilledSwitch(); @override Widget build(BuildContext context) { @@ -163,7 +163,7 @@ class _FilledSwitch extends StatelessWidget { } class _IsCollapsedSwitch extends StatelessWidget { - const _IsCollapsedSwitch({Key? key}) : super(key: key); + const _IsCollapsedSwitch(); @override Widget build(BuildContext context) { @@ -186,7 +186,7 @@ class _IsCollapsedSwitch extends StatelessWidget { } class _IsDenseSwitch extends StatelessWidget { - const _IsDenseSwitch({Key? key}) : super(key: key); + const _IsDenseSwitch(); @override Widget build(BuildContext context) { @@ -208,7 +208,7 @@ class _IsDenseSwitch extends StatelessWidget { } class _ErrorMaxLinesTextField extends StatelessWidget { - const _ErrorMaxLinesTextField({Key? key}) : super(key: key); + const _ErrorMaxLinesTextField(); @override Widget build(BuildContext context) { @@ -233,7 +233,7 @@ class _ErrorMaxLinesTextField extends StatelessWidget { } class _HelperMaxLinesTextField extends StatelessWidget { - const _HelperMaxLinesTextField({Key? key}) : super(key: key); + const _HelperMaxLinesTextField(); @override Widget build(BuildContext context) { @@ -281,7 +281,7 @@ class _BorderDropdown extends StatelessWidget { } class _BorderRadiusTextField extends StatefulWidget { - const _BorderRadiusTextField({Key? key}) : super(key: key); + const _BorderRadiusTextField(); @override State<_BorderRadiusTextField> createState() => _BorderRadiusTextFieldState(); @@ -345,7 +345,7 @@ class _BorderRadiusTextFieldState extends State<_BorderRadiusTextField> { } class _EnabledBorderSideFields extends StatelessWidget { - const _EnabledBorderSideFields({Key? key}) : super(key: key); + const _EnabledBorderSideFields(); @override Widget build(BuildContext context) { @@ -370,7 +370,7 @@ class _EnabledBorderSideFields extends StatelessWidget { } class _DisabledBorderSideFields extends StatelessWidget { - const _DisabledBorderSideFields({Key? key}) : super(key: key); + const _DisabledBorderSideFields(); @override Widget build(BuildContext context) { @@ -393,7 +393,7 @@ class _DisabledBorderSideFields extends StatelessWidget { } class _ErrorBorderSideFields extends StatelessWidget { - const _ErrorBorderSideFields({Key? key}) : super(key: key); + const _ErrorBorderSideFields(); @override Widget build(BuildContext context) { diff --git a/lib/input_decoration_theme/widgets/border_side_fields.dart b/lib/input_decoration_theme/widgets/border_side_fields.dart index 4762fc09..6b31f661 100644 --- a/lib/input_decoration_theme/widgets/border_side_fields.dart +++ b/lib/input_decoration_theme/widgets/border_side_fields.dart @@ -8,12 +8,12 @@ class BorderSideFields extends StatelessWidget { final ValueChanged onWidthChanged; const BorderSideFields({ - Key? key, + super.key, required this.headerPrefix, required this.borderSide, required this.onColorChanged, required this.onWidthChanged, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/radio_theme/view/radio_theme_editor.dart b/lib/radio_theme/view/radio_theme_editor.dart index 4d8896a5..b07b1fb8 100644 --- a/lib/radio_theme/view/radio_theme_editor.dart +++ b/lib/radio_theme/view/radio_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class RadioThemeEditor extends ExpansionPanelItem { - const RadioThemeEditor({Key? key}) : super(key: key); + const RadioThemeEditor({super.key}); @override String get header => 'Radio'; diff --git a/lib/slider_theme/view/slider_theme_editor.dart b/lib/slider_theme/view/slider_theme_editor.dart index 37c11451..1a22a489 100644 --- a/lib/slider_theme/view/slider_theme_editor.dart +++ b/lib/slider_theme/view/slider_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class SliderThemeEditor extends ExpansionPanelItem { - const SliderThemeEditor({Key? key}) : super(key: key); + const SliderThemeEditor({super.key}); @override String get header => 'Slider'; diff --git a/lib/switch_theme/view/switch_theme_editor.dart b/lib/switch_theme/view/switch_theme_editor.dart index aa245509..d8b5aa0c 100644 --- a/lib/switch_theme/view/switch_theme_editor.dart +++ b/lib/switch_theme/view/switch_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class SwitchThemeEditor extends ExpansionPanelItem { - const SwitchThemeEditor({Key? key}) : super(key: key); + const SwitchThemeEditor({super.key}); @override String get header => 'Switch'; diff --git a/lib/tab_bar_theme/view/tab_bar_theme_editor.dart b/lib/tab_bar_theme/view/tab_bar_theme_editor.dart index ddec8870..6a36942f 100644 --- a/lib/tab_bar_theme/view/tab_bar_theme_editor.dart +++ b/lib/tab_bar_theme/view/tab_bar_theme_editor.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class TabBarThemeEditor extends ExpansionPanelItem { - const TabBarThemeEditor({Key? key}) : super(key: key); + const TabBarThemeEditor({super.key}); @override String get header => 'Tab bar'; @@ -104,7 +104,7 @@ class _IndicatorSizeDropdown extends StatelessWidget { class _LabelTextStyleCard extends AbstractTextStyleEditor { - const _LabelTextStyleCard({Key? key}) : super(key: key); + const _LabelTextStyleCard({super.key}); @override String get header => 'Label text style'; @@ -115,7 +115,7 @@ class _LabelTextStyleCard class _UnselectedLabelTextStyleCard extends AbstractTextStyleEditor { - const _UnselectedLabelTextStyleCard({Key? key}) : super(key: key); + const _UnselectedLabelTextStyleCard({super.key}); @override String get header => 'Unselected label text style'; diff --git a/lib/text_theme/view/text_theme_editor.dart b/lib/text_theme/view/text_theme_editor.dart index 3be07da8..e7293011 100644 --- a/lib/text_theme/view/text_theme_editor.dart +++ b/lib/text_theme/view/text_theme_editor.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class TextThemeEditor extends ExpansionPanelItem { - const TextThemeEditor({Key? key}) : super(key: key); + const TextThemeEditor({super.key}); @override String get header => 'Text theme'; @@ -47,7 +47,7 @@ class TextThemeEditor extends ExpansionPanelItem { class DisplayLargeTextStyleEditor extends AbstractTextStyleEditor { - const DisplayLargeTextStyleEditor({Key? key}) : super(key: key); + const DisplayLargeTextStyleEditor({super.key}); @override String get header => 'Display large'; @@ -55,7 +55,7 @@ class DisplayLargeTextStyleEditor class DisplayMediumTextStyleEditor extends AbstractTextStyleEditor { - const DisplayMediumTextStyleEditor({Key? key}) : super(key: key); + const DisplayMediumTextStyleEditor({super.key}); @override String get header => 'Display medium'; @@ -63,7 +63,7 @@ class DisplayMediumTextStyleEditor class DisplaySmallTextStyleEditor extends AbstractTextStyleEditor { - const DisplaySmallTextStyleEditor({Key? key}) : super(key: key); + const DisplaySmallTextStyleEditor({super.key}); @override String get header => 'Display small'; @@ -71,7 +71,7 @@ class DisplaySmallTextStyleEditor class HeadlineLargeTextStyleEditor extends AbstractTextStyleEditor { - const HeadlineLargeTextStyleEditor({Key? key}) : super(key: key); + const HeadlineLargeTextStyleEditor({super.key}); @override String get header => 'Headline large'; @@ -79,7 +79,7 @@ class HeadlineLargeTextStyleEditor class HeadlineMediumTextStyleEditor extends AbstractTextStyleEditor { - const HeadlineMediumTextStyleEditor({Key? key}) : super(key: key); + const HeadlineMediumTextStyleEditor({super.key}); @override String get header => 'Headline medium'; @@ -87,7 +87,7 @@ class HeadlineMediumTextStyleEditor class HeadlineSmallTextStyleEditor extends AbstractTextStyleEditor { - const HeadlineSmallTextStyleEditor({Key? key}) : super(key: key); + const HeadlineSmallTextStyleEditor({super.key}); @override String get header => 'Headline small'; @@ -95,7 +95,7 @@ class HeadlineSmallTextStyleEditor class TitleLargeTextStyleEditor extends AbstractTextStyleEditor { - const TitleLargeTextStyleEditor({Key? key}) : super(key: key); + const TitleLargeTextStyleEditor({super.key}); @override String get header => 'Title large'; @@ -103,7 +103,7 @@ class TitleLargeTextStyleEditor class TitleMediumTextStyleEditor extends AbstractTextStyleEditor { - const TitleMediumTextStyleEditor({Key? key}) : super(key: key); + const TitleMediumTextStyleEditor({super.key}); @override String get header => 'Title medium'; @@ -111,7 +111,7 @@ class TitleMediumTextStyleEditor class TitleSmallTextStyleEditor extends AbstractTextStyleEditor { - const TitleSmallTextStyleEditor({Key? key}) : super(key: key); + const TitleSmallTextStyleEditor({super.key}); @override String get header => 'Title small'; @@ -119,7 +119,7 @@ class TitleSmallTextStyleEditor class LabelLargeTextStyleEditor extends AbstractTextStyleEditor { - const LabelLargeTextStyleEditor({Key? key}) : super(key: key); + const LabelLargeTextStyleEditor({super.key}); @override String get header => 'Label large'; @@ -127,7 +127,7 @@ class LabelLargeTextStyleEditor class LabelMediumTextStyleEditor extends AbstractTextStyleEditor { - const LabelMediumTextStyleEditor({Key? key}) : super(key: key); + const LabelMediumTextStyleEditor({super.key}); @override String get header => 'Label medium'; @@ -135,7 +135,7 @@ class LabelMediumTextStyleEditor class LabelSmallTextStyleEditor extends AbstractTextStyleEditor { - const LabelSmallTextStyleEditor({Key? key}) : super(key: key); + const LabelSmallTextStyleEditor({super.key}); @override String get header => 'Label small'; @@ -143,7 +143,7 @@ class LabelSmallTextStyleEditor class BodyLargeTextStyleEditor extends AbstractTextStyleEditor { - const BodyLargeTextStyleEditor({Key? key}) : super(key: key); + const BodyLargeTextStyleEditor({super.key}); @override String get header => 'Body large'; @@ -151,7 +151,7 @@ class BodyLargeTextStyleEditor class BodyMediumTextStyleEditor extends AbstractTextStyleEditor { - const BodyMediumTextStyleEditor({Key? key}) : super(key: key); + const BodyMediumTextStyleEditor({super.key}); @override String get header => 'Body medium'; @@ -159,7 +159,7 @@ class BodyMediumTextStyleEditor class BodySmallTextStyleEditor extends AbstractTextStyleEditor { - const BodySmallTextStyleEditor({Key? key}) : super(key: key); + const BodySmallTextStyleEditor({super.key}); @override String get header => 'Body small'; diff --git a/lib/theme_preview/views/buttons_page.dart b/lib/theme_preview/views/buttons_page.dart index e6d3533d..d8712f0b 100644 --- a/lib/theme_preview/views/buttons_page.dart +++ b/lib/theme_preview/views/buttons_page.dart @@ -6,7 +6,7 @@ import 'package:appainter/widgets/widgets.dart'; const Icon _buttonIcon = Icon(Icons.favorite); class ButtonsPage extends PreviewBody { - const ButtonsPage({Key? key}) : super(key: key); + const ButtonsPage({super.key}); @override IconData get icon => Icons.touch_app; @@ -108,7 +108,7 @@ class ButtonsPage extends PreviewBody { class _ButtonsRow extends StatelessWidget { final List children; - const _ButtonsRow({Key? key, required this.children}) : super(key: key); + const _ButtonsRow({required this.children}); @override Widget build(BuildContext context) { diff --git a/lib/theme_preview/views/inputs_page.dart b/lib/theme_preview/views/inputs_page.dart index 23cc7f18..f46c581b 100644 --- a/lib/theme_preview/views/inputs_page.dart +++ b/lib/theme_preview/views/inputs_page.dart @@ -4,7 +4,7 @@ import 'package:appainter/theme_preview/views/preview_body.dart'; import 'package:appainter/widgets/widgets.dart'; class InputsPage extends PreviewBody { - const InputsPage({Key? key}) : super(key: key); + const InputsPage({super.key}); @override IconData get icon => Icons.keyboard; diff --git a/lib/theme_preview/views/preview_body.dart b/lib/theme_preview/views/preview_body.dart index 9ed2e2d0..010e67e7 100644 --- a/lib/theme_preview/views/preview_body.dart +++ b/lib/theme_preview/views/preview_body.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; abstract class PreviewBody extends StatelessWidget { - const PreviewBody({Key? key}) : super(key: key); + const PreviewBody({super.key}); IconData get icon; String get label; diff --git a/lib/theme_preview/views/selections_page.dart b/lib/theme_preview/views/selections_page.dart index 2f2250b6..e9cb8f0b 100644 --- a/lib/theme_preview/views/selections_page.dart +++ b/lib/theme_preview/views/selections_page.dart @@ -5,7 +5,7 @@ import 'package:appainter/widgets/widgets.dart'; import 'package:intl/intl.dart'; class SelectionsPage extends PreviewBody { - const SelectionsPage({Key? key}) : super(key: key); + const SelectionsPage({super.key}); @override IconData get icon => Icons.select_all; diff --git a/lib/theme_preview/views/text_page.dart b/lib/theme_preview/views/text_page.dart index 10655194..ab25fbc3 100644 --- a/lib/theme_preview/views/text_page.dart +++ b/lib/theme_preview/views/text_page.dart @@ -4,7 +4,7 @@ import 'package:appainter/widgets/widgets.dart'; import 'package:flutter/material.dart'; class TextPage extends PreviewBody { - const TextPage({Key? key}) : super(key: key); + const TextPage({super.key}); @override IconData get icon => Icons.text_fields; diff --git a/lib/theme_preview/views/theme_preview.dart b/lib/theme_preview/views/theme_preview.dart index 9983ca77..d76e3d12 100644 --- a/lib/theme_preview/views/theme_preview.dart +++ b/lib/theme_preview/views/theme_preview.dart @@ -28,7 +28,7 @@ class ThemePreview extends StatelessWidget { TextPage(), ]; - const ThemePreview({Key? key}) : super(key: key); + const ThemePreview({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/cards/card.dart b/lib/widgets/cards/card.dart index e6524dc1..55489eff 100644 --- a/lib/widgets/cards/card.dart +++ b/lib/widgets/cards/card.dart @@ -9,13 +9,13 @@ class MyCard extends StatelessWidget { final GestureTapCallback? onTap; const MyCard({ - Key? key, + super.key, required this.child, this.padding = kPaddingAll, this.color, this.margin, this.onTap, - }) : super(key: key); + }); static final colorDark = Colors.grey[800]; static final colorLight = Colors.grey[50]; diff --git a/lib/widgets/cards/material_states_card.dart b/lib/widgets/cards/material_states_card.dart index 6a4d6755..c0cdc609 100644 --- a/lib/widgets/cards/material_states_card.dart +++ b/lib/widgets/cards/material_states_card.dart @@ -25,11 +25,11 @@ class MaterialStatesCard extends StatelessWidget { final List> items; const MaterialStatesCard({ - Key? key, + super.key, required this.header, required this.items, this.tooltip, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -69,8 +69,7 @@ class _Header extends StatelessWidget { final String header; final String? tooltip; - const _Header({Key? key, required this.header, this.tooltip}) - : super(key: key); + const _Header({required this.header, this.tooltip}); @override Widget build(BuildContext context) { @@ -95,13 +94,13 @@ class _StateListTile extends StatelessWidget { final bool colorEnableOpacity; const _StateListTile({ - Key? key, + super.key, required this.title, required this.value, required this.onValueChanged, this.tooltip, this.colorEnableOpacity = true, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_tiles/color_list_tile.dart b/lib/widgets/list_tiles/color_list_tile.dart index f546cdc0..c5cb5f3a 100644 --- a/lib/widgets/list_tiles/color_list_tile.dart +++ b/lib/widgets/list_tiles/color_list_tile.dart @@ -12,13 +12,13 @@ class ColorListTile extends StatelessWidget { final bool enableOpacity; const ColorListTile({ - Key? key, + super.key, required this.title, required this.color, required this.onColorChanged, this.enableOpacity = true, this.tooltip, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_tiles/dropdown_list_tile.dart b/lib/widgets/list_tiles/dropdown_list_tile.dart index dcbfa5d4..ec84a139 100644 --- a/lib/widgets/list_tiles/dropdown_list_tile.dart +++ b/lib/widgets/list_tiles/dropdown_list_tile.dart @@ -10,13 +10,13 @@ class DropdownListTile extends StatelessWidget { final void Function(String?) onChanged; const DropdownListTile({ - Key? key, + super.key, required this.title, required this.value, required this.values, required this.onChanged, this.tooltip, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_tiles/list_tile.dart b/lib/widgets/list_tiles/list_tile.dart index 506481e8..e34064a8 100644 --- a/lib/widgets/list_tiles/list_tile.dart +++ b/lib/widgets/list_tiles/list_tile.dart @@ -9,13 +9,13 @@ class MyListTile extends StatelessWidget { final Widget? trailing; const MyListTile({ - Key? key, + super.key, required this.title, this.titleColor, this.tooltip, this.subtitle, this.trailing, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -57,8 +57,7 @@ class _Title extends StatelessWidget { final Color? titleColor; final String? tooltip; - const _Title({Key? key, required this.title, this.titleColor, this.tooltip}) - : super(key: key); + const _Title({required this.title, this.titleColor, this.tooltip}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_tiles/switch_list_tile.dart b/lib/widgets/list_tiles/switch_list_tile.dart index 1ad09375..6722926d 100644 --- a/lib/widgets/list_tiles/switch_list_tile.dart +++ b/lib/widgets/list_tiles/switch_list_tile.dart @@ -10,13 +10,13 @@ class MySwitchListTile extends StatelessWidget { final String? label; const MySwitchListTile({ - Key? key, + super.key, required this.title, required this.value, required this.onChanged, this.tooltip, this.label, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_views/expansion_panel_list.dart b/lib/widgets/list_views/expansion_panel_list.dart index 3b8d71cf..4c732f89 100644 --- a/lib/widgets/list_views/expansion_panel_list.dart +++ b/lib/widgets/list_views/expansion_panel_list.dart @@ -7,7 +7,7 @@ abstract class ExpansionPanelItem extends StatelessWidget { String get header; String? get tooltip => null; - const ExpansionPanelItem({Key? key}) : super(key: key); + const ExpansionPanelItem({super.key}); } class MyExpansionPanelList extends StatefulWidget { @@ -15,13 +15,12 @@ class MyExpansionPanelList extends StatefulWidget { final Color? color; MyExpansionPanelList({ - Key? key, + super.key, List? items, ExpansionPanelItem? item, this.color, }) : assert(items != null || item != null), - items = items ?? [item!], - super(key: key); + items = items ?? [item!]; @override State createState() => _MyExpansionPanelListState(); @@ -61,7 +60,7 @@ class _MyExpansionPanelListState extends State { class _Header extends StatelessWidget { final ExpansionPanelItem item; - const _Header({Key? key, required this.item}) : super(key: key); + const _Header({required this.item}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_views/list_view.dart b/lib/widgets/list_views/list_view.dart index e73d50ae..a193c370 100644 --- a/lib/widgets/list_views/list_view.dart +++ b/lib/widgets/list_views/list_view.dart @@ -8,12 +8,12 @@ class MyListView extends StatelessWidget { final EdgeInsets? padding; const MyListView({ - Key? key, + super.key, required this.children, this.shrinkwrap = false, this.physics, this.padding, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_views/nested_list_view.dart b/lib/widgets/list_views/nested_list_view.dart index cdb3dfcb..cd4904e9 100644 --- a/lib/widgets/list_views/nested_list_view.dart +++ b/lib/widgets/list_views/nested_list_view.dart @@ -5,7 +5,7 @@ import 'package:appainter/widgets/widgets.dart'; class NestedListView extends StatelessWidget { final List children; - const NestedListView({Key? key, required this.children}) : super(key: key); + const NestedListView({super.key, required this.children}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/list_views/side_by_side_list.dart b/lib/widgets/list_views/side_by_side_list.dart index 9bd5f06c..898bcc27 100644 --- a/lib/widgets/list_views/side_by_side_list.dart +++ b/lib/widgets/list_views/side_by_side_list.dart @@ -6,8 +6,7 @@ class SideBySideList extends StatelessWidget { final List children; final EdgeInsets? padding; - const SideBySideList({Key? key, required this.children, this.padding}) - : super(key: key); + const SideBySideList({super.key, required this.children, this.padding}); static const _chunkSize = 2; diff --git a/lib/widgets/paddings.dart b/lib/widgets/paddings.dart index 2e9be749..81bbae6d 100644 --- a/lib/widgets/paddings.dart +++ b/lib/widgets/paddings.dart @@ -6,8 +6,7 @@ enum PaddingSize { small, medium, normal, large, extraLarge } class VerticalPadding extends StatelessWidget { final PaddingSize size; - const VerticalPadding({Key? key, this.size = PaddingSize.normal}) - : super(key: key); + const VerticalPadding({super.key, this.size = PaddingSize.normal}); @override Widget build(BuildContext context) { @@ -18,8 +17,7 @@ class VerticalPadding extends StatelessWidget { class HorizontalPadding extends StatelessWidget { final PaddingSize size; - const HorizontalPadding({Key? key, this.size = PaddingSize.normal}) - : super(key: key); + const HorizontalPadding({super.key, this.size = PaddingSize.normal}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/side_by_side.dart b/lib/widgets/side_by_side.dart index 5af6caa2..9df9db42 100644 --- a/lib/widgets/side_by_side.dart +++ b/lib/widgets/side_by_side.dart @@ -4,8 +4,7 @@ class SideBySide extends StatelessWidget { final Widget left; final Widget right; - const SideBySide({Key? key, required this.left, required this.right}) - : super(key: key); + const SideBySide({super.key, required this.left, required this.right}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/text_form_field.dart b/lib/widgets/text_form_field.dart index 7f59d411..5a70bbbb 100644 --- a/lib/widgets/text_form_field.dart +++ b/lib/widgets/text_form_field.dart @@ -12,7 +12,7 @@ class MyTextFormField extends StatelessWidget { final bool allowNegative; const MyTextFormField({ - Key? key, + super.key, required this.labelText, required this.onChanged, this.initialValue, @@ -20,7 +20,7 @@ class MyTextFormField extends StatelessWidget { this.controller, this.tooltip, this.allowNegative = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/tooltip.dart b/lib/widgets/tooltip.dart index c3aa9556..2eae7071 100644 --- a/lib/widgets/tooltip.dart +++ b/lib/widgets/tooltip.dart @@ -5,8 +5,7 @@ class MyTooltip extends StatelessWidget { final String? tooltip; final Widget child; - const MyTooltip({Key? key, this.tooltip, required this.child}) - : super(key: key); + const MyTooltip({super.key, this.tooltip, required this.child}); @override Widget build(BuildContext context) { diff --git a/test/abstract_icon_theme/mocks.dart b/test/abstract_icon_theme/mocks.dart index a2d963b7..dd09cf58 100644 --- a/test/abstract_icon_theme/mocks.dart +++ b/test/abstract_icon_theme/mocks.dart @@ -8,7 +8,7 @@ class MockIconThemeCubit extends MockCubit implements TestIconThemeCubit {} class TestIconThemeEditor extends AbstractIconThemeEditor { - const TestIconThemeEditor({Key? key}) : super(key: key); + const TestIconThemeEditor({super.key}); @override String? get keyPrefix => null; diff --git a/test/abstract_text_style/mocks.dart b/test/abstract_text_style/mocks.dart index 9120b1b1..8b278a45 100644 --- a/test/abstract_text_style/mocks.dart +++ b/test/abstract_text_style/mocks.dart @@ -14,7 +14,7 @@ class MockTextStyleCubit extends MockCubit implements TestTextStyleCubit {} class TestIconThemeEditor extends AbstractTextStyleEditor { - const TestIconThemeEditor({Key? key}) : super(key: key); + const TestIconThemeEditor({super.key}); @override String get header => 'Test'; diff --git a/test/button_theme/abstract_button_style/mocks.dart b/test/button_theme/abstract_button_style/mocks.dart index b95cdf53..d6f2c751 100644 --- a/test/button_theme/abstract_button_style/mocks.dart +++ b/test/button_theme/abstract_button_style/mocks.dart @@ -1,17 +1,15 @@ import 'package:appainter/button_theme/abstract_button_style/abstract_button_style.dart'; -import 'package:appainter/color_theme/cubit/color_theme_cubit.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; class TestButtonStyleCubit extends AbstractButtonStyleCubit { TestButtonStyleCubit({ - required ColorThemeCubit colorThemeCubit, + required super.colorThemeCubit, OutlinedBorder? shape, - }) : shape = shape ?? + }) : shape = shape ?? RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), - ), - super(colorThemeCubit: colorThemeCubit); + ); final OutlinedBorder shape; @@ -40,7 +38,7 @@ class TestButtonStyleEditor extends AbstractButtonStyleEditor { static const _color = Colors.blue; - const TestButtonStyleEditor({Key? key}) : super(key: key); + const TestButtonStyleEditor({super.key}); @override Color fallbackForegroundDefaultColor(ColorScheme colorScheme) => _color; diff --git a/test/button_theme/abstract_flat_button_style/mocks.dart b/test/button_theme/abstract_flat_button_style/mocks.dart index 0f2a760b..29d8d144 100644 --- a/test/button_theme/abstract_flat_button_style/mocks.dart +++ b/test/button_theme/abstract_flat_button_style/mocks.dart @@ -1,11 +1,9 @@ import 'package:appainter/button_theme/button_theme.dart'; -import 'package:appainter/color_theme/cubit/color_theme_cubit.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; class TestFlatButtonStyleCubit extends AbstractFlatButtonStyleCubit { - TestFlatButtonStyleCubit({required ColorThemeCubit colorThemeCubit}) - : super(colorThemeCubit: colorThemeCubit); + TestFlatButtonStyleCubit({required super.colorThemeCubit}); @override OutlinedBorder get defaultShape => const RoundedRectangleBorder(); @@ -28,7 +26,7 @@ class MockFlatButtonStyleCubit extends MockCubit class TestFlatButtonStyleEditor extends AbstractFlatButtonStyleEditor { - const TestFlatButtonStyleEditor({Key? key}) : super(key: key); + const TestFlatButtonStyleEditor({super.key}); @override String get header => 'Test';