From 488598cf7a81115c1a86b2046d4aef557b885046 Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sun, 1 Dec 2024 11:06:25 +0100 Subject: [PATCH] =?UTF-8?q?Fixes=20for=20the=20product=20addition=20(block?= =?UTF-8?q?ing=20/=20dark=20mode=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../add_new_product/add_new_product_page.dart | 21 ++++++++++++++++--- .../product/product_incomplete_card.dart | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/smooth_app/lib/pages/product/add_new_product/add_new_product_page.dart b/packages/smooth_app/lib/pages/product/add_new_product/add_new_product_page.dart index 25ccaa47ccb..afa27898c2d 100644 --- a/packages/smooth_app/lib/pages/product/add_new_product/add_new_product_page.dart +++ b/packages/smooth_app/lib/pages/product/add_new_product/add_new_product_page.dart @@ -28,6 +28,9 @@ import 'package:smooth_app/pages/product/product_image_swipeable_view.dart'; import 'package:smooth_app/pages/product/product_type_extensions.dart'; import 'package:smooth_app/pages/product/simple_input_page_helpers.dart'; import 'package:smooth_app/query/product_query.dart'; +import 'package:smooth_app/themes/smooth_theme.dart'; +import 'package:smooth_app/themes/smooth_theme_colors.dart'; +import 'package:smooth_app/themes/theme_provider.dart'; import 'package:smooth_app/widgets/smooth_scaffold.dart'; import 'package:smooth_app/widgets/v2/smooth_buttons_bar.dart'; import 'package:smooth_app/widgets/will_pop_scope.dart'; @@ -98,6 +101,7 @@ class _AddNewProductPageState extends State (widget.displayPictures ? 1 : 0); double get _progress => (_pageNumber + 1) / _totalPages; + bool get _isLastPage => (_pageNumber + 1) == _totalPages; ProductType? _inputProductType; late ColorScheme _colorScheme; @@ -236,6 +240,7 @@ class _AddNewProductPageState extends State onWillPop: () async => (await _onWillPop(), null), child: SmoothScaffold( body: SafeArea( + bottom: false, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -261,6 +266,10 @@ class _AddNewProductPageState extends State Expanded( child: PageView( controller: _pageController, + physics: + widget.displayProductType && _inputProductType == null + ? const NeverScrollableScrollPhysics() + : null, children: [ if (widget.displayProductType) _buildCard(_getProductTypes(context)), @@ -460,6 +469,9 @@ class _AddNewProductPageState extends State List _getEcoscoreRows(final BuildContext context) { final AppLocalizations appLocalizations = AppLocalizations.of(context); + final SmoothColorsThemeExtension extension = + context.extension(); + final Attribute? attribute = _getAttribute(Attribute.ATTRIBUTE_ECOSCORE); return [ AddNewProductTitle(appLocalizations.new_product_title_ecoscore), @@ -474,18 +486,21 @@ class _AddNewProductPageState extends State ), ), const SizedBox(height: 15.0), - GestureDetector( + InkWell( + borderRadius: ROUNDED_BORDER_RADIUS, onTap: () { setState(() => _ecoscoreExpanded = !_ecoscoreExpanded); }, - child: Container( + child: Ink( padding: const EdgeInsets.symmetric( vertical: BALANCED_SPACE, horizontal: 15.0, ), decoration: BoxDecoration( borderRadius: ROUNDED_BORDER_RADIUS, - color: _colorScheme.surface, + color: context.lightTheme() + ? extension.primaryNormal + : extension.primaryMedium, ), child: Row( children: [ 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 0dad587f222..c32f927ad9a 100644 --- a/packages/smooth_app/lib/pages/product/product_incomplete_card.dart +++ b/packages/smooth_app/lib/pages/product/product_incomplete_card.dart @@ -110,8 +110,8 @@ class ProductIncompleteCard extends StatelessWidget { Icons.bolt, color: Colors.amber, ), - onPressed: () async => Navigator.push( - context, + onPressed: () async => + Navigator.of(context, rootNavigator: true).push( MaterialPageRoute( builder: (BuildContext context) => AddNewProductPage.fromProduct( product,