From baf9ef4ae0e99c8a85c5b89088f0c6716cdeedcc Mon Sep 17 00:00:00 2001 From: Jordy de Jonghe Date: Fri, 18 Oct 2024 14:11:15 +0200 Subject: [PATCH] #359: finished debug screen --- assets/images/icons/add.svg | 3 + assets/images/icons/android/add.svg | 1 - assets/images/icons/android/back.svg | 1 - assets/images/icons/android/close.svg | 1 - assets/images/icons/android/done.svg | 1 - assets/images/icons/android/download.svg | 1 - assets/images/icons/android/list.svg | 1 - assets/images/icons/android/settings.svg | 1 - assets/images/icons/animation.svg | 3 + assets/images/icons/arrow_left.svg | 3 + assets/images/icons/check.svg | 3 + assets/images/icons/chevron_right.svg | 3 + assets/images/icons/download.svg | 3 + assets/images/icons/file.svg | 3 + assets/images/icons/ios/add.svg | 1 - assets/images/icons/ios/back.svg | 1 - assets/images/icons/ios/close.svg | 1 - assets/images/icons/ios/done.svg | 1 - assets/images/icons/ios/download.svg | 1 - assets/images/icons/ios/list.svg | 1 - assets/images/icons/ios/settings.svg | 1 - assets/images/icons/license.svg | 3 + assets/images/icons/settings.svg | 3 + assets/images/icons/theme.svg | 3 + assets/images/icons/todo.svg | 3 + assets/images/icons/translations.svg | 3 + .../bottom_navigation_tab.dart | 19 ++- lib/screen/debug/debug_screen.dart | 156 +++++++++++------- .../analytics_permission_screen.dart | 2 +- .../todo/todo_list/todo_list_screen.dart | 30 +++- lib/styles/theme_assets.dart | 40 ++--- lib/styles/theme_colors.dart | 4 +- lib/styles/theme_data.dart | 22 ++- lib/styles/theme_dimens.dart | 5 + lib/widget/debug/debug_row_item.dart | 2 +- lib/widget/debug/debug_row_title.dart | 27 +-- lib/widget/debug/debug_section.dart | 57 +++++++ lib/widget/debug/selector_item.dart | 2 +- lib/widget/general/action/action_item.dart | 4 +- .../bottom_navigation/bottom_navigation.dart | 37 +++-- .../bottom_navigation_item.dart | 15 +- .../simple_screen/base_screen_header.dart | 3 +- .../styled/flutter_template_back_button.dart | 4 +- .../styled/flutter_template_checkbox.dart | 2 +- .../styled/flutter_template_switch.dart | 31 +++- pubspec.yaml | 2 - test/styles/theme_assets_test.dart | 40 ++--- test/widget/debug/debug_row_title_test.dart | 6 +- .../general/action/action_item_test.dart | 6 +- test/widget/general/svg_icon_test.dart | 4 +- 50 files changed, 383 insertions(+), 187 deletions(-) create mode 100644 assets/images/icons/add.svg delete mode 100644 assets/images/icons/android/add.svg delete mode 100644 assets/images/icons/android/back.svg delete mode 100644 assets/images/icons/android/close.svg delete mode 100644 assets/images/icons/android/done.svg delete mode 100644 assets/images/icons/android/download.svg delete mode 100644 assets/images/icons/android/list.svg delete mode 100644 assets/images/icons/android/settings.svg create mode 100644 assets/images/icons/animation.svg create mode 100644 assets/images/icons/arrow_left.svg create mode 100644 assets/images/icons/check.svg create mode 100644 assets/images/icons/chevron_right.svg create mode 100644 assets/images/icons/download.svg create mode 100644 assets/images/icons/file.svg delete mode 100644 assets/images/icons/ios/add.svg delete mode 100644 assets/images/icons/ios/back.svg delete mode 100644 assets/images/icons/ios/close.svg delete mode 100644 assets/images/icons/ios/done.svg delete mode 100644 assets/images/icons/ios/download.svg delete mode 100644 assets/images/icons/ios/list.svg delete mode 100644 assets/images/icons/ios/settings.svg create mode 100644 assets/images/icons/license.svg create mode 100644 assets/images/icons/settings.svg create mode 100644 assets/images/icons/theme.svg create mode 100644 assets/images/icons/todo.svg create mode 100644 assets/images/icons/translations.svg create mode 100644 lib/widget/debug/debug_section.dart diff --git a/assets/images/icons/add.svg b/assets/images/icons/add.svg new file mode 100644 index 00000000..02e4a95b --- /dev/null +++ b/assets/images/icons/add.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/android/add.svg b/assets/images/icons/android/add.svg deleted file mode 100644 index ca2fbd67..00000000 --- a/assets/images/icons/android/add.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/back.svg b/assets/images/icons/android/back.svg deleted file mode 100644 index 5bba7586..00000000 --- a/assets/images/icons/android/back.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/close.svg b/assets/images/icons/android/close.svg deleted file mode 100644 index 350d4fdc..00000000 --- a/assets/images/icons/android/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/done.svg b/assets/images/icons/android/done.svg deleted file mode 100644 index 784eb128..00000000 --- a/assets/images/icons/android/done.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/download.svg b/assets/images/icons/android/download.svg deleted file mode 100644 index de915ffc..00000000 --- a/assets/images/icons/android/download.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/list.svg b/assets/images/icons/android/list.svg deleted file mode 100644 index f57ea6b1..00000000 --- a/assets/images/icons/android/list.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/android/settings.svg b/assets/images/icons/android/settings.svg deleted file mode 100644 index ef27416a..00000000 --- a/assets/images/icons/android/settings.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/animation.svg b/assets/images/icons/animation.svg new file mode 100644 index 00000000..bb7d7027 --- /dev/null +++ b/assets/images/icons/animation.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/arrow_left.svg b/assets/images/icons/arrow_left.svg new file mode 100644 index 00000000..5142d836 --- /dev/null +++ b/assets/images/icons/arrow_left.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/check.svg b/assets/images/icons/check.svg new file mode 100644 index 00000000..53747a5c --- /dev/null +++ b/assets/images/icons/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/chevron_right.svg b/assets/images/icons/chevron_right.svg new file mode 100644 index 00000000..5ef325bf --- /dev/null +++ b/assets/images/icons/chevron_right.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/download.svg b/assets/images/icons/download.svg new file mode 100644 index 00000000..02ba39df --- /dev/null +++ b/assets/images/icons/download.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/file.svg b/assets/images/icons/file.svg new file mode 100644 index 00000000..54a8fec8 --- /dev/null +++ b/assets/images/icons/file.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/ios/add.svg b/assets/images/icons/ios/add.svg deleted file mode 100644 index ca2fbd67..00000000 --- a/assets/images/icons/ios/add.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/back.svg b/assets/images/icons/ios/back.svg deleted file mode 100644 index 22c492c0..00000000 --- a/assets/images/icons/ios/back.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/close.svg b/assets/images/icons/ios/close.svg deleted file mode 100644 index 350d4fdc..00000000 --- a/assets/images/icons/ios/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/done.svg b/assets/images/icons/ios/done.svg deleted file mode 100644 index 784eb128..00000000 --- a/assets/images/icons/ios/done.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/download.svg b/assets/images/icons/ios/download.svg deleted file mode 100644 index de915ffc..00000000 --- a/assets/images/icons/ios/download.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/list.svg b/assets/images/icons/ios/list.svg deleted file mode 100644 index f57ea6b1..00000000 --- a/assets/images/icons/ios/list.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/ios/settings.svg b/assets/images/icons/ios/settings.svg deleted file mode 100644 index ef27416a..00000000 --- a/assets/images/icons/ios/settings.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/icons/license.svg b/assets/images/icons/license.svg new file mode 100644 index 00000000..0eca634d --- /dev/null +++ b/assets/images/icons/license.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/settings.svg b/assets/images/icons/settings.svg new file mode 100644 index 00000000..3498bf54 --- /dev/null +++ b/assets/images/icons/settings.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/theme.svg b/assets/images/icons/theme.svg new file mode 100644 index 00000000..d4c7b155 --- /dev/null +++ b/assets/images/icons/theme.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/todo.svg b/assets/images/icons/todo.svg new file mode 100644 index 00000000..76c58b67 --- /dev/null +++ b/assets/images/icons/todo.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/translations.svg b/assets/images/icons/translations.svg new file mode 100644 index 00000000..683237f7 --- /dev/null +++ b/assets/images/icons/translations.svg @@ -0,0 +1,3 @@ + + + diff --git a/lib/model/bottom_navigation/bottom_navigation_tab.dart b/lib/model/bottom_navigation/bottom_navigation_tab.dart index dd88aaf8..f4a46504 100644 --- a/lib/model/bottom_navigation/bottom_navigation_tab.dart +++ b/lib/model/bottom_navigation/bottom_navigation_tab.dart @@ -1,17 +1,28 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/screen/debug/debug_screen.dart'; import 'package:flutter_template/screen/todo/todo_list/todo_list_screen.dart'; +import 'package:flutter_template/styles/theme_assets.dart'; import 'package:flutter_template/util/locale/localization_keys.dart'; enum BottomNavigationTab { - todo(icon: Icons.list, labelKey: LocalizationKeys.todoTitle), - settings(icon: Icons.settings, labelKey: LocalizationKeys.settingsTitle); + todo( + iconActive: ThemeAssets.todoIcon, + iconInactive: ThemeAssets.todoIcon, + labelKey: LocalizationKeys.todoTitle, + ), + settings( + iconActive: ThemeAssets.settingsIcon, + iconInactive: ThemeAssets.settingsIcon, + labelKey: LocalizationKeys.settingsTitle, + ); - final IconData icon; + final String iconActive; + final String iconInactive; final String labelKey; const BottomNavigationTab({ - required this.icon, + required this.iconActive, + required this.iconInactive, required this.labelKey, }); diff --git a/lib/screen/debug/debug_screen.dart b/lib/screen/debug/debug_screen.dart index fd5b6990..88f5c1d2 100644 --- a/lib/screen/debug/debug_screen.dart +++ b/lib/screen/debug/debug_screen.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart'; import 'package:flutter_template/di/injectable.dart'; +import 'package:flutter_template/styles/theme_assets.dart'; import 'package:flutter_template/util/keys.dart'; import 'package:flutter_template/viewmodel/debug/debug_viewmodel.dart'; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart'; import 'package:flutter_template/widget/debug/debug_row_item.dart'; -import 'package:flutter_template/widget/debug/debug_row_title.dart'; +import 'package:flutter_template/widget/debug/debug_section.dart'; import 'package:flutter_template/widget/debug/debug_switch_row_item.dart'; import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/provider/provider_widget.dart'; @@ -27,70 +28,111 @@ class DebugScreenState extends State { create: () => getIt()..init(), consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen( title: localization.settingsTitle, - padding: EdgeInsets.zero, + padding: const EdgeInsets.symmetric(horizontal: 24), isScrollable: true, children: [ - DebugRowTitle(title: localization.debugAnimationsTitle), - DebugRowSwitchItem( - key: Keys.debugSlowAnimations, - title: localization.debugSlowAnimations, - value: viewModel.slowAnimationsEnabled, - onChanged: viewModel.onSlowAnimationsChanged, + DebugSection( + title: localization.debugAnimationsTitle, + icon: ThemeAssets.animationIcon, + children: [ + DebugRowSwitchItem( + key: Keys.debugSlowAnimations, + title: localization.debugSlowAnimations, + value: viewModel.slowAnimationsEnabled, + onChanged: viewModel.onSlowAnimationsChanged, + ), + ], ), - DebugRowTitle(title: localization.debugThemeTitle), - DebugRowItem( - key: Keys.debugTargetPlatform, - title: localization.debugTargetPlatformTitle, - subTitle: localization.debugTargetPlatformSubtitle(localization.getTranslation(Provider.of(context).getCurrentPlatform())), - onClick: viewModel.onTargetPlatformClicked, + const SizedBox(height: 24), + DebugSection( + title: localization.debugThemeTitle, + icon: ThemeAssets.themeIcon, + children: [ + DebugRowItem( + key: Keys.debugTargetPlatform, + title: localization.debugTargetPlatformTitle, + subTitle: localization.debugTargetPlatformSubtitle(localization.getTranslation(Provider.of(context).getCurrentPlatform())), + onClick: viewModel.onTargetPlatformClicked, + ), + DebugRowItem( + key: Keys.debugThemeMode, + title: localization.debugThemeModeTitle, + subTitle: localization.debugThemeModeSubtitle, + onClick: viewModel.onThemeModeClicked, + ), + ], ), - DebugRowItem( - key: Keys.debugThemeMode, - title: localization.debugThemeModeTitle, - subTitle: localization.debugThemeModeSubtitle, - onClick: viewModel.onThemeModeClicked, + const SizedBox(height: 24), + DebugSection( + title: localization.debugLocaleTitle, + icon: ThemeAssets.translationsIcon, + children: [ + DebugRowItem( + key: Keys.debugSelectLanguage, + title: localization.debugLocaleSelector, + subTitle: localization.debugLocaleCurrentLanguage(Provider.of(context).getCurrentLanguage()), + onClick: viewModel.onSelectLanguageClicked, + ), + DebugRowSwitchItem( + key: Keys.debugShowTranslations, + title: localization.debugShowTranslations, + value: Provider.of(context, listen: false).showsTranslationKeys, + onChanged: (_) => Provider.of(context, listen: false).toggleTranslationKeys(), + ), + ], ), - DebugRowTitle(title: localization.debugLocaleTitle), - DebugRowItem( - key: Keys.debugSelectLanguage, - title: localization.debugLocaleSelector, - subTitle: localization.debugLocaleCurrentLanguage(Provider.of(context).getCurrentLanguage()), - onClick: viewModel.onSelectLanguageClicked, + const SizedBox(height: 24), + DebugSection( + title: localization.debugLicensesTitle, + icon: ThemeAssets.licenseIcon, + children: [ + DebugRowItem( + key: Keys.debugLicense, + title: localization.debugLicensesGoTo, + onClick: viewModel.onLicensesClicked, + ), + ], ), - DebugRowSwitchItem( - key: Keys.debugShowTranslations, - title: localization.debugShowTranslations, - value: Provider.of(context, listen: false).showsTranslationKeys, - onChanged: (_) => Provider.of(context, listen: false).toggleTranslationKeys(), + const SizedBox(height: 24), + DebugSection( + title: localization.debugDatabase, + icon: ThemeAssets.fileIcon, + children: [ + DebugRowItem( + key: Keys.debugDatabase, + title: localization.debugViewDatabase, + onClick: viewModel.goToDatabase, + ), + ], ), - DebugRowTitle(title: localization.debugLicensesTitle), - DebugRowItem( - key: Keys.debugLicense, - title: localization.debugLicensesGoTo, - onClick: viewModel.onLicensesClicked, + const SizedBox(height: 24), + DebugSection( + title: localization.debugPermissionsTitle, + icon: ThemeAssets.fileIcon, + children: [ + DebugRowItem( + key: Keys.debugPermissionAnalytics, + title: localization.debugPermissionsShowAnalyticsPermission, + onClick: viewModel.goToAnalyticsPermissionScreen, + ), + DebugRowItem( + key: Keys.debugPermissionAnalyticsReset, + title: localization.debugPermissionResetAnalytics, + onClick: viewModel.resetAnalyticsPermission, + ), + ], ), - DebugRowTitle(title: localization.debugDatabase), - DebugRowItem( - key: Keys.debugDatabase, - title: localization.debugViewDatabase, - onClick: viewModel.goToDatabase, - ), - DebugRowTitle(title: localization.debugPermissionsTitle), - DebugRowItem( - key: Keys.debugPermissionAnalytics, - title: localization.debugPermissionsShowAnalyticsPermission, - onClick: viewModel.goToAnalyticsPermissionScreen, - ), - DebugRowItem( - key: Keys.debugPermissionAnalyticsReset, - title: localization.debugPermissionResetAnalytics, - onClick: viewModel.resetAnalyticsPermission, - ), - const DebugRowTitle(title: 'logs'), - DebugRowItem( - key: Keys.debugPermissionAnalyticsReset, - title: 'Show logs', - onClick: viewModel.onLogsTapped, + const SizedBox(height: 24), + DebugSection( + title: 'logs', + icon: ThemeAssets.fileIcon, + children: [ + DebugRowItem( + key: Keys.debugPermissionAnalyticsReset, + title: 'Show logs', + onClick: viewModel.onLogsTapped, + ), + ], ), ], ), diff --git a/lib/screen/permission/analytics_permission_screen.dart b/lib/screen/permission/analytics_permission_screen.dart index caa18964..f551d4a7 100644 --- a/lib/screen/permission/analytics_permission_screen.dart +++ b/lib/screen/permission/analytics_permission_screen.dart @@ -29,7 +29,7 @@ class AnalyticsPermissionScreen extends StatelessWidget { Expanded( flex: 5, child: SvgPicture.asset( - ThemeAssets.analyticsImage(context), + ThemeAssets.analyticsImage, alignment: Alignment.center, fit: BoxFit.scaleDown, ), diff --git a/lib/screen/todo/todo_list/todo_list_screen.dart b/lib/screen/todo/todo_list/todo_list_screen.dart index b1d09931..fe9de1dc 100644 --- a/lib/screen/todo/todo_list/todo_list_screen.dart +++ b/lib/screen/todo/todo_list/todo_list_screen.dart @@ -8,6 +8,7 @@ import 'package:flutter_template/viewmodel/todo/todo_list/todo_list_viewmodel.da import 'package:flutter_template/widget/general/action/action_item.dart'; import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_progress_indicator.dart'; +import 'package:flutter_template/widget/general/svg_icon.dart'; import 'package:flutter_template/widget/provider/provider_widget.dart'; import 'package:flutter_template/widget/todo/todo_row_item.dart'; @@ -32,13 +33,13 @@ class TodoListScreenState extends State { actions: [ ActionItem( key: Keys.downloadAction, - svgAsset: ThemeAssets.downloadIcon(context), + svgAsset: ThemeAssets.downloadIcon, onClick: viewModel.onDownloadClicked, color: theme.appBarAction, ), ActionItem( key: Keys.addAction, - svgAsset: ThemeAssets.addIcon(context), + svgAsset: ThemeAssets.addIcon, onClick: viewModel.onAddClicked, color: theme.appBarAction, ), @@ -65,10 +66,27 @@ class TodoListScreenState extends State { return Center( child: Padding( padding: const EdgeInsets.all(32), - child: Text( - localization.todoEmptyState, - textAlign: TextAlign.center, - style: theme.text.bodyNormal, + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: theme.fillInformative, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgIcon( + svgAsset: ThemeAssets.fileIcon, + color: theme.accent, + ), + const SizedBox(height: 8), + Text( + localization.todoEmptyState, + textAlign: TextAlign.center, + style: theme.text.bodyNormal, + ), + ], + ), ), ), ); diff --git a/lib/styles/theme_assets.dart b/lib/styles/theme_assets.dart index f87172c9..13d5932a 100644 --- a/lib/styles/theme_assets.dart +++ b/lib/styles/theme_assets.dart @@ -1,33 +1,33 @@ -import 'package:flutter/material.dart'; -import 'package:icapps_architecture/icapps_architecture.dart'; - class ThemeAssets { ThemeAssets._(); - static String _getIcon(BuildContext context, String name) { - if (context.isIOSTheme) { - return 'assets/images/icons/ios/$name.svg'; - } - return 'assets/images/icons/android/$name.svg'; - } + static const _assetPrefix = 'assets'; + static const _imageAssetPrefix = '$_assetPrefix/images'; + static const _iconsAssetPrefix = '$_imageAssetPrefix/icons'; + + static const addIcon = '$_iconsAssetPrefix/add.svg'; + + static const downloadIcon = '$_iconsAssetPrefix/download.svg'; + + static const animationIcon = '$_iconsAssetPrefix/animation.svg'; + + static const arrowLeftIcon = '$_iconsAssetPrefix/arrow_left.svg'; - static String _getImage(BuildContext context, String name) { - return 'assets/images/$name.svg'; - } + static const checkIcon = '$_iconsAssetPrefix/check.svg'; - static String listIcon(BuildContext context) => _getIcon(context, 'list'); + static const chevronRightIcon = '$_iconsAssetPrefix/chevron_right.svg'; - static String settingsIcon(BuildContext context) => _getIcon(context, 'settings'); + static const fileIcon = '$_iconsAssetPrefix/file.svg'; - static String addIcon(BuildContext context) => _getIcon(context, 'add'); + static const licenseIcon = '$_iconsAssetPrefix/license.svg'; - static String downloadIcon(BuildContext context) => _getIcon(context, 'download'); + static const settingsIcon = '$_iconsAssetPrefix/settings.svg'; - static String closeIcon(BuildContext context) => _getIcon(context, 'close'); + static const themeIcon = '$_iconsAssetPrefix/theme.svg'; - static String backIcon(BuildContext context) => _getIcon(context, 'back'); + static const todoIcon = '$_iconsAssetPrefix/todo.svg'; - static String doneIcon(BuildContext context) => _getIcon(context, 'done'); + static const translationsIcon = '$_iconsAssetPrefix/translations.svg'; - static String analyticsImage(BuildContext context) => _getImage(context, 'analytics'); + static const analyticsImage = '$_imageAssetPrefix/analytics.png'; } diff --git a/lib/styles/theme_colors.dart b/lib/styles/theme_colors.dart index 215bfe9b..86b25225 100644 --- a/lib/styles/theme_colors.dart +++ b/lib/styles/theme_colors.dart @@ -6,14 +6,16 @@ class ThemeColors { static const primary = Color(0xFF002548); static const primaryDark = Color(0xFF001223); static const accent = Color(0xFF009AC7); + static const lightAccent = Color(0xFFECF5FE); static const accentDark = Color(0xFF0080A8); static const white = Color(0xFFFFFFFF); static const white20 = Color(0x33FFFFFF); static const white50 = Color(0x80FFFFFF); static const black = Color(0xFF000000); static const grey = Color(0xB3000000); //black 70% + static const fadedGrey = Color(0xFF6C7B89); static const mediumGrey = Color(0x80000000); //black 50% - static const lightGrey = Color(0x33000000); //black 20% + static const lightGrey = Color(0xFFDDE1E4); static const backgroundGrey = Color(0xFFF1F2F3); static const disabledGrey = Color(0xFFE6E6E6); static const shadow = Color(0x1e000000); //black 12% diff --git a/lib/styles/theme_data.dart b/lib/styles/theme_data.dart index cd5867d4..f938f0af 100644 --- a/lib/styles/theme_data.dart +++ b/lib/styles/theme_data.dart @@ -89,6 +89,7 @@ enum FlutterTemplateThemeStyle { class FlutterTemplateTheme { final bool isDarkTheme; final Color text; + final Color fadedText; final Color inverseText; final Color errorText; final Color buttonTextDisabled; @@ -109,6 +110,7 @@ class FlutterTemplateTheme { final Color buttonText; final Color inverseButtonText; final Color textButtonText; + final Color fillInformative; final Color bottomNavbarBackground; final Color bottomNavbarItemActive; @@ -127,7 +129,8 @@ class FlutterTemplateTheme { static final _instanceDark = FlutterTemplateTheme._( isDarkTheme: true, - text: ThemeColors.white, + text: ThemeColors.primary, + fadedText: ThemeColors.fadedGrey, inverseText: ThemeColors.black, errorText: ThemeColors.error, primary: ThemeColors.primary, @@ -138,7 +141,7 @@ class FlutterTemplateTheme { inverseBackground: ThemeColors.white, disabled: ThemeColors.disabledGrey, icon: ThemeColors.white, - appBarAction: ThemeColors.white, + appBarAction: ThemeColors.primary, inverseIcon: ThemeColors.black, progressIndicator: ThemeColors.primary, inverseProgressIndicator: ThemeColors.white, @@ -158,24 +161,26 @@ class FlutterTemplateTheme { inputFieldBorderIdle: ThemeColors.white50, inputFieldCursor: ThemeColors.accent, debugTitleBackground: ThemeColors.white20, + fillInformative: ThemeColors.lightAccent, ); static final _instanceLight = FlutterTemplateTheme._( isDarkTheme: false, - text: ThemeColors.black, + text: ThemeColors.primary, + fadedText: ThemeColors.fadedGrey, inverseText: ThemeColors.white, errorText: ThemeColors.error, primary: ThemeColors.primary, accent: ThemeColors.accent, secondary: ThemeColors.black, - background: ThemeColors.white, + background: ThemeColors.backgroundGrey, permissionScreenBackground: ThemeColors.white, inverseBackground: ThemeColors.white, inputFieldFill: ThemeColors.white, inputFieldHint: ThemeColors.mediumGrey, disabled: ThemeColors.disabledGrey, icon: ThemeColors.primary, - appBarAction: ThemeColors.white, + appBarAction: ThemeColors.primary, inverseIcon: ThemeColors.black, progressIndicator: ThemeColors.primary, inverseProgressIndicator: ThemeColors.white, @@ -193,11 +198,13 @@ class FlutterTemplateTheme { inputFieldBorderIdle: ThemeColors.mediumGrey, inputFieldCursor: ThemeColors.accent, debugTitleBackground: ThemeColors.lightGrey, + fillInformative: ThemeColors.lightAccent, ); FlutterTemplateTheme._({ required this.isDarkTheme, required this.text, + required this.fadedText, required this.inverseText, required this.errorText, required this.buttonTextDisabled, @@ -228,6 +235,7 @@ class FlutterTemplateTheme { required this.inputFieldBorderIdle, required this.inputFieldCursor, required this.debugTitleBackground, + required this.fillInformative, }); static FlutterTemplateTheme of(BuildContext context, {bool forceDark = false, bool forceLight = false}) { @@ -290,8 +298,8 @@ extension TextStyleExtension on TextStyle { extension ShadowsExtension on Color { List get bottomNavShadow => [ BoxShadow( - spreadRadius: 2, - blurRadius: 8, + spreadRadius: 8, + blurRadius: 16, color: this, ) ]; diff --git a/lib/styles/theme_dimens.dart b/lib/styles/theme_dimens.dart index 39aaf5ea..d0585d34 100644 --- a/lib/styles/theme_dimens.dart +++ b/lib/styles/theme_dimens.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + class ThemeDimens { ThemeDimens._(); @@ -6,6 +8,9 @@ class ThemeDimens { static const double enabledOpacity = 1; static const double disabledOpacity = 0.24; + static const double smallIconSize = 20; static const double iconSize = 24; static const double largeIcon = 32; + + static BorderRadius circularBorderRadius = BorderRadius.circular(9999); } diff --git a/lib/widget/debug/debug_row_item.dart b/lib/widget/debug/debug_row_item.dart index 39661b7e..febf2216 100644 --- a/lib/widget/debug/debug_row_item.dart +++ b/lib/widget/debug/debug_row_item.dart @@ -33,7 +33,7 @@ class DebugRowItem extends StatelessWidget { style: theme.text.bodyBig, ), if (subTitle != null) ...[ - Container(height: 4), + Container(height: 8), Text( subTitle!, style: theme.text.bodySmall, diff --git a/lib/widget/debug/debug_row_title.dart b/lib/widget/debug/debug_row_title.dart index aa441948..3f7e30d3 100644 --- a/lib/widget/debug/debug_row_title.dart +++ b/lib/widget/debug/debug_row_title.dart @@ -1,28 +1,35 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/styles/theme_data.dart'; +import 'package:flutter_template/styles/theme_dimens.dart'; +import 'package:flutter_template/widget/general/svg_icon.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; class DebugRowTitle extends StatelessWidget { final String title; + final String icon; const DebugRowTitle({ required this.title, + required this.icon, super.key, }); @override Widget build(BuildContext context) { return DataProviderWidget( - childBuilderTheme: (context, theme) => Container( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - color: theme.debugTitleBackground, - child: Text( - title, - style: theme.text.titleNormal, - ), + childBuilderTheme: (context, theme) => Row( + children: [ + SvgIcon( + svgAsset: icon, + color: theme.fadedText, + size: ThemeDimens.smallIconSize, + ), + const SizedBox(width: 4), + Text( + title, + style: theme.fadedText.bodySmall, + ), + ], ), ); } diff --git a/lib/widget/debug/debug_section.dart b/lib/widget/debug/debug_section.dart new file mode 100644 index 00000000..4df0c03a --- /dev/null +++ b/lib/widget/debug/debug_section.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_template/widget/debug/debug_row_title.dart'; +import 'package:flutter_template/widget/provider/data_provider_widget.dart'; +import 'package:icapps_architecture/icapps_architecture.dart'; + +class DebugSection extends StatelessWidget { + final String title; + final String icon; + final List children; + + const DebugSection({ + required this.title, + required this.icon, + required this.children, + super.key, + }); + + @override + Widget build(BuildContext context) { + return DataProviderWidget( + childBuilder: (context, theme, localization) => Column( + mainAxisSize: MainAxisSize.min, + children: [ + DebugRowTitle( + title: title, + icon: icon, + ), + const SizedBox(height: 8), + Container( + decoration: BoxDecoration( + color: theme.inverseBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: children + .mapIndexed((index, child) { + final isLast = index == children.length - 1; + return [ + child, + if (!isLast) + Container( + margin: const EdgeInsets.symmetric(horizontal: 8), + height: 1, + color: theme.debugTitleBackground, + ), + ]; + }) + .expand((item) => item) + .toList(), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widget/debug/selector_item.dart b/lib/widget/debug/selector_item.dart index 1f67f4d5..7bc2a417 100644 --- a/lib/widget/debug/selector_item.dart +++ b/lib/widget/debug/selector_item.dart @@ -35,7 +35,7 @@ class SelectorItem extends StatelessWidget { Opacity( opacity: selected ? 1 : 0, child: SvgIcon( - svgAsset: ThemeAssets.doneIcon(context), + svgAsset: ThemeAssets.checkIcon, color: theme.accent, ), ), diff --git a/lib/widget/general/action/action_item.dart b/lib/widget/general/action/action_item.dart index e5c7402f..6c97122a 100644 --- a/lib/widget/general/action/action_item.dart +++ b/lib/widget/general/action/action_item.dart @@ -19,8 +19,8 @@ class ActionItem extends StatelessWidget { Widget build(BuildContext context) { return DataProviderWidget( childBuilderTheme: (context, theme) => SizedBox( - height: 56, - width: 56, + height: 48, + width: 48, child: Center( child: SizedBox( height: 48, diff --git a/lib/widget/general/bottom_navigation/bottom_navigation.dart b/lib/widget/general/bottom_navigation/bottom_navigation.dart index 7b9a5ff4..9fef7dcf 100644 --- a/lib/widget/general/bottom_navigation/bottom_navigation.dart +++ b/lib/widget/general/bottom_navigation/bottom_navigation.dart @@ -21,25 +21,28 @@ class BottomNavigation extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: theme.bottomNavbarBackground, - boxShadow: theme.shadow.bottomNavShadow, + boxShadow: theme.fillInformative.withOpacity(0.6).bottomNavShadow, ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SafeArea( - top: false, - child: Row( - children: BottomNavigationTab.values - .map((tab) => BottomNavigationItem( - isSelected: selectedTab == tab, - icon: tab.icon, - labelKey: tab.labelKey, - onTap: () => onItemTapped(tab), - )) - .toList(), + child: ClipRect( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SafeArea( + top: false, + child: Row( + children: BottomNavigationTab.values + .map((tab) => BottomNavigationItem( + isSelected: selectedTab == tab, + iconActive: tab.iconActive, + iconInactive: tab.iconInactive, + labelKey: tab.labelKey, + onTap: () => onItemTapped(tab), + )) + .toList(), + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/widget/general/bottom_navigation/bottom_navigation_item.dart b/lib/widget/general/bottom_navigation/bottom_navigation_item.dart index ab9767b0..8d79548c 100644 --- a/lib/widget/general/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widget/general/bottom_navigation/bottom_navigation_item.dart @@ -4,13 +4,15 @@ import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/styles/theme_durations.dart'; import 'package:flutter_template/util/extension/text_scaler_extensions.dart'; import 'package:flutter_template/widget/animation/animated_color_filter.dart'; +import 'package:flutter_template/widget/general/svg_icon.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; import 'package:icapps_architecture/icapps_architecture.dart'; class BottomNavigationItem extends StatelessWidget { final bool isSelected; final String labelKey; - final IconData icon; + final String iconActive; + final String iconInactive; final VoidCallback onTap; static const _itemHeight = 56.0; @@ -18,7 +20,8 @@ class BottomNavigationItem extends StatelessWidget { const BottomNavigationItem({ required this.isSelected, required this.labelKey, - required this.icon, + required this.iconActive, + required this.iconInactive, required this.onTap, super.key, }); @@ -33,8 +36,8 @@ class BottomNavigationItem extends StatelessWidget { children: [ AnimatedColorFilter( color: isSelected ? theme.bottomNavbarItemActive : theme.bottomNavbarItemInactive, - builder: (context, color) => Icon( - icon, + builder: (context, color) => SvgIcon( + svgAsset: isSelected ? iconActive : iconInactive, color: color, size: hasSpaceForLabel ? ThemeDimens.iconSize : ThemeDimens.largeIcon, ), @@ -43,9 +46,7 @@ class BottomNavigationItem extends StatelessWidget { const SizedBox(height: 2), AnimatedDefaultTextStyle( duration: ThemeDurations.shortAnimationDuration, - style: isSelected - ? theme.bottomNavbarItemActive.bodySmall - : theme.bottomNavbarItemInactive.bodySmall, + style: isSelected ? theme.bottomNavbarItemActive.bodySmall : theme.bottomNavbarItemInactive.bodySmall, child: Text( localization.getTranslation(labelKey), maxLines: 1, diff --git a/lib/widget/general/simple_screen/base_screen_header.dart b/lib/widget/general/simple_screen/base_screen_header.dart index 3e0594e4..3969b571 100644 --- a/lib/widget/general/simple_screen/base_screen_header.dart +++ b/lib/widget/general/simple_screen/base_screen_header.dart @@ -34,7 +34,7 @@ class BaseScreenHeader extends StatelessWidget { ? null : Text( title!.toUpperCase(), - style: theme.inverseText.bodyNormal, + style: theme.text.bodyNormal, textAlign: isTitleCentered ? TextAlign.center : TextAlign.start, ); @@ -43,7 +43,6 @@ class BaseScreenHeader extends StatelessWidget { horizontal: 16, vertical: 12, ), - color: theme.primary, child: SafeArea( bottom: false, child: Stack( diff --git a/lib/widget/general/styled/flutter_template_back_button.dart b/lib/widget/general/styled/flutter_template_back_button.dart index 3a5a5d74..0a608d56 100644 --- a/lib/widget/general/styled/flutter_template_back_button.dart +++ b/lib/widget/general/styled/flutter_template_back_button.dart @@ -36,8 +36,8 @@ class FlutterTemplateBackButton extends StatelessWidget { String getCorrectIcon(BuildContext context) { if (fullScreen) { - return ThemeAssets.closeIcon(context); + return ThemeAssets.arrowLeftIcon; } - return ThemeAssets.backIcon(context); + return ThemeAssets.arrowLeftIcon; } } diff --git a/lib/widget/general/styled/flutter_template_checkbox.dart b/lib/widget/general/styled/flutter_template_checkbox.dart index 9a672800..a1af0c06 100644 --- a/lib/widget/general/styled/flutter_template_checkbox.dart +++ b/lib/widget/general/styled/flutter_template_checkbox.dart @@ -27,7 +27,7 @@ class FlutterTemplateCheckBox extends StatelessWidget { child: value ? Center( child: SvgIcon( - svgAsset: ThemeAssets.doneIcon(context), + svgAsset: ThemeAssets.checkIcon, color: theme.accent, size: 24, ), diff --git a/lib/widget/general/styled/flutter_template_switch.dart b/lib/widget/general/styled/flutter_template_switch.dart index 6c36c9b2..38212f6d 100644 --- a/lib/widget/general/styled/flutter_template_switch.dart +++ b/lib/widget/general/styled/flutter_template_switch.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_template/styles/theme_dimens.dart'; +import 'package:flutter_template/styles/theme_durations.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; class FlutterTemplateSwitch extends StatelessWidget { @@ -14,12 +16,29 @@ class FlutterTemplateSwitch extends StatelessWidget { @override Widget build(BuildContext context) { return DataProviderWidget( - childBuilderTheme: (context, theme) => Switch.adaptive( - value: value, - onChanged: onChanged, - activeColor: theme.accent, - inactiveTrackColor: theme.disabled, - ), + childBuilderTheme: (context, theme) { + return Container( + height: 24, + width: 42, + decoration: BoxDecoration( + color: value ? theme.accent : theme.disabled, + borderRadius: ThemeDimens.circularBorderRadius, + ), + child: AnimatedAlign( + duration: ThemeDurations.shortAnimationDuration, + alignment: value ? Alignment.centerRight : Alignment.centerLeft, + child: Container( + margin: const EdgeInsets.all(2), + height: 20, + width: 20, + decoration: BoxDecoration( + color: theme.background, + borderRadius: ThemeDimens.circularBorderRadius, + ), + ), + ), + ); + }, ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 6734efd4..8c225a79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,8 +85,6 @@ flutter: - assets/locale/ - assets/images/ - assets/images/icons/ - - assets/images/icons/android/ - - assets/images/icons/ios/ fonts: - family: OpenSans fonts: diff --git a/test/styles/theme_assets_test.dart b/test/styles/theme_assets_test.dart index 916b17b6..192db70d 100644 --- a/test/styles/theme_assets_test.dart +++ b/test/styles/theme_assets_test.dart @@ -9,49 +9,49 @@ import '../util/test_util.dart'; void main() { group('Android Asset icons', () { testWidgets('ThemeAsset list', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.listIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.todoIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_list_android'); }); testWidgets('ThemeAsset settings', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.settingsIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.settingsIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_settings_android'); }); testWidgets('ThemeAsset add', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.addIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.addIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_add_android'); }); testWidgets('ThemeAsset download', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.downloadIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.downloadIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_download_android'); }); testWidgets('ThemeAsset close', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.closeIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.arrowLeftIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_close_android'); }); testWidgets('ThemeAsset back', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.backIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.arrowLeftIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_back_android'); }); testWidgets('ThemeAsset done', (tester) async { - const sut = IconAssetTesterAndroid(getAsset: ThemeAssets.doneIcon); + const sut = IconAssetTesterAndroid(asset: ThemeAssets.checkIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_done_android'); @@ -60,49 +60,49 @@ void main() { group('IOS Asset icons', () { testWidgets('ThemeAsset list', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.listIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.todoIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_list_ios'); }); testWidgets('ThemeAsset settings', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.settingsIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.settingsIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_settings_ios'); }); testWidgets('ThemeAsset add', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.addIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.addIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_add_ios'); }); testWidgets('ThemeAsset download', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.downloadIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.downloadIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_download_ios'); }); testWidgets('ThemeAsset close', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.closeIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.arrowLeftIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_close_ios'); }); testWidgets('ThemeAsset back', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.backIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.arrowLeftIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_back_ios'); }); testWidgets('ThemeAsset done', (tester) async { - const sut = IconAssetTesterIOS(getAsset: ThemeAssets.doneIcon); + const sut = IconAssetTesterIOS(asset: ThemeAssets.checkIcon); await TestUtil.loadWidgetWithText(tester, sut); await TestUtil.takeScreenshot(tester, 'theme_asset_done_ios'); @@ -111,10 +111,10 @@ void main() { } class IconAssetTesterAndroid extends StatelessWidget { - final String Function(BuildContext context) getAsset; + final String asset; const IconAssetTesterAndroid({ - required this.getAsset, + required this.asset, super.key, }); @@ -124,7 +124,7 @@ class IconAssetTesterAndroid extends StatelessWidget { data: FlutterTemplateThemeData.lightTheme(TargetPlatform.android), child: LayoutBuilder( builder: (context, constraint) => SvgPicture.asset( - getAsset(context), + asset, height: 64, width: 64, colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn), @@ -135,10 +135,10 @@ class IconAssetTesterAndroid extends StatelessWidget { } class IconAssetTesterIOS extends StatelessWidget { - final String Function(BuildContext context) getAsset; + final String asset; const IconAssetTesterIOS({ - required this.getAsset, + required this.asset, super.key, }); @@ -148,7 +148,7 @@ class IconAssetTesterIOS extends StatelessWidget { data: FlutterTemplateThemeData.lightTheme(TargetPlatform.iOS), child: LayoutBuilder( builder: (context, constraint) => SvgPicture.asset( - getAsset(context), + asset, height: 64, width: 64, colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn), diff --git a/test/widget/debug/debug_row_title_test.dart b/test/widget/debug/debug_row_title_test.dart index a8300901..9b9c2223 100644 --- a/test/widget/debug/debug_row_title_test.dart +++ b/test/widget/debug/debug_row_title_test.dart @@ -1,3 +1,4 @@ +import 'package:flutter_template/styles/theme_assets.dart'; import 'package:flutter_template/widget/debug/debug_row_title.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -5,7 +6,10 @@ import '../../util/test_util.dart'; void main() { testWidgets('DebugRowTitle default', (tester) async { - final widget = DebugRowTitle(title: TestUtil.getVariableString()); + final widget = DebugRowTitle( + title: TestUtil.getVariableString(), + icon: ThemeAssets.fileIcon, + ); await TestUtil.loadWidgetWithText(tester, widget); await TestUtil.takeScreenshot(tester, 'debug_row_title_default_state'); diff --git a/test/widget/general/action/action_item_test.dart b/test/widget/general/action/action_item_test.dart index 53296183..028c279d 100644 --- a/test/widget/general/action/action_item_test.dart +++ b/test/widget/general/action/action_item_test.dart @@ -12,7 +12,7 @@ void main() { data: FlutterTemplateThemeData.lightTheme(TargetPlatform.android), child: LayoutBuilder( builder: (context, constraint) => ActionItem( - svgAsset: ThemeAssets.addIcon(context), + svgAsset: ThemeAssets.addIcon, onClick: () {}, ), ), @@ -27,7 +27,7 @@ void main() { data: FlutterTemplateThemeData.lightTheme(TargetPlatform.android), child: LayoutBuilder( builder: (context, constraint) => ActionItem( - svgAsset: ThemeAssets.addIcon(context), + svgAsset: ThemeAssets.addIcon, color: Colors.black, onClick: () {}, ), @@ -45,7 +45,7 @@ void main() { data: FlutterTemplateThemeData.lightTheme(TargetPlatform.android), child: LayoutBuilder( builder: (context, constraint) => ActionItem( - svgAsset: ThemeAssets.addIcon(context), + svgAsset: ThemeAssets.addIcon, onClick: () { clicked = true; }, diff --git a/test/widget/general/svg_icon_test.dart b/test/widget/general/svg_icon_test.dart index c8899a53..0c295715 100644 --- a/test/widget/general/svg_icon_test.dart +++ b/test/widget/general/svg_icon_test.dart @@ -45,8 +45,8 @@ void main() { }); testWidgets('SvgIcon custom size and color', (tester) async { final sut = LayoutBuilder( - builder: (context, constraints) => SvgIcon( - svgAsset: ThemeAssets.doneIcon(context), + builder: (context, constraints) => const SvgIcon( + svgAsset: ThemeAssets.checkIcon, color: Colors.purple, size: 64, ));