diff --git a/packages/smooth_app/lib/pages/all_user_product_list_page.dart b/packages/smooth_app/lib/pages/all_user_product_list_page.dart deleted file mode 100644 index 31393c991b3..00000000000 --- a/packages/smooth_app/lib/pages/all_user_product_list_page.dart +++ /dev/null @@ -1,118 +0,0 @@ -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; -import 'package:smooth_app/data_models/product_list.dart'; -import 'package:smooth_app/database/dao_product_list.dart'; -import 'package:smooth_app/database/local_database.dart'; -import 'package:smooth_app/generic_lib/design_constants.dart'; -import 'package:smooth_app/helpers/app_helper.dart'; -import 'package:smooth_app/pages/preferences/user_preferences_list_tile.dart'; -import 'package:smooth_app/pages/product/common/product_list_page.dart'; -import 'package:smooth_app/pages/product_list_user_dialog_helper.dart'; -import 'package:smooth_app/themes/constant_icons.dart'; -import 'package:smooth_app/widgets/smooth_app_bar.dart'; -import 'package:smooth_app/widgets/smooth_scaffold.dart'; - -// TODO(monsieurtanuki): confirm if still relevant with the new ProductListPage and AllProductListPage -/// Page that lists all user product lists. -class AllUserProductList extends StatefulWidget { - const AllUserProductList(); - - @override - State createState() => _AllUserProductListState(); -} - -class _AllUserProductListState extends State { - @override - Widget build(BuildContext context) { - final LocalDatabase localDatabase = context.watch(); - final DaoProductList daoProductList = DaoProductList(localDatabase); - final AppLocalizations appLocalizations = AppLocalizations.of(context); - final ThemeData themeData = Theme.of(context); - final List userLists = daoProductList.getUserLists(); - return SmoothScaffold( - appBar: SmoothAppBar(title: Text(appLocalizations.user_list_all_title)), - body: userLists.isEmpty - ? Center( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/misc/empty-list.svg', - height: MediaQuery.of(context).size.height * .4, - package: AppHelper.APP_PACKAGE, - ), - Padding( - padding: const EdgeInsets.all(SMALL_SPACE), - child: AutoSizeText( - appLocalizations.user_list_all_empty, - style: themeData.textTheme.displayLarge, - textAlign: TextAlign.center, - maxLines: 1, - ), - ), - ], - ), - ), - ) - : ListView.builder( - itemCount: userLists.length, - itemBuilder: (final BuildContext context, final int index) { - final String userList = userLists[index]; - final ProductList productList = ProductList.user(userList); - return UserPreferencesListTile( - title: Text(userList), - subtitle: FutureBuilder( - future: daoProductList.getLength(productList), - builder: ( - final BuildContext context, - final AsyncSnapshot snapshot, - ) { - if (snapshot.data != null) { - return Text( - appLocalizations.user_list_length(snapshot.data!), - ); - } - return EMPTY_WIDGET; - }, - ), - trailing: Icon(ConstantIcons.instance.getForwardIcon()), - onTap: () async { - await daoProductList.get(productList); - if (!mounted) { - return; - } - await Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - ProductListPage(productList), - ), - ); - setState(() {}); - }, - onLongPress: () async => - ProductListUserDialogHelper(daoProductList) - .showDeleteUserListDialog( - context, - ProductList.user(userList), - ), - ); - }, - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async => ProductListUserDialogHelper(daoProductList) - .showCreateUserListDialog(context), - label: Row( - children: [ - const Icon(Icons.add), - Text(appLocalizations.add_list_label), - ], - ), - ), - ); - } -} diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_page.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_page.dart index a3fe2f38998..829f357aa0f 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_page.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_page.dart @@ -18,7 +18,6 @@ import 'package:smooth_app/pages/preferences/user_preferences_dev_mode.dart'; import 'package:smooth_app/pages/preferences/user_preferences_faq.dart'; import 'package:smooth_app/pages/preferences/user_preferences_food.dart'; import 'package:smooth_app/pages/preferences/user_preferences_settings.dart'; -import 'package:smooth_app/pages/preferences/user_preferences_user_lists.dart'; import 'package:smooth_app/pages/preferences/user_preferences_widgets.dart'; import 'package:smooth_app/themes/theme_provider.dart'; import 'package:smooth_app/widgets/smooth_app_bar.dart'; @@ -26,7 +25,6 @@ import 'package:smooth_app/widgets/smooth_scaffold.dart'; enum PreferencePageType { ACCOUNT('account'), - LISTS('lists'), FOOD('food'), DEV_MODE('dev_mode'), SETTINGS('settings'), @@ -74,7 +72,6 @@ class _UserPreferencesPageState extends State if (widget.type == null) { final List items = [ PreferencePageType.ACCOUNT, - PreferencePageType.LISTS, PreferencePageType.FOOD, PreferencePageType.SETTINGS, PreferencePageType.CONTRIBUTE, @@ -200,14 +197,6 @@ class _UserPreferencesPageState extends State appLocalizations: appLocalizations, themeData: themeData, ); - case PreferencePageType.LISTS: - return UserPreferencesUserLists( - setState: setState, - context: context, - userPreferences: userPreferences, - appLocalizations: appLocalizations, - themeData: themeData, - ); case PreferencePageType.FOOD: return UserPreferencesFood( productPreferences: productPreferences, diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_user_lists.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_user_lists.dart deleted file mode 100644 index 18612391bc1..00000000000 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_user_lists.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:smooth_app/data_models/user_preferences.dart'; -import 'package:smooth_app/pages/all_user_product_list_page.dart'; -import 'package:smooth_app/pages/preferences/abstract_user_preferences.dart'; -import 'package:smooth_app/pages/preferences/user_preferences_page.dart'; - -class UserPreferencesUserLists extends AbstractUserPreferences { - UserPreferencesUserLists({ - required final Function(Function()) setState, - required final BuildContext context, - required final UserPreferences userPreferences, - required final AppLocalizations appLocalizations, - required final ThemeData themeData, - }) : super( - setState: setState, - context: context, - userPreferences: userPreferences, - appLocalizations: appLocalizations, - themeData: themeData, - ); - - @override - List getBody() { - return []; - } - - @override - PreferencePageType? getPreferencePageType() => PreferencePageType.LISTS; - - @override - Widget? getSubtitle() => null; - - @override - String getTitleString() => appLocalizations.user_list_all_title; - - @override - IconData getLeadingIconData() => Icons.playlist_add_check; - - @override - Future runHeaderAction() => Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => const AllUserProductList(), - ), - ); -} diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-amoled.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-amoled.png index 488de4e5eb6..a73a0a900f3 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-amoled.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-amoled.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-dark.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-dark.png index 68131ffeef6..7362a23806e 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-dark.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-dark.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-light.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-light.png index e274c25004f..f040a129d5a 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-light.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Improving-light.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-amoled.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-amoled.png index 509f14dace7..c9745182b80 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-amoled.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-amoled.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-dark.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-dark.png index 5fe2213b6ca..781019430e0 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-dark.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-dark.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-light.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-light.png index 92c69f87716..2f7613f2fb3 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-light.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Software development-light.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-amoled.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-amoled.png index e8cd7186650..7ce2d0226b0 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-amoled.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-amoled.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-dark.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-dark.png index be2b4dcc531..7c7bf6da659 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-dark.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-dark.png differ diff --git a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-light.png b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-light.png index da6afb5aa96..409766f0df3 100644 Binary files a/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-light.png and b/packages/smooth_app/test/dialogs/generic_lib/goldens/user_preferences_page_dialogs_Translate-light.png differ diff --git a/packages/smooth_app/test/pages/goldens/user_preferences_page-amoled.png b/packages/smooth_app/test/pages/goldens/user_preferences_page-amoled.png index aa928f55ca8..3d17eb3f0e3 100644 Binary files a/packages/smooth_app/test/pages/goldens/user_preferences_page-amoled.png and b/packages/smooth_app/test/pages/goldens/user_preferences_page-amoled.png differ diff --git a/packages/smooth_app/test/pages/goldens/user_preferences_page-dark.png b/packages/smooth_app/test/pages/goldens/user_preferences_page-dark.png index a59b64ac99c..98c3d9f01a8 100644 Binary files a/packages/smooth_app/test/pages/goldens/user_preferences_page-dark.png and b/packages/smooth_app/test/pages/goldens/user_preferences_page-dark.png differ diff --git a/packages/smooth_app/test/pages/goldens/user_preferences_page-light.png b/packages/smooth_app/test/pages/goldens/user_preferences_page-light.png index 13c4e4efc64..80dec683e09 100644 Binary files a/packages/smooth_app/test/pages/goldens/user_preferences_page-light.png and b/packages/smooth_app/test/pages/goldens/user_preferences_page-light.png differ diff --git a/packages/smooth_app/test/users/goldens/login_page-dark.png b/packages/smooth_app/test/users/goldens/login_page-dark.png index 39fadc9d20a..a132476bd9c 100644 Binary files a/packages/smooth_app/test/users/goldens/login_page-dark.png and b/packages/smooth_app/test/users/goldens/login_page-dark.png differ diff --git a/packages/smooth_app/test/users/goldens/login_page-light.png b/packages/smooth_app/test/users/goldens/login_page-light.png index 39ec4b740d5..494960258aa 100644 Binary files a/packages/smooth_app/test/users/goldens/login_page-light.png and b/packages/smooth_app/test/users/goldens/login_page-light.png differ diff --git a/packages/smooth_app/test/users/goldens/signup_page-dark.png b/packages/smooth_app/test/users/goldens/signup_page-dark.png index 0c898098c81..a1723737423 100644 Binary files a/packages/smooth_app/test/users/goldens/signup_page-dark.png and b/packages/smooth_app/test/users/goldens/signup_page-dark.png differ diff --git a/packages/smooth_app/test/users/goldens/signup_page-light.png b/packages/smooth_app/test/users/goldens/signup_page-light.png index f33dc72fa02..25d4be9e9cc 100644 Binary files a/packages/smooth_app/test/users/goldens/signup_page-light.png and b/packages/smooth_app/test/users/goldens/signup_page-light.png differ