diff --git a/packages/smooth_app/lib/pages/page_manager.dart b/packages/smooth_app/lib/pages/page_manager.dart index 4de3324c535..0465f7d4da6 100644 --- a/packages/smooth_app/lib/pages/page_manager.dart +++ b/packages/smooth_app/lib/pages/page_manager.dart @@ -51,6 +51,18 @@ class PageManagerState extends State { } } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final InheritedDataManagerState inheritedDataManager = + InheritedDataManager.of(context); + if (inheritedDataManager.showSearchCard && + _currentPage != BottomNavigationTab.Scan) { + _currentPage = BottomNavigationTab.Scan; + _selectTab(_currentPage, 1); + } + } + @override Widget build(BuildContext context) { final AppLocalizations appLocalizations = AppLocalizations.of(context); 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 2616634f659..eb4e9f23379 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 @@ -20,6 +20,7 @@ import 'package:smooth_app/pages/personalized_ranking_page.dart'; import 'package:smooth_app/pages/product/common/product_list_item_simple.dart'; import 'package:smooth_app/pages/product/common/product_query_page_helper.dart'; import 'package:smooth_app/pages/product_list_user_dialog_helper.dart'; +import 'package:smooth_app/pages/scan/inherited_data_manager.dart'; class ProductListPage extends StatefulWidget { const ProductListPage(this.productList); @@ -158,29 +159,34 @@ class _ProductListPageState extends State ), ), body: products.isEmpty - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/misc/empty-list.svg', - height: MediaQuery.of(context).size.height * .4, - ), - Text( - appLocalizations.product_list_empty_title, - style: themeData.textTheme.headlineLarge - ?.apply(color: colorScheme.onBackground), - ), - Padding( - padding: const EdgeInsets.all(VERY_LARGE_SPACE), - child: Text( - appLocalizations.product_list_empty_message, - textAlign: TextAlign.center, - style: themeData.textTheme.bodyText2?.apply( - color: colorScheme.onBackground, - ), + ? GestureDetector( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/misc/empty-list.svg', + height: MediaQuery.of(context).size.height * .4, ), - ) - ], + Text( + appLocalizations.product_list_empty_title, + style: themeData.textTheme.headlineLarge + ?.apply(color: colorScheme.onBackground), + ), + Padding( + padding: const EdgeInsets.all(VERY_LARGE_SPACE), + child: Text( + appLocalizations.product_list_empty_message, + textAlign: TextAlign.center, + style: themeData.textTheme.bodyText2?.apply( + color: colorScheme.onBackground, + ), + ), + ) + ], + ), + onTap: () { + InheritedDataManager.of(context).resetShowSearchCard(true); + }, ) : RefreshIndicator( //if it is in selectmode then refresh indicator is not shown