From 5ec11a2f8d0f893dd9524852f4d159cfd292fdc5 Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sat, 15 Jun 2024 15:09:33 +0200 Subject: [PATCH] Edge to edge mode on Android --- packages/smooth_app/lib/main.dart | 13 ++ .../onboarding/consent_analytics_page.dart | 127 +++++------ .../knowledge_panel_page_template.dart | 2 +- .../pages/onboarding/permissions_page.dart | 117 ++++++----- .../pages/onboarding/reinvention_page.dart | 2 +- .../lib/pages/onboarding/scan_example.dart | 84 ++++---- .../lib/pages/onboarding/welcome_page.dart | 197 +++++++++--------- .../lib/pages/product/edit_ocr_page.dart | 56 ++--- .../lib/pages/product/edit_product_page.dart | 6 +- .../lib/pages/product/new_product_page.dart | 2 + .../lib/widgets/smooth_scaffold.dart | 10 +- 11 files changed, 328 insertions(+), 288 deletions(-) diff --git a/packages/smooth_app/lib/main.dart b/packages/smooth_app/lib/main.dart index 79d451e26f8..66332c09516 100644 --- a/packages/smooth_app/lib/main.dart +++ b/packages/smooth_app/lib/main.dart @@ -81,6 +81,8 @@ Future launchSmoothApp({ WidgetsFlutterBinding.ensureInitialized(); FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); + _enableEdgeToEdgeMode(); + if (kReleaseMode) { await AnalyticsHelper.initSentry( appRunner: () => runApp(const SmoothApp())); @@ -89,6 +91,17 @@ Future launchSmoothApp({ } } +void _enableEdgeToEdgeMode() { + if (Platform.isAndroid) { + SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + systemNavigationBarColor: Colors.transparent, + ), + ); + } +} + class SmoothApp extends StatefulWidget { const SmoothApp(); diff --git a/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart b/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart index f096f38151d..acadaf67225 100644 --- a/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart +++ b/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -24,72 +26,73 @@ class ConsentAnalyticsPage extends StatelessWidget { final AppLocalizations appLocalizations = AppLocalizations.of(context); return ColoredBox( color: backgroundColor, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset( - 'assets/onboarding/analytics.svg', - width: screenSize.width * .50, - package: AppHelper.APP_PACKAGE, - ), - const SizedBox(height: LARGE_SPACE), - AutoSizeText( - appLocalizations.consent_analytics_title, - maxLines: 2, - style: Theme.of(context) - .textTheme - .displayLarge! - .apply(color: const Color.fromARGB(255, 51, 51, 51)), - textAlign: TextAlign.center, - ), - const SizedBox(height: SMALL_SPACE), - AutoSizeText( - appLocalizations.consent_analytics_body1, - maxLines: 3, - textAlign: TextAlign.center, - style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, - ), - const SizedBox(height: SMALL_SPACE), - AutoSizeText( - appLocalizations.consent_analytics_body2, - maxLines: 3, - textAlign: TextAlign.center, - style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, - ), - ], + child: SafeArea( + bottom: Platform.isAndroid, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + 'assets/onboarding/analytics.svg', + width: screenSize.width * .50, + package: AppHelper.APP_PACKAGE, + ), + const SizedBox(height: LARGE_SPACE), + AutoSizeText( + appLocalizations.consent_analytics_title, + maxLines: 2, + style: Theme.of(context).textTheme.displayLarge!.apply( + color: const Color.fromARGB(255, 51, 51, 51)), + textAlign: TextAlign.center, + ), + const SizedBox(height: SMALL_SPACE), + AutoSizeText( + appLocalizations.consent_analytics_body1, + maxLines: 3, + textAlign: TextAlign.center, + style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, + ), + const SizedBox(height: SMALL_SPACE), + AutoSizeText( + appLocalizations.consent_analytics_body2, + maxLines: 3, + textAlign: TextAlign.center, + style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, + ), + ], + ), ), ), ), - ), - OnboardingBottomBar( - rightButton: _buildButton( - context, - appLocalizations.refuse_button_label, - false, - const Color(0xFFA08D84), - Colors.white, - ), - leftButton: _buildButton( - context, - appLocalizations.authorize_button_label, - true, - Colors.white, - Colors.black, + OnboardingBottomBar( + rightButton: _buildButton( + context, + appLocalizations.refuse_button_label, + false, + const Color(0xFFA08D84), + Colors.white, + ), + leftButton: _buildButton( + context, + appLocalizations.authorize_button_label, + true, + Colors.white, + Colors.black, + ), + backgroundColor: backgroundColor, + semanticsHorizontalOrder: false, ), - backgroundColor: backgroundColor, - semanticsHorizontalOrder: false, - ), - ], + ], + ), ), ); } diff --git a/packages/smooth_app/lib/pages/onboarding/knowledge_panel_page_template.dart b/packages/smooth_app/lib/pages/onboarding/knowledge_panel_page_template.dart index 6a4a68ca5f9..7be4686b503 100644 --- a/packages/smooth_app/lib/pages/onboarding/knowledge_panel_page_template.dart +++ b/packages/smooth_app/lib/pages/onboarding/knowledge_panel_page_template.dart @@ -85,7 +85,7 @@ class _KnowledgePanelPageTemplateState product: _product, onboardingMode: true, ); - return Container( + return ColoredBox( color: widget.backgroundColor, child: SafeArea( bottom: Platform.isAndroid, diff --git a/packages/smooth_app/lib/pages/onboarding/permissions_page.dart b/packages/smooth_app/lib/pages/onboarding/permissions_page.dart index 4006751138d..bfb2b669f48 100644 --- a/packages/smooth_app/lib/pages/onboarding/permissions_page.dart +++ b/packages/smooth_app/lib/pages/onboarding/permissions_page.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart' hide Listener; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -46,64 +48,65 @@ class _PermissionsPageState extends State { }, child: ColoredBox( color: widget.backgroundColor, - child: Column( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), - child: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - LayoutBuilder(builder: - (BuildContext context, BoxConstraints constraints) { - return SizedBox.square( - dimension: constraints.maxWidth * 0.5, - child: Transform.rotate( - angle: -0.2, - child: const animations.BarcodeAnimation(), - ), - ); - }), - const SizedBox(height: LARGE_SPACE), - AutoSizeText( - appLocalizations.permissions_page_title, - maxLines: 2, - style: Theme.of(context) - .textTheme - .displayLarge! - .apply(color: const Color.fromARGB(255, 51, 51, 51)), - textAlign: TextAlign.center, - ), - const SizedBox(height: SMALL_SPACE), - AutoSizeText( - appLocalizations.permissions_page_body1, - maxLines: 2, - textAlign: TextAlign.center, - style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, - ), - const SizedBox(height: MEDIUM_SPACE), - AutoSizeText( - appLocalizations.permissions_page_body2, - maxLines: 3, - textAlign: TextAlign.center, - style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, - ), - ], + child: SafeArea( + bottom: Platform.isAndroid, + child: Column( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + LayoutBuilder(builder: + (BuildContext context, BoxConstraints constraints) { + return SizedBox.square( + dimension: constraints.maxWidth * 0.5, + child: Transform.rotate( + angle: -0.2, + child: const animations.BarcodeAnimation(), + ), + ); + }), + const SizedBox(height: LARGE_SPACE), + AutoSizeText( + appLocalizations.permissions_page_title, + maxLines: 2, + style: Theme.of(context).textTheme.displayLarge!.apply( + color: const Color.fromARGB(255, 51, 51, 51)), + textAlign: TextAlign.center, + ), + const SizedBox(height: SMALL_SPACE), + AutoSizeText( + appLocalizations.permissions_page_body1, + maxLines: 2, + textAlign: TextAlign.center, + style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, + ), + const SizedBox(height: MEDIUM_SPACE), + AutoSizeText( + appLocalizations.permissions_page_body2, + maxLines: 3, + textAlign: TextAlign.center, + style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED, + ), + ], + ), + ), + )), + OnboardingBottomBar( + rightButton: _IgnoreButton( + onPermissionIgnored: () => _moveToNextScreen(context), + ), + leftButton: _AskPermissionButton( + onPermissionIgnored: () => _moveToNextScreen(context), ), - ), - )), - OnboardingBottomBar( - rightButton: _IgnoreButton( - onPermissionIgnored: () => _moveToNextScreen(context), - ), - leftButton: _AskPermissionButton( - onPermissionIgnored: () => _moveToNextScreen(context), - ), - backgroundColor: widget.backgroundColor, - semanticsHorizontalOrder: false, - ) - ], + backgroundColor: widget.backgroundColor, + semanticsHorizontalOrder: false, + ) + ], + ), ), ), ); diff --git a/packages/smooth_app/lib/pages/onboarding/reinvention_page.dart b/packages/smooth_app/lib/pages/onboarding/reinvention_page.dart index 98964256e8c..a60ab501412 100644 --- a/packages/smooth_app/lib/pages/onboarding/reinvention_page.dart +++ b/packages/smooth_app/lib/pages/onboarding/reinvention_page.dart @@ -28,7 +28,7 @@ class ReinventionPage extends StatelessWidget { final Size screenSize = MediaQuery.sizeOf(context); final double animHeight = 352.0 * screenSize.width / 375.0; - return Container( + return ColoredBox( color: backgroundColor, child: SafeArea( bottom: false, diff --git a/packages/smooth_app/lib/pages/onboarding/scan_example.dart b/packages/smooth_app/lib/pages/onboarding/scan_example.dart index 5eb5d1b9b74..52646e02f03 100644 --- a/packages/smooth_app/lib/pages/onboarding/scan_example.dart +++ b/packages/smooth_app/lib/pages/onboarding/scan_example.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -18,49 +20,53 @@ class ScanExample extends StatelessWidget { Widget build(BuildContext context) { final AppLocalizations appLocalizations = AppLocalizations.of(context); final Size screenSize = MediaQuery.sizeOf(context); - return Container( + return ColoredBox( color: backgroundColor, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Used for spacing - EMPTY_WIDGET, - Padding( - padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/onboarding/scan.svg', - height: screenSize.height * .50, - package: AppHelper.APP_PACKAGE, - ), - Padding( - padding: const EdgeInsetsDirectional.only(top: SMALL_SPACE), - child: SizedBox( - height: screenSize.height * .15, - child: AutoSizeText( - appLocalizations.offUtility, - maxLines: 2, - style: Theme.of(context) - .textTheme - .displayLarge! - .wellSpaced - .apply(color: const Color.fromARGB(255, 51, 51, 51)), + child: SafeArea( + bottom: Platform.isAndroid, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Used for spacing + EMPTY_WIDGET, + Padding( + padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/onboarding/scan.svg', + height: screenSize.height * .50, + package: AppHelper.APP_PACKAGE, + ), + Padding( + padding: const EdgeInsetsDirectional.only(top: SMALL_SPACE), + child: SizedBox( + height: screenSize.height * .15, + child: AutoSizeText( + appLocalizations.offUtility, + maxLines: 2, + style: Theme.of(context) + .textTheme + .displayLarge! + .wellSpaced + .apply( + color: const Color.fromARGB(255, 51, 51, 51)), + ), ), ), - ), - ], + ], + ), + ), + NextButton( + OnboardingPage.SCAN_EXAMPLE, + backgroundColor: backgroundColor, + nextKey: const Key('nextAfterScanExample'), ), - ), - NextButton( - OnboardingPage.SCAN_EXAMPLE, - backgroundColor: backgroundColor, - nextKey: const Key('nextAfterScanExample'), - ), - ], + ], + ), ), ); } diff --git a/packages/smooth_app/lib/pages/onboarding/welcome_page.dart b/packages/smooth_app/lib/pages/onboarding/welcome_page.dart index da5b9b8224f..736f8ba6425 100644 --- a/packages/smooth_app/lib/pages/onboarding/welcome_page.dart +++ b/packages/smooth_app/lib/pages/onboarding/welcome_page.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -28,116 +30,119 @@ class WelcomePage extends StatelessWidget { backgroundColor: backgroundColor, brightness: Brightness.dark, resizeToAvoidBottomInset: false, - body: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - flex: 1, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), - child: ListView( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: screenSize.height * .05), - SvgPicture.asset( - 'assets/onboarding/title.svg', - height: screenSize.height * .10, - package: AppHelper.APP_PACKAGE, - ), - SvgPicture.asset( - 'assets/onboarding/globe.svg', - height: screenSize.height * .20, - package: AppHelper.APP_PACKAGE, - ), - Padding( - padding: - const EdgeInsetsDirectional.only(top: SMALL_SPACE), - child: SizedBox( - height: screenSize.height * .15, - child: AutoSizeText( - appLocalizations.whatIsOff, - style: headlineStyle, - maxLines: 3, - textAlign: TextAlign.center, - ), + body: SafeArea( + bottom: Platform.isAndroid, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + flex: 1, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE), + child: ListView( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: screenSize.height * .05), + SvgPicture.asset( + 'assets/onboarding/title.svg', + height: screenSize.height * .10, + package: AppHelper.APP_PACKAGE, ), - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - appLocalizations.onboarding_country_chooser_label, - style: bodyTextStyle, - ), - Padding( - padding: - const EdgeInsets.symmetric(vertical: MEDIUM_SPACE), - child: Ink( - decoration: BoxDecoration( - border: Border.fromBorderSide( - BorderSide( - color: theme.colorScheme.inversePrimary, - width: 1, - ), + SvgPicture.asset( + 'assets/onboarding/globe.svg', + height: screenSize.height * .20, + package: AppHelper.APP_PACKAGE, + ), + Padding( + padding: const EdgeInsetsDirectional.only( + top: SMALL_SPACE), + child: SizedBox( + height: screenSize.height * .15, + child: AutoSizeText( + appLocalizations.whatIsOff, + style: headlineStyle, + maxLines: 3, + textAlign: TextAlign.center, ), - borderRadius: ROUNDED_BORDER_RADIUS, - color: theme.colorScheme.onPrimary, ), - child: SizedBox( - width: double.infinity, - child: CountrySelector( - forceCurrencyChange: true, - padding: const EdgeInsets.symmetric( - horizontal: SMALL_SPACE, + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + appLocalizations.onboarding_country_chooser_label, + style: bodyTextStyle, + ), + Padding( + padding: const EdgeInsets.symmetric( + vertical: MEDIUM_SPACE), + child: Ink( + decoration: BoxDecoration( + border: Border.fromBorderSide( + BorderSide( + color: theme.colorScheme.inversePrimary, + width: 1, + ), ), - inkWellBorderRadius: ROUNDED_BORDER_RADIUS, - icon: Container( - height: double.infinity, - decoration: BoxDecoration( - color: theme.primaryColor, - borderRadius: ROUNDED_BORDER_RADIUS, + borderRadius: ROUNDED_BORDER_RADIUS, + color: theme.colorScheme.onPrimary, + ), + child: SizedBox( + width: double.infinity, + child: CountrySelector( + forceCurrencyChange: true, + padding: const EdgeInsets.symmetric( + horizontal: SMALL_SPACE, ), - child: AspectRatio( - aspectRatio: 1.0, - child: Icon( - Icons.edit, - color: Colors.white.withOpacity(0.9), + inkWellBorderRadius: ROUNDED_BORDER_RADIUS, + icon: Container( + height: double.infinity, + decoration: BoxDecoration( + color: theme.primaryColor, + borderRadius: ROUNDED_BORDER_RADIUS, + ), + child: AspectRatio( + aspectRatio: 1.0, + child: Icon( + Icons.edit, + color: Colors.white.withOpacity(0.9), + ), ), ), + textStyle: TextStyle(color: theme.primaryColor), ), - textStyle: TextStyle(color: theme.primaryColor), ), ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.only( - bottom: VERY_SMALL_SPACE, - ), - child: Text( - appLocalizations.country_selection_explanation, - style: bodyTextStyle, + Padding( + padding: const EdgeInsetsDirectional.only( + bottom: VERY_SMALL_SPACE, + ), + child: Text( + appLocalizations.country_selection_explanation, + style: bodyTextStyle, + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), - ), - NextButton( - OnboardingPage.WELCOME, - backgroundColor: backgroundColor, - nextKey: const Key('nextAfterWelcome'), - ), - ], + NextButton( + OnboardingPage.WELCOME, + backgroundColor: backgroundColor, + nextKey: const Key('nextAfterWelcome'), + ), + ], + ), ), ); } diff --git a/packages/smooth_app/lib/pages/product/edit_ocr_page.dart b/packages/smooth_app/lib/pages/product/edit_ocr_page.dart index 3548e33cb0a..4331a249eea 100644 --- a/packages/smooth_app/lib/pages/product/edit_ocr_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_ocr_page.dart @@ -260,16 +260,21 @@ class _EditOcrPageState extends State with UpToDateMixin { ), Flexible( flex: 1, - child: Container( + child: DecoratedBox( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.background, - borderRadius: const BorderRadiusDirectional.only( - topStart: ANGULAR_RADIUS, - topEnd: ANGULAR_RADIUS, - )), + color: Theme.of(context).colorScheme.background, + borderRadius: const BorderRadiusDirectional.only( + topStart: ANGULAR_RADIUS, + topEnd: ANGULAR_RADIUS, + ), + ), child: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.all(LARGE_SPACE), + padding: const EdgeInsetsDirectional.only( + start: LARGE_SPACE, + end: LARGE_SPACE, + top: LARGE_SPACE, + ), child: Column( children: [ if (!_multilingualHelper.isMonolingual()) @@ -321,31 +326,30 @@ class _EditOcrPageState extends State with UpToDateMixin { iconData: Icons.add_a_photo, ), ), - const SizedBox(height: MEDIUM_SPACE), - SmoothActionButtonsBar( - axis: Axis.horizontal, - negativeAction: SmoothActionButton( - text: appLocalizations.cancel, - onPressed: () => Navigator.pop(context), - ), - positiveAction: SmoothActionButton( - text: appLocalizations.save, - onPressed: () async { - await _updateText(); - if (!mounted) { - return; - } - Navigator.pop(context); - }, - ), - ), - const SizedBox(height: MEDIUM_SPACE), ], ), ), ), ), ), + SmoothActionButtonsBar( + axis: Axis.horizontal, + negativeAction: SmoothActionButton( + text: appLocalizations.cancel, + onPressed: () => Navigator.pop(context), + ), + positiveAction: SmoothActionButton( + text: appLocalizations.save, + onPressed: () async { + await _updateText(); + if (!mounted) { + return; + } + Navigator.pop(context); + }, + ), + ), + SizedBox(height: MediaQuery.paddingOf(context).bottom), ], ), ); diff --git a/packages/smooth_app/lib/pages/product/edit_product_page.dart b/packages/smooth_app/lib/pages/product/edit_product_page.dart index fe41b9d5615..610ae38ab5c 100644 --- a/packages/smooth_app/lib/pages/product/edit_product_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_product_page.dart @@ -76,8 +76,9 @@ class _EditProductPageState extends State with UpToDateMixin { theme.textTheme.titleLarge?.fontSize?.clamp(13.0, 17.0) ?? 13.0, maxLines: !_barcodeVisibleInAppbar ? 2 : 1, - style: theme.textTheme.titleLarge - ?.copyWith(fontWeight: FontWeight.w500), + style: theme.textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.w500, + ), ), if (barcode.isNotEmpty) AnimatedContainer( @@ -87,6 +88,7 @@ class _EditProductPageState extends State with UpToDateMixin { barcode, style: theme.textTheme.titleMedium?.copyWith( fontWeight: FontWeight.normal, + height: 0.9, ), ), ), 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 d5e70156a3c..f16cd8f68c8 100644 --- a/packages/smooth_app/lib/pages/product/new_product_page.dart +++ b/packages/smooth_app/lib/pages/product/new_product_page.dart @@ -258,6 +258,8 @@ class _ProductPageState extends State if (questionsLayout == ProductQuestionsLayout.banner) // assuming it's tall enough in order to go above the banner const SizedBox(height: 4 * VERY_LARGE_SPACE), + // Space for the navigation bar + SizedBox(height: MediaQuery.paddingOf(context).bottom), ], ), ); diff --git a/packages/smooth_app/lib/widgets/smooth_scaffold.dart b/packages/smooth_app/lib/widgets/smooth_scaffold.dart index ae5b4c73d2e..66e355fa3d0 100644 --- a/packages/smooth_app/lib/widgets/smooth_scaffold.dart +++ b/packages/smooth_app/lib/widgets/smooth_scaffold.dart @@ -162,18 +162,20 @@ class SmoothScaffoldState extends ScaffoldState { switch (brightness) { case Brightness.dark: - return const SystemUiOverlayStyle( + return SystemUiOverlayStyle( statusBarIconBrightness: Brightness.dark, statusBarBrightness: Brightness.light, - systemNavigationBarContrastEnforced: false, + systemNavigationBarContrastEnforced: + !Platform.isAndroid ? false : null, ); case Brightness.light: default: - return const SystemUiOverlayStyle( + return SystemUiOverlayStyle( statusBarIconBrightness: Brightness.light, statusBarBrightness: Brightness.dark, - systemNavigationBarContrastEnforced: false, + systemNavigationBarContrastEnforced: + !Platform.isAndroid ? false : null, ); } }