diff --git a/lib/repository/secure_storage/secure_storage.dart b/lib/repository/secure_storage/secure_storage.dart index 1e226d81..b1647962 100644 --- a/lib/repository/secure_storage/secure_storage.dart +++ b/lib/repository/secure_storage/secure_storage.dart @@ -21,7 +21,7 @@ abstract class SecureStorage implements SimpleKeyValueStorage { class _SecureStorage implements SecureStorage { final FlutterSecureStorage _storage; - final iOSOptions = const IOSOptions(accessibility: KeychainAccessibility.first_unlock); + final iOSOptions = const IOSOptions(accessibility: KeychainAccessibility.unlocked); _SecureStorage(this._storage); diff --git a/lib/screen/debug/debug_screen.dart b/lib/screen/debug/debug_screen.dart index 9dd752fb..e1059b79 100644 --- a/lib/screen/debug/debug_screen.dart +++ b/lib/screen/debug/debug_screen.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart'; import 'package:flutter_template/di/injectable.dart'; import 'package:flutter_template/util/keys.dart'; @@ -8,6 +7,7 @@ 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_switch_row_item.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/provider/provider_widget.dart'; import 'package:provider/provider.dart'; @@ -25,73 +25,68 @@ class DebugScreenState extends State { Widget build(BuildContext context) { return ProviderWidget( create: () => getIt()..init(), - consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => Scaffold( - backgroundColor: theme.colorsTheme.background, - appBar: AppBar( - systemOverlayStyle: SystemUiOverlayStyle.light, - title: Text(localization.settingsTitle), - backgroundColor: theme.colorsTheme.primary, - ), - body: ListView( - children: [ - DebugRowTitle(title: localization.debugAnimationsTitle), - 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, - ), - DebugRowItem( - key: Keys.debugThemeMode, - title: localization.debugThemeModeTitle, - subTitle: localization.debugThemeModeSubtitle, - onClick: viewModel.onThemeModeClicked, - ), - DebugRowTitle(title: localization.debugLocaleTitle), - 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.debugLicensesTitle), - DebugRowItem( - key: Keys.debugLicense, - title: localization.debugLicensesGoTo, - onClick: viewModel.onLicensesClicked, - ), - 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, - ), - ], - ), + consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen( + title: localization.settingsTitle, + padding: EdgeInsets.zero, + isScrollable: true, + children: [ + DebugRowTitle(title: localization.debugAnimationsTitle), + 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, + ), + DebugRowItem( + key: Keys.debugThemeMode, + title: localization.debugThemeModeTitle, + subTitle: localization.debugThemeModeSubtitle, + onClick: viewModel.onThemeModeClicked, + ), + DebugRowTitle(title: localization.debugLocaleTitle), + 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.debugLicensesTitle), + DebugRowItem( + key: Keys.debugLicense, + title: localization.debugLicensesGoTo, + onClick: viewModel.onLicensesClicked, + ), + 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, + ), + ], ), ); } diff --git a/lib/screen/license/license_screen.dart b/lib/screen/license/license_screen.dart index 477b52ff..42e88a5b 100644 --- a/lib/screen/license/license_screen.dart +++ b/lib/screen/license/license_screen.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.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_dimens.dart'; import 'package:flutter_template/viewmodel/license/license_viewmodel.dart'; -import 'package:flutter_template/widget/general/styled/flutter_template_back_button.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/provider/provider_widget.dart'; @flutterRoute @@ -21,41 +19,32 @@ class LicenseScreenState extends State { Widget build(BuildContext context) { return ProviderWidget( create: getIt.call, - consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => Scaffold( - backgroundColor: theme.colorsTheme.background, - appBar: AppBar( - systemOverlayStyle: SystemUiOverlayStyle.light, - leading: FlutterTemplateBackButton.light(onClick: viewModel.onBackClicked), - title: Text(localization.debugLicensesTitle), - backgroundColor: theme.colorsTheme.primary, - ), - body: ListView.builder( - padding: const EdgeInsets.all(ThemeDimens.padding16), - itemCount: viewModel.licenses.length, - itemBuilder: (context, index) { - final item = viewModel.licenses[index]; - return Card( - color: theme.colorsTheme.background, - child: Padding( - padding: const EdgeInsets.all(ThemeDimens.padding16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.name, - style: theme.coreTextTheme.titleNormal, - ), - Container(height: ThemeDimens.padding8), - Text( - item.license, - style: theme.coreTextTheme.bodySmall, - ), - ], - ), + consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen.builder( + title: localization.debugLicensesTitle, + itemCount: viewModel.licenses.length, + itemBuilder: (context, index) { + final item = viewModel.licenses[index]; + return Card( + color: theme.colorsTheme.background, + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.name, + style: theme.coreTextTheme.titleNormal, + ), + Container(height: 8), + Text( + item.license, + style: theme.coreTextTheme.bodySmall, + ), + ], ), - ); - }, - ), + ), + ); + }, ), ); } diff --git a/lib/screen/login/login_screen.dart b/lib/screen/login/login_screen.dart index 4e79a707..67cab812 100644 --- a/lib/screen/login/login_screen.dart +++ b/lib/screen/login/login_screen.dart @@ -1,10 +1,9 @@ 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_dimens.dart'; import 'package:flutter_template/util/keys.dart'; import 'package:flutter_template/viewmodel/login/login_viewmodel.dart'; -import 'package:flutter_template/widget/general/status_bar.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_button.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_input_field.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_progress_indicator.dart'; @@ -26,57 +25,46 @@ class LoginScreenState extends State { Widget build(BuildContext context) { return ProviderWidget( create: () => getIt()..init(), - consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => StatusBar.animated( - isDarkStyle: theme.isDarkTheme, - child: Scaffold( - backgroundColor: theme.colorsTheme.background, - body: SafeArea( - child: Container( - width: double.infinity, - padding: const EdgeInsets.all(ThemeDimens.padding16), - child: Column( - children: [ - Container(height: ThemeDimens.padding16), - Text( - 'Login', - style: theme.coreTextTheme.titleNormal, - textAlign: TextAlign.center, - ), - Container(height: ThemeDimens.padding32), - Text( - 'Just fill in some text. There is no validator for the login', - style: theme.coreTextTheme.labelButtonSmall, - ), - Container(height: ThemeDimens.padding32), - FlutterTemplateInputField( - key: Keys.emailInput, - enabled: !viewModel.isLoading, - onChanged: viewModel.onEmailUpdated, - hint: 'Email', - ), - Container(height: ThemeDimens.padding16), - FlutterTemplateInputField( - key: Keys.passwordInput, - enabled: !viewModel.isLoading, - onChanged: viewModel.onPasswordUpdated, - hint: 'Password', - ), - Container(height: ThemeDimens.padding16), - if (viewModel.isLoading) ...[ - const FlutterTemplateProgressIndicator.light(), - ] else ...[ - FlutterTemplateButton( - key: Keys.loginButton, - isEnabled: viewModel.isLoginEnabled, - text: 'Login', - onClick: viewModel.onLoginClicked, - ), - ], - ], - ), - ), + consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen( + showHeader: false, + children: [ + Container(height: 16), + Text( + 'Login', + style: theme.coreTextTheme.titleNormal, + textAlign: TextAlign.center, + ), + Container(height: 32), + Text( + 'Just fill in some text. There is no validator for the login', + style: theme.coreTextTheme.labelButtonSmall, + ), + Container(height: 32), + FlutterTemplateInputField( + key: Keys.emailInput, + enabled: !viewModel.isLoading, + onChanged: viewModel.onEmailUpdated, + hint: 'Email', ), - ), + Container(height: 16), + FlutterTemplateInputField( + key: Keys.passwordInput, + enabled: !viewModel.isLoading, + onChanged: viewModel.onPasswordUpdated, + hint: 'Password', + ), + Container(height: 16), + if (viewModel.isLoading) ...[ + const FlutterTemplateProgressIndicator.light(), + ] else ...[ + FlutterTemplateButton( + key: Keys.loginButton, + isEnabled: viewModel.isLoginEnabled, + text: 'Login', + onClick: viewModel.onLoginClicked, + ), + ], + ], ), ); } diff --git a/lib/screen/permission/analytics_permission_screen.dart b/lib/screen/permission/analytics_permission_screen.dart index 2adcf420..43c7297d 100644 --- a/lib/screen/permission/analytics_permission_screen.dart +++ b/lib/screen/permission/analytics_permission_screen.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_template/di/injectable.dart'; import 'package:flutter_template/styles/theme_assets.dart'; import 'package:flutter_template/viewmodel/permission/analytics_permission_viewmodel.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_button.dart'; import 'package:flutter_template/widget/provider/provider_widget.dart'; @@ -16,62 +16,51 @@ class AnalyticsPermissionScreen extends StatelessWidget { Widget build(BuildContext context) { return ProviderWidget( create: () => getIt()..init(), - childBuilderWithViewModel: (context, viewModel, theme, localization) => AnnotatedRegion( - value: theme.isDarkTheme ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark, - child: Scaffold( - backgroundColor: theme.colorsTheme.permissionScreenBackground, - body: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0, - vertical: 32, - ), - child: Column( - children: [ - Expanded( - child: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const Spacer(), - Expanded( - flex: 5, - child: SvgPicture.asset( - ThemeAssets.analyticsImage(context), - alignment: Alignment.center, - fit: BoxFit.scaleDown, - ), - ), - const Spacer(), - const SizedBox(height: 32), - Text( - localization.permissionAnalyticsTitle, - style: theme.coreTextTheme.titleNormal, - ), - const SizedBox(height: 16), - Text( - localization.permissionAnalyticsDescription, - textAlign: TextAlign.center, - style: theme.coreTextTheme.bodyNormal, - ), - const Spacer(), - ], + childBuilderWithViewModel: (context, viewModel, theme, localization) => BaseScreen( + showHeader: false, + children: [ + Expanded( + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Spacer(), + Expanded( + flex: 5, + child: SvgPicture.asset( + ThemeAssets.analyticsImage(context), + alignment: Alignment.center, + fit: BoxFit.scaleDown, ), ), - ), - const SizedBox(height: 8), - FlutterTemplateButton( - text: localization.permissionButtonAccept, - onClick: viewModel.onAcceptClicked, - ), - const SizedBox(height: 8), - FlutterTemplateButton.text( - text: localization.permissionButtonMoreInfo, - onClick: viewModel.onMoreInfoClicked, - ), - ], + const Spacer(), + const SizedBox(height: 32), + Text( + localization.permissionAnalyticsTitle, + style: theme.coreTextTheme.titleNormal, + ), + const SizedBox(height: 16), + Text( + localization.permissionAnalyticsDescription, + textAlign: TextAlign.center, + style: theme.coreTextTheme.bodyNormal, + ), + const Spacer(), + ], + ), ), ), - ), + const SizedBox(height: 8), + FlutterTemplateButton( + text: localization.permissionButtonAccept, + onClick: viewModel.onAcceptClicked, + ), + const SizedBox(height: 8), + FlutterTemplateButton.text( + text: localization.permissionButtonMoreInfo, + onClick: viewModel.onMoreInfoClicked, + ), + ], ), ); } diff --git a/lib/screen/todo/todo_add/todo_add_screen.dart b/lib/screen/todo/todo_add/todo_add_screen.dart index e760b898..55c47227 100644 --- a/lib/screen/todo/todo_add/todo_add_screen.dart +++ b/lib/screen/todo/todo_add/todo_add_screen.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.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_dimens.dart'; import 'package:flutter_template/viewmodel/todo/todo_add/todo_add_viewmodel.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_back_button.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_button.dart'; @@ -39,13 +38,13 @@ class TodoAddScreenState extends State { child: Scrollbar( child: ListView( physics: ScrollWhenNeededPhysics(targetPlatform: Theme.of(context).platform), - padding: const EdgeInsets.all(ThemeDimens.padding16), + padding: const EdgeInsets.all(16), children: [ FlutterTemplateInputField( hint: localization.todoAddInputHint, onChanged: viewModel.onTodoChanged, ), - Container(height: ThemeDimens.padding16), + Container(height: 16), FlutterTemplateButton( text: localization.generalLabelSave, isEnabled: viewModel.isSaveEnabled, diff --git a/lib/screen/todo/todo_list/todo_list_screen.dart b/lib/screen/todo/todo_list/todo_list_screen.dart index cb34a475..cb66aed0 100644 --- a/lib/screen/todo/todo_list/todo_list_screen.dart +++ b/lib/screen/todo/todo_list/todo_list_screen.dart @@ -1,16 +1,14 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_template/di/injectable.dart'; import 'package:flutter_template/model/webservice/todo/todo.dart'; import 'package:flutter_template/styles/theme_assets.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/util/keys.dart'; import 'package:flutter_template/viewmodel/todo/todo_list/todo_list_viewmodel.dart'; 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/provider/provider_widget.dart'; import 'package:flutter_template/widget/todo/todo_row_item.dart'; -import 'package:icapps_architecture/icapps_architecture.dart'; class TodoListScreen extends StatefulWidget { const TodoListScreen({super.key}); @@ -27,29 +25,24 @@ class TodoListScreenState extends State { create: () => getIt()..init(), consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) { final errorKey = viewModel.errorKey; - return Scaffold( - backgroundColor: theme.colorsTheme.background, - appBar: AppBar( - title: Text(localization.todoTitle), - systemOverlayStyle: SystemUiOverlayStyle.light, - centerTitle: context.isIOSTheme, - backgroundColor: theme.colorsTheme.primary, - actions: [ - ActionItem( - key: Keys.downloadAction, - svgAsset: ThemeAssets.downloadIcon(context), - onClick: viewModel.onDownloadClicked, - color: theme.colorsTheme.appBarAction, - ), - ActionItem( - key: Keys.addAction, - svgAsset: ThemeAssets.addIcon(context), - onClick: viewModel.onAddClicked, - color: theme.colorsTheme.appBarAction, - ), - ], - ), - body: Builder( + return BaseScreen.child( + padding: EdgeInsets.zero, + title: localization.todoTitle, + actions: [ + ActionItem( + key: Keys.downloadAction, + svgAsset: ThemeAssets.downloadIcon(context), + onClick: viewModel.onDownloadClicked, + color: theme.colorsTheme.appBarAction, + ), + ActionItem( + key: Keys.addAction, + svgAsset: ThemeAssets.addIcon(context), + onClick: viewModel.onAddClicked, + color: theme.colorsTheme.appBarAction, + ), + ], + child: Builder( builder: (context) { if (viewModel.isLoading) return Center(child: FlutterTemplateProgressIndicator(dark: theme.isLightTheme)); if (errorKey != null) { @@ -70,7 +63,7 @@ class TodoListScreenState extends State { if (data.isEmpty) { return Center( child: Padding( - padding: const EdgeInsets.all(ThemeDimens.padding32), + padding: const EdgeInsets.all(32), child: Text( localization.todoEmptyState, textAlign: TextAlign.center, @@ -90,7 +83,7 @@ class TodoListScreenState extends State { ); }, separatorBuilder: (context, index) => Padding( - padding: const EdgeInsets.symmetric(horizontal: ThemeDimens.padding16), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Container( height: 1, color: theme.colorsTheme.primary.withOpacity(0.1), diff --git a/lib/styles/theme_dimens.dart b/lib/styles/theme_dimens.dart index ecb8c907..39aaf5ea 100644 --- a/lib/styles/theme_dimens.dart +++ b/lib/styles/theme_dimens.dart @@ -1,20 +1,6 @@ class ThemeDimens { ThemeDimens._(); - static const double padding4 = 4; - static const double padding8 = 8; - static const double padding12 = 12; - static const double padding16 = 16; - static const double padding24 = 24; - static const double padding32 = 32; - static const double padding40 = 40; - static const double padding48 = 48; - static const double padding56 = 56; - static const double padding64 = 64; - static const double padding72 = 72; - static const double padding80 = 80; - static const double padding96 = 96; - static const double padding128 = 128; static const double cardBorderRadius = 5; static const double enabledOpacity = 1; diff --git a/lib/widget/debug/debug_row_item.dart b/lib/widget/debug/debug_row_item.dart index 9b838f6e..8dbbd3f0 100644 --- a/lib/widget/debug/debug_row_item.dart +++ b/lib/widget/debug/debug_row_item.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -21,7 +20,7 @@ class DebugRowItem extends StatelessWidget { return TouchFeedBack( onTapped: onClick, child: Padding( - padding: const EdgeInsets.all(ThemeDimens.padding16), + padding: const EdgeInsets.all(16), child: Row( children: [ Expanded( @@ -33,7 +32,7 @@ class DebugRowItem extends StatelessWidget { style: theme.coreTextTheme.bodyBig, ), if (subTitle != null) ...[ - Container(height: ThemeDimens.padding4), + Container(height: 4), Text( subTitle!, style: theme.coreTextTheme.bodySmall, diff --git a/lib/widget/debug/debug_row_title.dart b/lib/widget/debug/debug_row_title.dart index b6f98ca8..3ae36910 100644 --- a/lib/widget/debug/debug_row_title.dart +++ b/lib/widget/debug/debug_row_title.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; class DebugRowTitle extends StatelessWidget { @@ -15,8 +14,8 @@ class DebugRowTitle extends StatelessWidget { return DataProviderWidget( childBuilderTheme: (context, theme) => Container( padding: const EdgeInsets.symmetric( - horizontal: ThemeDimens.padding16, - vertical: ThemeDimens.padding8, + horizontal: 16, + vertical: 8, ), color: theme.colorsTheme.debugTitleBackground, child: Text( diff --git a/lib/widget/debug/debug_switch_row_item.dart b/lib/widget/debug/debug_switch_row_item.dart index 455f28e0..401577ff 100644 --- a/lib/widget/debug/debug_switch_row_item.dart +++ b/lib/widget/debug/debug_switch_row_item.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_switch.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -24,7 +23,7 @@ class DebugRowSwitchItem extends StatelessWidget { return TouchFeedBack( onTapped: () => onChanged(!value), child: Padding( - padding: const EdgeInsets.all(ThemeDimens.padding16), + padding: const EdgeInsets.all(16), child: Row( children: [ Expanded( diff --git a/lib/widget/debug/selector_item.dart b/lib/widget/debug/selector_item.dart index 6cf6cb17..94349e65 100644 --- a/lib/widget/debug/selector_item.dart +++ b/lib/widget/debug/selector_item.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/styles/theme_assets.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'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -23,7 +22,7 @@ class SelectorItem extends StatelessWidget { childBuilderTheme: (context, theme) => TouchFeedBack( onTapped: onClick, child: Padding( - padding: const EdgeInsets.all(ThemeDimens.padding16), + padding: const EdgeInsets.all(16), child: Row( children: [ Expanded( diff --git a/lib/widget/general/action/action_item.dart b/lib/widget/general/action/action_item.dart index 06c9a559..81a7fc31 100644 --- a/lib/widget/general/action/action_item.dart +++ b/lib/widget/general/action/action_item.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.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'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -20,19 +19,19 @@ class ActionItem extends StatelessWidget { Widget build(BuildContext context) { return DataProviderWidget( childBuilderTheme: (context, theme) => SizedBox( - height: ThemeDimens.padding56, - width: ThemeDimens.padding56, + height: 56, + width: 56, child: Center( child: SizedBox( - height: ThemeDimens.padding48, - width: ThemeDimens.padding48, + height: 48, + width: 48, child: TouchFeedBack( - borderRadius: BorderRadius.circular(ThemeDimens.padding48), + borderRadius: BorderRadius.circular(48), onTapped: onClick, child: Center( child: SvgIcon( svgAsset: svgAsset, - size: ThemeDimens.padding24, + size: 24, color: color ?? theme.colorsTheme.icon, ), ), diff --git a/lib/widget/general/action/text_action_item.dart b/lib/widget/general/action/text_action_item.dart index 36056bdb..6bbe29ba 100644 --- a/lib/widget/general/action/text_action_item.dart +++ b/lib/widget/general/action/text_action_item.dart @@ -1,5 +1,4 @@ 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'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -23,10 +22,10 @@ class TextActionItem extends StatelessWidget { return DataProviderWidget( childBuilderTheme: (context, theme) => Center( child: TouchFeedBack( - borderRadius: BorderRadius.circular(ThemeDimens.padding4), + borderRadius: BorderRadius.circular(4), onTapped: enabled ? onClick : null, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: ThemeDimens.padding16, vertical: ThemeDimens.padding8), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AnimatedDefaultTextStyle( style: style ?? theme.inverseCoreTextTheme.labelButtonSmall, duration: ThemeDurations.shortAnimationDuration, diff --git a/lib/widget/general/simple_screen/base_screen.dart b/lib/widget/general/simple_screen/base_screen.dart new file mode 100644 index 00000000..6f5e1730 --- /dev/null +++ b/lib/widget/general/simple_screen/base_screen.dart @@ -0,0 +1,153 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen_content.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen_header.dart'; +import 'package:flutter_template/widget/general/status_bar.dart'; +import 'package:flutter_template/widget/general/styled/flutter_template_progress_indicator.dart'; +import 'package:flutter_template/widget/provider/data_provider_widget.dart'; + +class BaseScreen extends StatelessWidget { + final bool isScrollable; + final bool useSlivers; + final bool showHeader; + final bool isLoading; + final bool hasBottomSafeSpace; + final int? itemCount; + final Color? background; + final String? title; + final Widget? child; + final EdgeInsets padding; + final List children; + final List? actions; + final VoidCallback? onBackTapped; + final AsyncCallback? onRefresh; + final IndexedWidgetBuilder? itemBuilder; + + const BaseScreen({ + required this.children, + this.actions, + this.onRefresh, + this.isLoading = false, + this.hasBottomSafeSpace = true, + this.onBackTapped, + this.title, + this.showHeader = true, + this.isScrollable = false, + this.useSlivers = false, + this.padding = const EdgeInsets.all(16), + this.background, + super.key, + }) : child = null, + itemBuilder = null, + itemCount = null; + + const BaseScreen.builder({ + required this.itemBuilder, + required this.itemCount, + this.actions, + this.onRefresh, + this.isLoading = false, + this.hasBottomSafeSpace = true, + this.onBackTapped, + this.title, + this.showHeader = true, + this.padding = const EdgeInsets.all(16), + this.background, + super.key, + }) : children = const [], + child = null, + useSlivers = false, + isScrollable = true; + + const BaseScreen.slivers({ + required this.children, + this.actions, + this.onRefresh, + this.hasBottomSafeSpace = true, + this.onBackTapped, + this.isLoading = false, + this.title, + this.showHeader = true, + this.padding = const EdgeInsets.all(16), + this.background, + super.key, + }) : child = null, + useSlivers = true, + isScrollable = true, + itemBuilder = null, + itemCount = null; + + const BaseScreen.child({ + required this.child, + this.actions, + this.onRefresh, + this.isLoading = false, + this.hasBottomSafeSpace = true, + this.onBackTapped, + this.title, + this.showHeader = true, + this.padding = const EdgeInsets.all(16), + this.background, + super.key, + }) : children = const [], + isScrollable = false, + useSlivers = false, + itemBuilder = null, + itemCount = null; + + @override + Widget build(BuildContext context) { + return DataProviderWidget( + childBuilder: (context, theme, localization) => StatusBar.dark( + child: Scaffold( + backgroundColor: background ?? theme.colorsTheme.background, + body: GestureDetector( + onTap: FocusManager.instance.primaryFocus?.unfocus, + child: SafeArea( + top: !showHeader, + bottom: hasBottomSafeSpace, + child: Column( + children: [ + if (showHeader) ...[ + BaseScreenHeader( + title: title, + onBackTapped: onBackTapped, + trailingItems: actions ?? [], + ), + ], + Expanded( + child: Builder( + builder: (context) { + if (isLoading) { + return const Center( + child: FlutterTemplateProgressIndicator.dark(), + ); + } + + final content = BaseScreenContent( + isScrollable: isScrollable, + padding: padding, + useSlivers: useSlivers, + children: children, + child: child, + itemBuilder: itemBuilder, + itemCount: itemCount, + ); + if (onRefresh == null) return content; + + return RefreshIndicator( + onRefresh: onRefresh!, + child: content, + ); + }, + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widget/general/simple_screen/base_screen_content.dart b/lib/widget/general/simple_screen/base_screen_content.dart new file mode 100644 index 00000000..b6d556eb --- /dev/null +++ b/lib/widget/general/simple_screen/base_screen_content.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; + +class BaseScreenContent extends StatelessWidget { + final bool useSlivers; + final bool isScrollable; + final int? itemCount; + final Widget? child; + final EdgeInsets padding; + final List children; + final IndexedWidgetBuilder? itemBuilder; + + const BaseScreenContent({ + required this.useSlivers, + required this.isScrollable, + required this.padding, + required this.children, + required this.itemBuilder, + required this.itemCount, + this.child, + super.key, + }); + + @override + Widget build(BuildContext context) { + final Widget content; + + if (children.isNotEmpty) { + if (useSlivers) { + content = CustomScrollView( + slivers: children, + ); + } else if (isScrollable) { + content = ListView( + padding: padding, + children: children, + ); + } else { + content = Padding( + padding: padding, + child: Column(children: children), + ); + } + } else if (itemBuilder != null) { + content = ListView.builder( + padding: padding, + itemBuilder: itemBuilder!, + itemCount: itemCount, + ); + } else { + content = Padding( + padding: padding, + child: child, + ); + } + + return content; + } +} diff --git a/lib/widget/general/simple_screen/base_screen_header.dart b/lib/widget/general/simple_screen/base_screen_header.dart new file mode 100644 index 00000000..2e4c5c6d --- /dev/null +++ b/lib/widget/general/simple_screen/base_screen_header.dart @@ -0,0 +1,78 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_template/util/platform/platform_util.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen_header_safe_area.dart'; +import 'package:flutter_template/widget/general/styled/flutter_template_back_button.dart'; +import 'package:flutter_template/widget/provider/data_provider_widget.dart'; + +class BaseScreenHeader extends StatelessWidget { + final bool? centerTitle; + final String? title; + final List trailingItems; + final VoidCallback? onBackTapped; + + const BaseScreenHeader({ + this.onBackTapped, + this.centerTitle, + this.title, + this.trailingItems = const [], + super.key, + }); + + @override + Widget build(BuildContext context) { + return DataProviderWidget( + childBuilder: (context, theme, localization) { + final leading = [ + if (ModalRoute.of(context)?.impliesAppBarDismissal ?? false) ...[ + FlutterTemplateBackButton.light(onClick: onBackTapped ?? Navigator.of(context).pop), + const SizedBox(width: 24), + ], + ]; + final isTitleCentered = centerTitle ?? PlatformUtil.isIOS; + final titleWidget = title == null + ? null + : Text( + title!.toUpperCase(), + style: theme.inverseCoreTextTheme.bodyNormal, + textAlign: isTitleCentered ? TextAlign.center : TextAlign.start, + ); + + return Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, + ), + color: theme.colorsTheme.primary, + child: SafeArea( + bottom: false, + child: Stack( + alignment: Alignment.center, + children: [ + Row( + children: [ + ...leading, + if (titleWidget != null && !isTitleCentered) ...[ + Expanded( + child: titleWidget, + ), + ] else ...[ + const Spacer(), + ], + ...trailingItems, + ], + ), + if (isTitleCentered && titleWidget != null) ...[ + BaseScreenHeaderSafeArea( + leading: leading, + actions: trailingItems, + child: titleWidget, + ), + ] + ], + ), + ), + ); + }, + ); + } +} diff --git a/lib/widget/general/simple_screen/base_screen_header_safe_area.dart b/lib/widget/general/simple_screen/base_screen_header_safe_area.dart new file mode 100644 index 00000000..fc221c72 --- /dev/null +++ b/lib/widget/general/simple_screen/base_screen_header_safe_area.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; + +class BaseScreenHeaderSafeArea extends StatelessWidget { + final Widget child; + final List leading; + final List actions; + + const BaseScreenHeaderSafeArea({ + required this.leading, + required this.actions, + required this.child, + super.key, + }); + + @override + Widget build(BuildContext context) { + final content = Opacity( + opacity: 0, + child: IgnorePointer( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + ...leading, + ...actions, + ], + ), + ), + ); + return Row( + children: [ + content, + Expanded(child: child), + content, + ], + ); + } +} diff --git a/lib/widget/general/styled/flutter_template_checkbox.dart b/lib/widget/general/styled/flutter_template_checkbox.dart index 78cda93e..4cd43a05 100644 --- a/lib/widget/general/styled/flutter_template_checkbox.dart +++ b/lib/widget/general/styled/flutter_template_checkbox.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/styles/theme_assets.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'; import 'package:icapps_architecture/icapps_architecture.dart'; @@ -23,14 +22,14 @@ class FlutterTemplateCheckBox extends StatelessWidget { onTap: () => onChanged(!value), child: Container( color: Colors.transparent, - height: ThemeDimens.padding48, - width: ThemeDimens.padding48, + height: 48, + width: 48, child: value ? Center( child: SvgIcon( svgAsset: ThemeAssets.doneIcon(context), color: theme.colorsTheme.accent, - size: ThemeDimens.padding24, + size: 24, ), ) : Container(), diff --git a/lib/widget/todo/todo_row_item.dart b/lib/widget/todo/todo_row_item.dart index 0028ce93..e0473830 100644 --- a/lib/widget/todo/todo_row_item.dart +++ b/lib/widget/todo/todo_row_item.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/widget/general/styled/flutter_template_checkbox.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; @@ -23,8 +22,8 @@ class TodoRowItem extends StatelessWidget { child: Container( color: Colors.transparent, padding: const EdgeInsets.symmetric( - horizontal: ThemeDimens.padding16, - vertical: ThemeDimens.padding8, + horizontal: 16, + vertical: 8, ), child: Row( children: [ diff --git a/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png b/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png index 22399d3b..5a64f728 100644 Binary files a/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png and b/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_inital_state_iphone_11.png b/test/screen/debug/img/debug_screen_inital_state_iphone_11.png index 3d7215a5..1dc354f3 100644 Binary files a/test/screen/debug/img/debug_screen_inital_state_iphone_11.png and b/test/screen/debug/img/debug_screen_inital_state_iphone_11.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png b/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png index 22399d3b..5a64f728 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_disabled_iphone_11.png b/test/screen/debug/img/debug_screen_show_locale_key_disabled_iphone_11.png index 3d7215a5..1dc354f3 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_disabled_iphone_11.png and b/test/screen/debug/img/debug_screen_show_locale_key_disabled_iphone_11.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png b/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png index f3dc46cc..9eef3f37 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_enabled_iphone_11.png b/test/screen/debug/img/debug_screen_show_locale_key_enabled_iphone_11.png index afca11a2..856f1308 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_enabled_iphone_11.png and b/test/screen/debug/img/debug_screen_show_locale_key_enabled_iphone_11.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png b/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png index 22399d3b..5a64f728 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_disabled_iphone_11.png b/test/screen/debug/img/debug_screen_slow_animations_disabled_iphone_11.png index 3d7215a5..1dc354f3 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_disabled_iphone_11.png and b/test/screen/debug/img/debug_screen_slow_animations_disabled_iphone_11.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png b/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png index c195278d..cd465c97 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_enabled_iphone_11.png b/test/screen/debug/img/debug_screen_slow_animations_enabled_iphone_11.png index b2bc47ae..1d34c439 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_enabled_iphone_11.png and b/test/screen/debug/img/debug_screen_slow_animations_enabled_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_darkmode_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_darkmode_ipad_pro.png index bd20306d..763ae94f 100644 Binary files a/test/screen/home/img/home_screen_initial_state_darkmode_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_darkmode_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_darkmode_iphone_11.png b/test/screen/home/img/home_screen_initial_state_darkmode_iphone_11.png index 52098888..f77357cd 100644 Binary files a/test/screen/home/img/home_screen_initial_state_darkmode_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_darkmode_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_ipad_pro.png index bd20306d..763ae94f 100644 Binary files a/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_iphone_11.png b/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_iphone_11.png index 52098888..f77357cd 100644 Binary files a/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_first_tab_darkmode_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_first_tab_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_first_tab_ipad_pro.png index 5e9c2fd4..8e05e2ae 100644 Binary files a/test/screen/home/img/home_screen_initial_state_first_tab_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_first_tab_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_first_tab_iphone_11.png b/test/screen/home/img/home_screen_initial_state_first_tab_iphone_11.png index 4997ae35..fbcb7972 100644 Binary files a/test/screen/home/img/home_screen_initial_state_first_tab_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_first_tab_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_ipad_pro.png index 5e9c2fd4..8e05e2ae 100644 Binary files a/test/screen/home/img/home_screen_initial_state_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_iphone_11.png b/test/screen/home/img/home_screen_initial_state_iphone_11.png index 4997ae35..fbcb7972 100644 Binary files a/test/screen/home/img/home_screen_initial_state_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_ipad_pro.png index bd20306d..763ae94f 100644 Binary files a/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_iphone_11.png b/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_iphone_11.png index 52098888..f77357cd 100644 Binary files a/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_second_tab_darkmode_iphone_11.png differ diff --git a/test/screen/home/img/home_screen_initial_state_second_tab_ipad_pro.png b/test/screen/home/img/home_screen_initial_state_second_tab_ipad_pro.png index 5e9c2fd4..8e05e2ae 100644 Binary files a/test/screen/home/img/home_screen_initial_state_second_tab_ipad_pro.png and b/test/screen/home/img/home_screen_initial_state_second_tab_ipad_pro.png differ diff --git a/test/screen/home/img/home_screen_initial_state_second_tab_iphone_11.png b/test/screen/home/img/home_screen_initial_state_second_tab_iphone_11.png index 4997ae35..fbcb7972 100644 Binary files a/test/screen/home/img/home_screen_initial_state_second_tab_iphone_11.png and b/test/screen/home/img/home_screen_initial_state_second_tab_iphone_11.png differ diff --git a/test/screen/license/img/license_screen_empty_list_ipad_pro.png b/test/screen/license/img/license_screen_empty_list_ipad_pro.png index 30900d4b..d9360239 100644 Binary files a/test/screen/license/img/license_screen_empty_list_ipad_pro.png and b/test/screen/license/img/license_screen_empty_list_ipad_pro.png differ diff --git a/test/screen/license/img/license_screen_empty_list_iphone_11.png b/test/screen/license/img/license_screen_empty_list_iphone_11.png index 573cb762..a6626086 100644 Binary files a/test/screen/license/img/license_screen_empty_list_iphone_11.png and b/test/screen/license/img/license_screen_empty_list_iphone_11.png differ diff --git a/test/screen/license/img/license_screen_inital_state_dark_mode_ipad_pro.png b/test/screen/license/img/license_screen_inital_state_dark_mode_ipad_pro.png index 49105b56..7025c265 100644 Binary files a/test/screen/license/img/license_screen_inital_state_dark_mode_ipad_pro.png and b/test/screen/license/img/license_screen_inital_state_dark_mode_ipad_pro.png differ diff --git a/test/screen/license/img/license_screen_inital_state_dark_mode_iphone_11.png b/test/screen/license/img/license_screen_inital_state_dark_mode_iphone_11.png index b8b8e5dc..6fb4ed72 100644 Binary files a/test/screen/license/img/license_screen_inital_state_dark_mode_iphone_11.png and b/test/screen/license/img/license_screen_inital_state_dark_mode_iphone_11.png differ diff --git a/test/screen/license/img/license_screen_inital_state_ipad_pro.png b/test/screen/license/img/license_screen_inital_state_ipad_pro.png index e275ddd9..6a1b0181 100644 Binary files a/test/screen/license/img/license_screen_inital_state_ipad_pro.png and b/test/screen/license/img/license_screen_inital_state_ipad_pro.png differ diff --git a/test/screen/license/img/license_screen_inital_state_iphone_11.png b/test/screen/license/img/license_screen_inital_state_iphone_11.png index 4b1d07f5..6b880440 100644 Binary files a/test/screen/license/img/license_screen_inital_state_iphone_11.png and b/test/screen/license/img/license_screen_inital_state_iphone_11.png differ diff --git a/test/screen/license/license_screen_test.dart b/test/screen/license/license_screen_test.dart index aac8626a..9a7791cd 100644 --- a/test/screen/license/license_screen_test.dart +++ b/test/screen/license/license_screen_test.dart @@ -1,14 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/di/injectable.dart'; import 'package:flutter_template/screen/license/license_screen.dart'; -import 'package:flutter_template/util/keys.dart'; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart'; import 'package:flutter_template/viewmodel/license/license_viewmodel.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import '../../util/test_extensions.dart'; import '../../util/test_util.dart'; import '../seed.dart'; import 'license_screen_test.mocks.dart'; @@ -57,19 +55,6 @@ void main() { await TestUtil.takeScreenshotForAllSizes(tester, testWidget, 'license_screen_empty_list'); }); - - group('Actions', () { - testWidgets('Test license screen on back clicked', (tester) async { - const sut = LicenseScreen(); - await TestUtil.loadScreen(tester, sut); - - final target = find.byKey(Keys.backButton); - expect(target, findsOneWidget); - await tester.tap(target); - await tester.pumpAndSettle(); - verify(licenseViewModel.onBackClicked()).calledOnce(); - }); - }); } void verifyLicenseViewModel() { diff --git a/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_ipad_pro.png b/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_ipad_pro.png index 168e9d29..ce4da3f9 100644 Binary files a/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_ipad_pro.png and b/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_ipad_pro.png differ diff --git a/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_iphone_11.png b/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_iphone_11.png index eabe42d6..3570ac7a 100644 Binary files a/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_iphone_11.png and b/test/screen/permission/img/analytics_permission_screen_initial_state_dark_mode_iphone_11.png differ diff --git a/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_ipad_pro.png b/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_ipad_pro.png index 168e9d29..ce4da3f9 100644 Binary files a/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_ipad_pro.png and b/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_ipad_pro.png differ diff --git a/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_iphone_11.png b/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_iphone_11.png index eabe42d6..3570ac7a 100644 Binary files a/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_iphone_11.png and b/test/screen/permission/img/analytics_permission_screen_initial_state_light_mode_iphone_11.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_empty_state_ipad_pro.png b/test/screen/todo/todo_list/img/todo_list_screen_empty_state_ipad_pro.png index 9fbcc929..132b4145 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_empty_state_ipad_pro.png and b/test/screen/todo/todo_list/img/todo_list_screen_empty_state_ipad_pro.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_empty_state_iphone_11.png b/test/screen/todo/todo_list/img/todo_list_screen_empty_state_iphone_11.png index 58465552..c985f5a1 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_empty_state_iphone_11.png and b/test/screen/todo/todo_list/img/todo_list_screen_empty_state_iphone_11.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_error_state_ipad_pro.png b/test/screen/todo/todo_list/img/todo_list_screen_error_state_ipad_pro.png index fcfc8348..66449fc3 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_error_state_ipad_pro.png and b/test/screen/todo/todo_list/img/todo_list_screen_error_state_ipad_pro.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_error_state_iphone_11.png b/test/screen/todo/todo_list/img/todo_list_screen_error_state_iphone_11.png index 8b2965e1..943f3457 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_error_state_iphone_11.png and b/test/screen/todo/todo_list/img/todo_list_screen_error_state_iphone_11.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_ipad_pro.png b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_ipad_pro.png index f06cbbfc..a021b5ce 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_ipad_pro.png and b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_ipad_pro.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_iphone_11.png b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_iphone_11.png index 6ea9f9cd..d40a1823 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_iphone_11.png and b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_dark_mode_iphone_11.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_ipad_pro.png b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_ipad_pro.png index 4e96e7be..82e840a4 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_ipad_pro.png and b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_ipad_pro.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_iphone_11.png b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_iphone_11.png index 7c6caf2b..03fe5061 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_inital_state_iphone_11.png and b/test/screen/todo/todo_list/img/todo_list_screen_inital_state_iphone_11.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_loading_state_ipad_pro.png b/test/screen/todo/todo_list/img/todo_list_screen_loading_state_ipad_pro.png index 39dc113e..a910e607 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_loading_state_ipad_pro.png and b/test/screen/todo/todo_list/img/todo_list_screen_loading_state_ipad_pro.png differ diff --git a/test/screen/todo/todo_list/img/todo_list_screen_loading_state_iphone_11.png b/test/screen/todo/todo_list/img/todo_list_screen_loading_state_iphone_11.png index b6b98bd1..5cf6bf9a 100644 Binary files a/test/screen/todo/todo_list/img/todo_list_screen_loading_state_iphone_11.png and b/test/screen/todo/todo_list/img/todo_list_screen_loading_state_iphone_11.png differ diff --git a/test/styles/theme_assets_test.dart b/test/styles/theme_assets_test.dart index 45aca0e8..916b17b6 100644 --- a/test/styles/theme_assets_test.dart +++ b/test/styles/theme_assets_test.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_template/styles/theme_assets.dart'; import 'package:flutter_template/styles/theme_data.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_test/flutter_test.dart'; import '../util/test_util.dart'; @@ -126,8 +125,8 @@ class IconAssetTesterAndroid extends StatelessWidget { child: LayoutBuilder( builder: (context, constraint) => SvgPicture.asset( getAsset(context), - height: ThemeDimens.padding64, - width: ThemeDimens.padding64, + height: 64, + width: 64, colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn), ), ), @@ -150,8 +149,8 @@ class IconAssetTesterIOS extends StatelessWidget { child: LayoutBuilder( builder: (context, constraint) => SvgPicture.asset( getAsset(context), - height: ThemeDimens.padding64, - width: ThemeDimens.padding64, + height: 64, + width: 64, colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn), ), ), diff --git a/test/widget/general/svg_icon_test.dart b/test/widget/general/svg_icon_test.dart index 290ce143..c8899a53 100644 --- a/test/widget/general/svg_icon_test.dart +++ b/test/widget/general/svg_icon_test.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/styles/theme_assets.dart'; -import 'package:flutter_template/styles/theme_dimens.dart'; import 'package:flutter_template/widget/general/svg_icon.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -27,7 +26,7 @@ void main() { testWidgets('SvgIcon custom size', (tester) async { const sut = SvgIcon( svgAsset: 'assets/images/icons/android/done.svg', - size: ThemeDimens.padding64, + size: 64, ); await TestUtil.loadWidgetWithText(tester, sut); @@ -38,7 +37,7 @@ void main() { const sut = SvgIcon( svgAsset: 'assets/images/icons/android/done.svg', color: Colors.purple, - size: ThemeDimens.padding64, + size: 64, ); await TestUtil.loadWidgetWithText(tester, sut); @@ -49,7 +48,7 @@ void main() { builder: (context, constraints) => SvgIcon( svgAsset: ThemeAssets.doneIcon(context), color: Colors.purple, - size: ThemeDimens.padding64, + size: 64, )); await TestUtil.loadWidgetWithText(tester, sut);