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 13d18d0cc74..ab995840d41 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 @@ -125,53 +125,50 @@ class _ProductListPageState extends State ), appBar: SmoothAppBar( centerTitle: _selectionMode ? false : null, - actions: !(enableClear || enableRename) - ? null - : [ - IconButton( - icon: const Icon(CupertinoIcons.square_list), - onPressed: () async { - final ProductList? selected = - await Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - const AllProductListPage(), - fullscreenDialog: true, - ), - ); - if (selected == null) { - return; - } - if (context.mounted) { - await DaoProductList(localDatabase).get(selected); - if (context.mounted) { - setState(() => productList = selected); - } - } - }, - ), - PopupMenuButton( - onSelected: (final ProductListPopupItem action) async { - final ProductList? differentProductList = - await action.doSomething( - productList: productList, - localDatabase: localDatabase, - context: context, - ); - if (differentProductList != null) { - setState(() => productList = differentProductList); - } - }, - itemBuilder: (BuildContext context) => - >[ - if (enableRename) _rename.getMenuItem(appLocalizations), - _share.getMenuItem(appLocalizations), - _openInWeb.getMenuItem(appLocalizations), - if (enableClear) _clear.getMenuItem(appLocalizations), - ], + actions: [ + IconButton( + icon: const Icon(CupertinoIcons.square_list), + onPressed: () async { + final ProductList? selected = await Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const AllProductListPage(), + fullscreenDialog: true, ), + ); + if (selected == null) { + return; + } + if (context.mounted) { + await DaoProductList(localDatabase).get(selected); + if (context.mounted) { + setState(() => productList = selected); + } + } + }, + ), + if (enableClear || enableRename) + PopupMenuButton( + onSelected: (final ProductListPopupItem action) async { + final ProductList? differentProductList = + await action.doSomething( + productList: productList, + localDatabase: localDatabase, + context: context, + ); + if (differentProductList != null) { + setState(() => productList = differentProductList); + } + }, + itemBuilder: (BuildContext context) => + >[ + if (enableRename) _rename.getMenuItem(appLocalizations), + _share.getMenuItem(appLocalizations), + _openInWeb.getMenuItem(appLocalizations), + if (enableClear) _clear.getMenuItem(appLocalizations), ], + ), + ], title: AutoSizeText( ProductQueryPageHelper.getProductListLabel( productList,