diff --git a/README.md b/README.md index 1a81ca581a6..d8a99c424d2 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ - Make sure you have installed flutter and all the requirements - [Official flutter installation guide](https://docs.flutter.dev/get-started/install) -- Currently, the app uses the latest stable version of Flutter (3.19.x). +- Currently, the app uses the following version of Flutter (3.22.x). We have predefined run configurations for Android Studio and Visual Studio Code diff --git a/flutter-version.txt b/flutter-version.txt index 0bc8e967b83..dbc9520ba41 100644 --- a/flutter-version.txt +++ b/flutter-version.txt @@ -1 +1 @@ -3.19.5 \ No newline at end of file +3.22.2 \ No newline at end of file diff --git a/packages/app_store/apple_app_store/pubspec.yaml b/packages/app_store/apple_app_store/pubspec.yaml index ed12d33a943..0a6b0494448 100644 --- a/packages/app_store/apple_app_store/pubspec.yaml +++ b/packages/app_store/apple_app_store/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/app_store/google_play/pubspec.yaml b/packages/app_store/google_play/pubspec.yaml index 9f6c287d4fa..54161b2443e 100644 --- a/packages/app_store/google_play/pubspec.yaml +++ b/packages/app_store/google_play/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/app_store/shared/pubspec.yaml b/packages/app_store/shared/pubspec.yaml index 4978f448a6c..86fec92bc7f 100644 --- a/packages/app_store/shared/pubspec.yaml +++ b/packages/app_store/shared/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/app_store/uri_store/pubspec.yaml b/packages/app_store/uri_store/pubspec.yaml index 5b5d99659be..1e661bdb92a 100644 --- a/packages/app_store/uri_store/pubspec.yaml +++ b/packages/app_store/uri_store/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/scanner/ml_kit/pubspec.yaml b/packages/scanner/ml_kit/pubspec.yaml index 5b69d47d97a..753b8caafd2 100644 --- a/packages/scanner/ml_kit/pubspec.yaml +++ b/packages/scanner/ml_kit/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/scanner/shared/pubspec.yaml b/packages/scanner/shared/pubspec.yaml index 7730dc8abaf..7fa9a28d1f0 100644 --- a/packages/scanner/shared/pubspec.yaml +++ b/packages/scanner/shared/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/scanner/zxing/pubspec.yaml b/packages/scanner/zxing/pubspec.yaml index 76b0988cd50..0e32939a7b4 100644 --- a/packages/scanner/zxing/pubspec.yaml +++ b/packages/scanner/zxing/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: diff --git a/packages/smooth_app/lib/generic_lib/buttons/smooth_simple_button.dart b/packages/smooth_app/lib/generic_lib/buttons/smooth_simple_button.dart index cc978a528ab..52dae9e156d 100644 --- a/packages/smooth_app/lib/generic_lib/buttons/smooth_simple_button.dart +++ b/packages/smooth_app/lib/generic_lib/buttons/smooth_simple_button.dart @@ -33,19 +33,19 @@ class SmoothSimpleButton extends StatelessWidget { style: ButtonStyle( backgroundColor: buttonColor == null ? null - : MaterialStateProperty.all(buttonColor!), - shape: MaterialStateProperty.all( + : WidgetStateProperty.all(buttonColor!), + shape: WidgetStateProperty.all( RoundedRectangleBorder(borderRadius: borderRadius), ), overlayColor: context.read().isAmoledTheme - ? MaterialStateProperty.resolveWith((Set states) { - return states.contains(MaterialState.pressed) + ? WidgetStateProperty.resolveWith((Set states) { + return states.contains(WidgetState.pressed) ? Theme.of(context).colorScheme.primary.withOpacity(0.3) : null; }) : null, side: context.read().isAmoledTheme - ? MaterialStateProperty.all( + ? WidgetStateProperty.all( const BorderSide(color: Colors.white), ) : null, diff --git a/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart b/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart index f267cc1dba6..0d03fca3a89 100644 --- a/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart +++ b/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart @@ -213,7 +213,7 @@ class _SmoothDialogTitle extends StatelessWidget { ], ), ), - Divider(color: Theme.of(context).colorScheme.onBackground), + Divider(color: Theme.of(context).colorScheme.onSurface), const SizedBox(height: 12), ], ); diff --git a/packages/smooth_app/lib/pages/hunger_games/question_answers_options.dart b/packages/smooth_app/lib/pages/hunger_games/question_answers_options.dart index dcea8df0085..e1ee8172f20 100755 --- a/packages/smooth_app/lib/pages/hunger_games/question_answers_options.dart +++ b/packages/smooth_app/lib/pages/hunger_games/question_answers_options.dart @@ -108,8 +108,8 @@ class QuestionAnswersOptions extends StatelessWidget { child: TextButton.icon( onPressed: () => onAnswer(insightAnnotation), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(backgroundColor), - shape: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all(backgroundColor), + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: ROUNDED_BORDER_RADIUS, ), diff --git a/packages/smooth_app/lib/pages/image_crop_page.dart b/packages/smooth_app/lib/pages/image_crop_page.dart index 614b7431c0a..67f902807c1 100644 --- a/packages/smooth_app/lib/pages/image_crop_page.dart +++ b/packages/smooth_app/lib/pages/image_crop_page.dart @@ -225,13 +225,13 @@ class _ImageSourceButton extends StatelessWidget { child: OutlinedButton( onPressed: onPressed, style: ButtonStyle( - side: MaterialStatePropertyAll( + side: WidgetStatePropertyAll( BorderSide(color: primaryColor), ), - padding: const MaterialStatePropertyAll( + padding: const WidgetStatePropertyAll( EdgeInsets.symmetric(vertical: LARGE_SPACE), ), - shape: MaterialStatePropertyAll( + shape: WidgetStatePropertyAll( RoundedRectangleBorder( borderRadius: ROUNDED_BORDER_RADIUS, side: BorderSide(color: primaryColor), diff --git a/packages/smooth_app/lib/pages/locations/location_query_page.dart b/packages/smooth_app/lib/pages/locations/location_query_page.dart index 250f35e0172..61524e27a5e 100644 --- a/packages/smooth_app/lib/pages/locations/location_query_page.dart +++ b/packages/smooth_app/lib/pages/locations/location_query_page.dart @@ -110,8 +110,8 @@ class _LocationQueryPageState extends State data: ListTileThemeData( titleTextStyle: const TextStyle(fontSize: 20.0), minLeadingWidth: 18.0, - iconColor: Theme.of(context).colorScheme.onBackground, - textColor: Theme.of(context).colorScheme.onBackground, + iconColor: Theme.of(context).colorScheme.onSurface, + textColor: Theme.of(context).colorScheme.onSurface, ), child: ListView.builder( itemBuilder: (BuildContext context, int index) => diff --git a/packages/smooth_app/lib/pages/onboarding/onboarding_bottom_bar.dart b/packages/smooth_app/lib/pages/onboarding/onboarding_bottom_bar.dart index 57e9b0abf83..089aed5f5ef 100644 --- a/packages/smooth_app/lib/pages/onboarding/onboarding_bottom_bar.dart +++ b/packages/smooth_app/lib/pages/onboarding/onboarding_bottom_bar.dart @@ -90,12 +90,11 @@ class OnboardingBottomButton extends StatelessWidget { key: nextKey, onPressed: onPressed, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(backgroundColor), + backgroundColor: WidgetStateProperty.all(backgroundColor), overlayColor: backgroundColor == Colors.white - ? MaterialStateProperty.all( - Theme.of(context).splashColor) + ? WidgetStateProperty.all(Theme.of(context).splashColor) : null, - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(40))), ), diff --git a/packages/smooth_app/lib/pages/onboarding/v2/onboarding_bottom_hills.dart b/packages/smooth_app/lib/pages/onboarding/v2/onboarding_bottom_hills.dart index 49b3b784299..e8ecaa7c70b 100644 --- a/packages/smooth_app/lib/pages/onboarding/v2/onboarding_bottom_hills.dart +++ b/packages/smooth_app/lib/pages/onboarding/v2/onboarding_bottom_hills.dart @@ -62,10 +62,10 @@ class OnboardingBottomHills extends StatelessWidget { end: 15.0, child: TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Colors.white, ), - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( const EdgeInsetsDirectional.only( start: LARGE_SPACE + 1.0, end: LARGE_SPACE, @@ -73,20 +73,20 @@ class OnboardingBottomHills extends StatelessWidget { bottom: SMALL_SPACE, ), ), - elevation: MaterialStateProperty.all(4.0), - iconColor: MaterialStateProperty.all( + elevation: WidgetStateProperty.all(4.0), + iconColor: WidgetStateProperty.all( colors.orange, ), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( colors.orange, ), - iconSize: MaterialStateProperty.all(21.0), - shape: MaterialStateProperty.all( + iconSize: WidgetStateProperty.all(21.0), + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0), ), ), - shadowColor: MaterialStateProperty.all( + shadowColor: WidgetStateProperty.all( Colors.black.withOpacity(0.50), ), ), diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_account.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_account.dart index 94ad1b57cb3..3121ddff96c 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_account.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_account.dart @@ -147,10 +147,10 @@ class UserPreferencesAccount extends AbstractUserPreferences { child: ElevatedButton( onPressed: () async => _goToLoginPage(), style: ButtonStyle( - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( Size(size.width * 0.5, themeData.buttonTheme.height + 10), ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_connect.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_connect.dart index 8704baf50fa..1e4e0f169f5 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_connect.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_connect.dart @@ -111,7 +111,7 @@ class UserPreferencesConnect extends AbstractUserPreferences { 'assets/preferences/x-logo.svg', width: DEFAULT_ICON_SIZE, colorFilter: ui.ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, ui.BlendMode.srcIn, ), package: AppHelper.APP_PACKAGE, diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_rate_us.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_rate_us.dart index cba7fc5eefe..3600c1330ab 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_rate_us.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_rate_us.dart @@ -50,10 +50,10 @@ class UserPreferencesRateUs extends StatelessWidget { content: Text( appLocalizations.error_occurred, textAlign: TextAlign.center, - style: TextStyle(color: themeData.colorScheme.background), + style: TextStyle(color: themeData.colorScheme.surface), ), behavior: SnackBarBehavior.floating, - backgroundColor: themeData.colorScheme.onBackground, + backgroundColor: themeData.colorScheme.onSurface, ), ); } diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_share_with_friends.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_share_with_friends.dart index 6e9875ff5c3..44840fa1c28 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_share_with_friends.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_share_with_friends.dart @@ -44,11 +44,11 @@ class UserPreferencesShareWithFriends extends StatelessWidget { appLocalizations.error, textAlign: TextAlign.center, style: TextStyle( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, ), ), behavior: SnackBarBehavior.floating, - backgroundColor: themeData.colorScheme.onBackground, + backgroundColor: themeData.colorScheme.onSurface, ), ); } diff --git a/packages/smooth_app/lib/pages/product/common/product_list_page.dart b/packages/smooth_app/lib/pages/product/common/product_list_page.dart index d831b6c70bc..59d9b4e671a 100644 --- a/packages/smooth_app/lib/pages/product/common/product_list_page.dart +++ b/packages/smooth_app/lib/pages/product/common/product_list_page.dart @@ -267,7 +267,7 @@ class _ProductListPageState extends State appLocalizations.product_list_empty_message, textAlign: TextAlign.center, style: themeData.textTheme.bodyMedium?.apply( - color: themeData.colorScheme.onBackground, + color: themeData.colorScheme.onSurface, ), ), EMPTY_WIDGET, diff --git a/packages/smooth_app/lib/pages/product/edit_image_button.dart b/packages/smooth_app/lib/pages/product/edit_image_button.dart index bc644102552..dd30c53526f 100644 --- a/packages/smooth_app/lib/pages/product/edit_image_button.dart +++ b/packages/smooth_app/lib/pages/product/edit_image_button.dart @@ -33,20 +33,20 @@ class EditImageButton extends StatelessWidget { child: OutlinedButton.icon( icon: Icon(iconData), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(colorScheme.onPrimary), - shape: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all(colorScheme.onPrimary), + shape: WidgetStateProperty.all( const RoundedRectangleBorder(borderRadius: ROUNDED_BORDER_RADIUS), ), side: borderWidth == null ? null - : MaterialStateBorderSide.resolveWith( + : WidgetStateBorderSide.resolveWith( (_) => BorderSide( color: colorScheme.primary, width: borderWidth!, ), ), padding: _centerContent - ? MaterialStateProperty.all( + ? WidgetStateProperty.all( const EdgeInsets.symmetric( vertical: LARGE_SPACE, ), diff --git a/packages/smooth_app/lib/pages/product/edit_new_packagings.dart b/packages/smooth_app/lib/pages/product/edit_new_packagings.dart index 6c4e248066c..4c0a003929b 100644 --- a/packages/smooth_app/lib/pages/product/edit_new_packagings.dart +++ b/packages/smooth_app/lib/pages/product/edit_new_packagings.dart @@ -324,7 +324,7 @@ Color _getSmoothCardColorAlternate(final BuildContext context, int index) { if (index.isOdd) { cardColor = PRIMARY_GREY_COLOR; } else { - cardColor = darkColorScheme.background; + cardColor = darkColorScheme.surface; } } diff --git a/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_page.dart b/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_page.dart index 1f737bc5744..d78a52cce5e 100644 --- a/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_page.dart @@ -294,7 +294,7 @@ class _EditOcrPageState extends State with UpToDateMixin { flex: 1, child: DecoratedBox( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, borderRadius: const BorderRadiusDirectional.only( topStart: ANGULAR_RADIUS, topEnd: ANGULAR_RADIUS, diff --git a/packages/smooth_app/lib/pages/product/new_product_page.dart b/packages/smooth_app/lib/pages/product/new_product_page.dart index ee44bec4fb5..e20901edfa2 100644 --- a/packages/smooth_app/lib/pages/product/new_product_page.dart +++ b/packages/smooth_app/lib/pages/product/new_product_page.dart @@ -416,11 +416,11 @@ class _ProductPageState extends State ), child: ElevatedButton( style: ButtonStyle( - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( const EdgeInsets.symmetric( horizontal: VERY_LARGE_SPACE, vertical: MEDIUM_SPACE), ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: ROUNDED_BORDER_RADIUS, ), diff --git a/packages/smooth_app/lib/pages/product/nutrition_add_nutrient_button.dart b/packages/smooth_app/lib/pages/product/nutrition_add_nutrient_button.dart index 86b1a5dea6a..afa30d2b80d 100644 --- a/packages/smooth_app/lib/pages/product/nutrition_add_nutrient_button.dart +++ b/packages/smooth_app/lib/pages/product/nutrition_add_nutrient_button.dart @@ -99,7 +99,7 @@ class NutritionAddNutrientButton extends StatelessWidget { } }, style: ButtonStyle( - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: ROUNDED_BORDER_RADIUS, side: BorderSide.none, diff --git a/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart b/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart index 3a872cbbf39..6fed13681ec 100644 --- a/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart +++ b/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart @@ -322,7 +322,7 @@ class _NutritionPageLoadedState extends State value: _nutritionContainer.noNutritionData, onChanged: (final bool value) => setState(() => _nutritionContainer.noNutritionData = value), - trackColor: MaterialStateProperty.all( + trackColor: WidgetStateProperty.all( Theme.of(context).colorScheme.onPrimary), ), ), diff --git a/packages/smooth_app/lib/pages/product/product_incomplete_card.dart b/packages/smooth_app/lib/pages/product/product_incomplete_card.dart index ceba846b333..c60c7897639 100644 --- a/packages/smooth_app/lib/pages/product/product_incomplete_card.dart +++ b/packages/smooth_app/lib/pages/product/product_incomplete_card.dart @@ -111,13 +111,13 @@ class ProductIncompleteCard extends StatelessWidget { ), ), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( colorScheme.primary, ), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( colorScheme.onPrimary, ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder(borderRadius: ANGULAR_BORDER_RADIUS), ), ), diff --git a/packages/smooth_app/lib/pages/product/product_question_answers_options.dart b/packages/smooth_app/lib/pages/product/product_question_answers_options.dart index efeac877bd0..d9e1c31e72a 100644 --- a/packages/smooth_app/lib/pages/product/product_question_answers_options.dart +++ b/packages/smooth_app/lib/pages/product/product_question_answers_options.dart @@ -91,7 +91,7 @@ class ProductQuestionAnswersOptions extends StatelessWidget { child: TextButton( onPressed: () => onAnswer(insightAnnotation), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(backgroundColor), + backgroundColor: WidgetStateProperty.all(backgroundColor), ), child: Text( buttonText, diff --git a/packages/smooth_app/lib/pages/scan/scan_header.dart b/packages/smooth_app/lib/pages/scan/scan_header.dart index ab419653504..53cbe5bbb6e 100644 --- a/packages/smooth_app/lib/pages/scan/scan_header.dart +++ b/packages/smooth_app/lib/pages/scan/scan_header.dart @@ -24,7 +24,7 @@ class _ScanHeaderState extends State { final ContinuousScanModel model = context.watch(); final ButtonStyle buttonStyle = ButtonStyle( - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(18.0)), ), diff --git a/packages/smooth_app/lib/pages/scan/scan_page.dart b/packages/smooth_app/lib/pages/scan/scan_page.dart index f1a4f4401ea..26f22f14e30 100644 --- a/packages/smooth_app/lib/pages/scan/scan_page.dart +++ b/packages/smooth_app/lib/pages/scan/scan_page.dart @@ -64,7 +64,7 @@ class _ScanPageState extends State { color: Colors.white, child: SafeArea( child: Container( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, child: Column( children: [ if (hasACamera) diff --git a/packages/smooth_app/lib/pages/scan/search_history_view.dart b/packages/smooth_app/lib/pages/scan/search_history_view.dart index 975da30935f..a4b0a94507a 100644 --- a/packages/smooth_app/lib/pages/scan/search_history_view.dart +++ b/packages/smooth_app/lib/pages/scan/search_history_view.dart @@ -46,8 +46,8 @@ class _SearchHistoryViewState extends State { data: ListTileThemeData( titleTextStyle: const TextStyle(fontSize: 20.0), minLeadingWidth: 18.0, - iconColor: Theme.of(context).colorScheme.onBackground, - textColor: Theme.of(context).colorScheme.onBackground, + iconColor: Theme.of(context).colorScheme.onSurface, + textColor: Theme.of(context).colorScheme.onSurface, ), child: ListView.builder( itemBuilder: (BuildContext context, int i) { diff --git a/packages/smooth_app/lib/pages/user_management/forgot_password_page.dart b/packages/smooth_app/lib/pages/user_management/forgot_password_page.dart index 028ad5d5f38..42108e73d1e 100644 --- a/packages/smooth_app/lib/pages/user_management/forgot_password_page.dart +++ b/packages/smooth_app/lib/pages/user_management/forgot_password_page.dart @@ -150,11 +150,10 @@ class _ForgotPasswordPageState extends State } }, style: ButtonStyle( - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( Size(size.width * 0.5, theme.buttonTheme.height + 10), ), - shape: - MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), diff --git a/packages/smooth_app/lib/pages/user_management/login_page.dart b/packages/smooth_app/lib/pages/user_management/login_page.dart index fbd7e963e49..cbda47ad48b 100644 --- a/packages/smooth_app/lib/pages/user_management/login_page.dart +++ b/packages/smooth_app/lib/pages/user_management/login_page.dart @@ -221,12 +221,12 @@ class _LoginPageState extends State with TraceableClientMixin { ElevatedButton( onPressed: () => _login(context), style: ButtonStyle( - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( Size(size.width * 0.5, theme.buttonTheme.height + 10), ), - shape: MaterialStateProperty.all< - RoundedRectangleBorder>( + shape: + WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), @@ -249,14 +249,14 @@ class _LoginPageState extends State with TraceableClientMixin { //Forgot password TextButton( style: ButtonStyle( - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( const EdgeInsets.symmetric( vertical: 10.0, horizontal: VERY_LARGE_SPACE, ), ), shape: - MaterialStateProperty.all( + WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), @@ -304,15 +304,15 @@ class _LoginPageState extends State with TraceableClientMixin { } }, style: ButtonStyle( - side: MaterialStateProperty.all( + side: WidgetStateProperty.all( BorderSide( color: theme.colorScheme.primary, width: 2.0), ), - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( Size(size.width * 0.5, theme.buttonTheme.height), ), - shape: MaterialStateProperty.all< - RoundedRectangleBorder>( + shape: + WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), diff --git a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart index 48f2713516f..8bbd6b10238 100644 --- a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart +++ b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart @@ -56,11 +56,11 @@ class _SignUpPageState extends State with TraceableClientMixin { final AppLocalizations appLocalizations = AppLocalizations.of(context); final Size size = MediaQuery.sizeOf(context); - Color getCheckBoxColor(Set states) { - const Set interactiveStates = { - MaterialState.pressed, - MaterialState.hovered, - MaterialState.focused, + Color getCheckBoxColor(Set states) { + const Set interactiveStates = { + WidgetState.pressed, + WidgetState.hovered, + WidgetState.focused, }; if (states.any(interactiveStates.contains)) { return theme.colorScheme.onSurface; @@ -236,14 +236,14 @@ class _SignUpPageState extends State with TraceableClientMixin { child: Checkbox( value: _foodProducer, fillColor: - MaterialStateProperty.resolveWith(getCheckBoxColor), + WidgetStateProperty.resolveWith(getCheckBoxColor), onChanged: (_) {}, ), ), title: Text( appLocalizations.sign_up_page_producer_checkbox, style: theme.textTheme.bodyMedium - ?.copyWith(color: theme.colorScheme.onBackground), + ?.copyWith(color: theme.colorScheme.onSurface), ), ), if (_foodProducer) ...[ @@ -274,24 +274,24 @@ class _SignUpPageState extends State with TraceableClientMixin { child: Checkbox( value: _subscribe, fillColor: - MaterialStateProperty.resolveWith(getCheckBoxColor), + WidgetStateProperty.resolveWith(getCheckBoxColor), onChanged: (_) {}, ), ), title: Text( appLocalizations.sign_up_page_subscribe_checkbox, style: theme.textTheme.bodyMedium - ?.copyWith(color: theme.colorScheme.onBackground), + ?.copyWith(color: theme.colorScheme.onSurface), ), ), const SizedBox(height: space), ElevatedButton( onPressed: () async => _signUp(), style: ButtonStyle( - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( Size(size.width * 0.5, theme.buttonTheme.height + 10), ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), @@ -447,7 +447,7 @@ class _TermsOfUseCheckbox extends StatelessWidget { final bool agree; final bool disagree; - final MaterialPropertyResolver checkboxColorResolver; + final WidgetPropertyResolver checkboxColorResolver; final ValueChanged onCheckboxChanged; @override @@ -470,7 +470,7 @@ class _TermsOfUseCheckbox extends StatelessWidget { ignoring: true, child: Checkbox( value: agree, - fillColor: MaterialStateProperty.resolveWith( + fillColor: WidgetStateProperty.resolveWith( checkboxColorResolver, ), onChanged: (_) {}, @@ -485,7 +485,7 @@ class _TermsOfUseCheckbox extends StatelessWidget { // additional space needed because of the next text span text: '${appLocalizations.sign_up_page_agree_text} ', style: theme.textTheme.bodyMedium?.copyWith( - color: theme.colorScheme.onBackground, + color: theme.colorScheme.onSurface, ), ), TextSpan( @@ -509,7 +509,7 @@ class _TermsOfUseCheckbox extends StatelessWidget { semanticLabel: appLocalizations.termsOfUse, Icons.info, color: checkboxColorResolver( - {MaterialState.selected}, + {WidgetState.selected}, ), ), ), diff --git a/packages/smooth_app/lib/smooth_category_picker_example.dart b/packages/smooth_app/lib/smooth_category_picker_example.dart index 48287c35432..86263096ff9 100644 --- a/packages/smooth_app/lib/smooth_category_picker_example.dart +++ b/packages/smooth_app/lib/smooth_category_picker_example.dart @@ -167,9 +167,8 @@ class _ExampleAppState extends State { foregroundColor: Colors.black, ), checkboxTheme: CheckboxTheme.of(context).copyWith( - fillColor: - MaterialStateColor.resolveWith((Set states) { - if (states.contains(MaterialState.selected)) { + fillColor: WidgetStateColor.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) { return Colors.green; } return Colors.black38; diff --git a/packages/smooth_app/lib/themes/color_schemes.dart b/packages/smooth_app/lib/themes/color_schemes.dart index 9e31f3135f9..59bd71c4963 100644 --- a/packages/smooth_app/lib/themes/color_schemes.dart +++ b/packages/smooth_app/lib/themes/color_schemes.dart @@ -12,10 +12,8 @@ const ColorScheme lightColorScheme = ColorScheme( onSecondary: Color(0xFF000000), error: Color(0xFFEB5757), onError: Color(0xFFFFFFFF), - background: Color(0xFFFFFFFF), - onBackground: Color(0xFF000000), - surface: Color(0xFF85746C), - onSurface: Color(0xFFFFFFFF), + surface: Color(0xFFFFFFFF), + onSurface: Color(0xFF000000), ); const ColorScheme darkColorScheme = ColorScheme( @@ -27,10 +25,8 @@ const ColorScheme darkColorScheme = ColorScheme( onSecondary: Color(0xFFFFFFFF), error: Color(0xFFEB5757), onError: Color(0xFFFFFFFF), - background: Color(0xFF201A17), - onBackground: Color(0xFFFFFFFF), - surface: Color(0xFFEDE0DB), - onSurface: Color(0xFF000000), + surface: Color(0xFF201A17), + onSurface: Color(0xFFFFFFFF), ); const ColorScheme trueDarkColorScheme = ColorScheme( @@ -42,10 +38,8 @@ const ColorScheme trueDarkColorScheme = ColorScheme( onSecondary: Color(0xFFE1E1E1), error: Color(0xFFEA2B2B), onError: Color(0xFFE1E1E1), - background: Color(0xFF000000), - onBackground: Color(0xFFE1E1E1), surface: Color(0xFF000000), - onSurface: Color(0xFFE1E1E1), + onSurface: Color(0xFFFFFFFF), ); const String CONTRAST_LOW = 'Low'; diff --git a/packages/smooth_app/lib/themes/smooth_theme.dart b/packages/smooth_app/lib/themes/smooth_theme.dart index 301342c3123..1d41a28ecbe 100644 --- a/packages/smooth_app/lib/themes/smooth_theme.dart +++ b/packages/smooth_app/lib/themes/smooth_theme.dart @@ -47,7 +47,7 @@ class SmoothTheme { ], colorScheme: myColorScheme, canvasColor: themeProvider.currentTheme == THEME_AMOLED - ? myColorScheme.background + ? myColorScheme.surface : null, bottomNavigationBarTheme: BottomNavigationBarThemeData( selectedIconTheme: const IconThemeData(size: 24.0), @@ -61,11 +61,10 @@ class SmoothTheme { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStateProperty.resolveWith( - (Set states) => - states.contains(MaterialState.disabled) - ? Colors.grey - : myColorScheme.primary, + backgroundColor: WidgetStateProperty.resolveWith( + (Set states) => states.contains(WidgetState.disabled) + ? Colors.grey + : myColorScheme.primary, ), ), ), @@ -76,8 +75,8 @@ class SmoothTheme { ? getTextTheme(themeProvider, textContrastProvider) : _TEXT_THEME, appBarTheme: AppBarTheme( - color: myColorScheme.background, - foregroundColor: myColorScheme.onBackground, + color: myColorScheme.surface, + foregroundColor: myColorScheme.onSurface, systemOverlayStyle: SystemUiOverlayStyle.light, ), dividerColor: const Color(0xFFdfdfdf), @@ -85,59 +84,59 @@ class SmoothTheme { fillColor: myColorScheme.secondary, ), iconTheme: IconThemeData( - color: myColorScheme.onBackground, + color: myColorScheme.onSurface, ), snackBarTheme: SnackBarThemeData( contentTextStyle: _TEXT_THEME.bodyMedium?.copyWith(color: myColorScheme.onPrimary), actionTextColor: myColorScheme.onPrimary, - backgroundColor: myColorScheme.onBackground, + backgroundColor: myColorScheme.onSurface, ), bannerTheme: MaterialBannerThemeData( contentTextStyle: TextStyle(color: myColorScheme.onSecondary), backgroundColor: myColorScheme.secondary, ), checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { + fillColor: + WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return myColorScheme.primary; } return null; }), ), radioTheme: RadioThemeData( - fillColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { + fillColor: + WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return myColorScheme.primary; } return null; }), ), switchTheme: SwitchThemeData( - thumbColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { + thumbColor: + WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return myColorScheme.primary; } return null; }), - trackColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { + trackColor: + WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return myColorScheme.primary; } return null; diff --git a/packages/smooth_app/lib/widgets/ranking_floating_action_button.dart b/packages/smooth_app/lib/widgets/ranking_floating_action_button.dart index c079a64c370..7a2de39e52a 100644 --- a/packages/smooth_app/lib/widgets/ranking_floating_action_button.dart +++ b/packages/smooth_app/lib/widgets/ranking_floating_action_button.dart @@ -29,7 +29,7 @@ class RankingFloatingActionButton extends StatelessWidget { child: ElevatedButton.icon( onPressed: onPressed, style: ButtonStyle( - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( const RoundedRectangleBorder( borderRadius: CIRCULAR_BORDER_RADIUS, ), diff --git a/packages/smooth_app/pubspec.lock b/packages/smooth_app/pubspec.lock index eaec5236455..88fb418e666 100644 --- a/packages/smooth_app/pubspec.lock +++ b/packages/smooth_app/pubspec.lock @@ -903,10 +903,10 @@ packages: dependency: transitive description: name: in_app_review - sha256: "6cb7a8e4a2eecfa5868b35e1e9ac9082341eeead2cefaac8282be514736e9715" + sha256: "99869244d09adc76af16bf8fd731dd13cef58ecafd5917847589c49f378cbb30" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.0.9" in_app_review_platform_interface: dependency: transitive description: @@ -924,10 +924,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" iso_countries: dependency: "direct main" description: @@ -964,26 +964,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" lints: dependency: transitive description: @@ -1052,10 +1052,10 @@ packages: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" mgrs_dart: dependency: transitive description: @@ -1599,10 +1599,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" typed_data: dependency: transitive description: @@ -1743,10 +1743,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" watcher: dependency: transitive description: @@ -1852,5 +1852,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.3 <4.0.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.19.0" diff --git a/packages/smooth_app/pubspec.yaml b/packages/smooth_app/pubspec.yaml index c0f7b8ff438..113f6f7bf8d 100644 --- a/packages/smooth_app/pubspec.yaml +++ b/packages/smooth_app/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.0+734 publish_to: "none" environment: - sdk: '>=3.3.3 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: @@ -54,7 +54,7 @@ dependencies: auto_size_text: 3.0.0 crop_image: 1.0.13 shared_preferences: 2.2.3 - intl: 0.18.1 + intl: 0.19.0 collection: 1.18.0 path: 1.9.0 path_provider: 2.1.3