diff --git a/packages/smooth_app/lib/cards/data_cards/image_upload_card.dart b/packages/smooth_app/lib/cards/data_cards/image_upload_card.dart index 6870e23543a..b6824fb3d7f 100644 --- a/packages/smooth_app/lib/cards/data_cards/image_upload_card.dart +++ b/packages/smooth_app/lib/cards/data_cards/image_upload_card.dart @@ -127,6 +127,7 @@ class _ImageUploadCardState extends State { _imageFullProvider = NetworkImage(imageFullUrl); } + // TODO(monsieurtanuki): careful, waiting for pop'ed value final bool? refreshed = await Navigator.push( context, MaterialPageRoute( diff --git a/packages/smooth_app/lib/cards/product_cards/product_title_card.dart b/packages/smooth_app/lib/cards/product_cards/product_title_card.dart index ab45e639bed..a74f6706919 100644 --- a/packages/smooth_app/lib/cards/product_cards/product_title_card.dart +++ b/packages/smooth_app/lib/cards/product_cards/product_title_card.dart @@ -52,9 +52,9 @@ class ProductTitleCard extends StatelessWidget { onTap: (getProductName(product, appLocalizations) == appLocalizations.unknownProductName) ? () async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => AddBasicDetailsPage(product), ), diff --git a/packages/smooth_app/lib/cards/product_cards/smooth_product_card_found.dart b/packages/smooth_app/lib/cards/product_cards/smooth_product_card_found.dart index f305162e987..1019e77675c 100644 --- a/packages/smooth_app/lib/cards/product_cards/smooth_product_card_found.dart +++ b/packages/smooth_app/lib/cards/product_cards/smooth_product_card_found.dart @@ -62,9 +62,9 @@ class SmoothProductCardFound extends StatelessWidget { borderRadius: ROUNDED_BORDER_RADIUS, onTap: onTap ?? () async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => ProductPage(product), ), ); diff --git a/packages/smooth_app/lib/cards/product_cards/smooth_product_card_not_found.dart b/packages/smooth_app/lib/cards/product_cards/smooth_product_card_not_found.dart index 41e1e2bb22c..aac9461b59c 100644 --- a/packages/smooth_app/lib/cards/product_cards/smooth_product_card_not_found.dart +++ b/packages/smooth_app/lib/cards/product_cards/smooth_product_card_not_found.dart @@ -59,6 +59,7 @@ class SmoothProductCardNotFound extends StatelessWidget { icon: Icons.add, padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE), onPressed: () async { + // TODO(monsieurtanuki): careful, waiting for pop'ed value final String? result = await Navigator.push( context, MaterialPageRoute( diff --git a/packages/smooth_app/lib/pages/product/add_category_button.dart b/packages/smooth_app/lib/pages/product/add_category_button.dart index 0e58ee88a1f..8de4dac7954 100644 --- a/packages/smooth_app/lib/pages/product/add_category_button.dart +++ b/packages/smooth_app/lib/pages/product/add_category_button.dart @@ -19,9 +19,9 @@ class AddCategoryButton extends StatelessWidget { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => SimpleInputPage( helper: SimpleInputPageCategoryHelper(), product: product, diff --git a/packages/smooth_app/lib/pages/product/add_ingredients_button.dart b/packages/smooth_app/lib/pages/product/add_ingredients_button.dart index 77e76d2bfcc..1681cef62b5 100644 --- a/packages/smooth_app/lib/pages/product/add_ingredients_button.dart +++ b/packages/smooth_app/lib/pages/product/add_ingredients_button.dart @@ -19,9 +19,9 @@ class AddIngredientsButton extends StatelessWidget { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => EditOcrPage( product: product, helper: OcrIngredientsHelper(), diff --git a/packages/smooth_app/lib/pages/product/add_new_product_page.dart b/packages/smooth_app/lib/pages/product/add_new_product_page.dart index 7a0e7f115a2..b4e4bf38b61 100644 --- a/packages/smooth_app/lib/pages/product/add_new_product_page.dart +++ b/packages/smooth_app/lib/pages/product/add_new_product_page.dart @@ -140,6 +140,7 @@ class _AddNewProductPageState extends State { } // Photo can change in the ConfirmAndUploadPicture widget, the user // may choose to retake the image. + // TODO(monsieurtanuki): careful, waiting for pop'ed value //ignore: use_build_context_synchronously final File? finalPhoto = await Navigator.push( context, @@ -269,6 +270,7 @@ class _AddNewProductPageState extends State { if (!mounted) { return; } + // TODO(monsieurtanuki): careful, waiting for pop'ed value final Product? result = await Navigator.push( context, MaterialPageRoute( @@ -319,6 +321,8 @@ class _AddNewProductPageState extends State { text: AppLocalizations.of(context).completed_basic_details_btn_text, icon: Icons.edit, onPressed: () async { + // TODO(monsieurtanuki): probably wrong as AddBasicDetailsPage pops nothing + // TODO(monsieurtanuki): careful, waiting for pop'ed value final Product? result = await Navigator.push( context, MaterialPageRoute( diff --git a/packages/smooth_app/lib/pages/product/add_nutrition_button.dart b/packages/smooth_app/lib/pages/product/add_nutrition_button.dart index bd496903207..0132f6e3225 100644 --- a/packages/smooth_app/lib/pages/product/add_nutrition_button.dart +++ b/packages/smooth_app/lib/pages/product/add_nutrition_button.dart @@ -32,9 +32,9 @@ class _AddNutritionButtonState extends State { if (!mounted) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => NutritionPageLoaded( widget.product, cache.orderedNutrients, 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 8dadf2020c7..3edf28edec3 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 @@ -412,9 +412,9 @@ class _ProductListPageState extends State if (!mounted) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => PersonalizedRankingPage( barcodes: list, diff --git a/packages/smooth_app/lib/pages/product/edit_ingredients_page.dart b/packages/smooth_app/lib/pages/product/edit_ingredients_page.dart index 8958c335908..115620c1fef 100644 --- a/packages/smooth_app/lib/pages/product/edit_ingredients_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_ingredients_page.dart @@ -335,7 +335,7 @@ class _OcrWidget extends StatelessWidget { onPressed: () async { await onSubmitField(); //ignore: use_build_context_synchronously - Navigator.pop(context, product); + Navigator.pop(context); }, ), ), 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 b45ddce66e0..7bd82602d5b 100644 --- a/packages/smooth_app/lib/pages/product/edit_product_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_product_page.dart @@ -142,9 +142,9 @@ class _EditProductPageState extends State { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (_) => AddBasicDetailsPage(_product), ), ); @@ -161,6 +161,7 @@ class _EditProductPageState extends State { } final List allProductImagesData = getAllProductImagesData(_product, appLocalizations); + // TODO(monsieurtanuki): careful, waiting for pop'ed value final bool? refreshed = await Navigator.push( context, MaterialPageRoute( @@ -210,9 +211,9 @@ class _EditProductPageState extends State { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => EditOcrPage( product: _product, helper: OcrIngredientsHelper(), @@ -241,9 +242,9 @@ class _EditProductPageState extends State { if (!mounted) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => NutritionPageLoaded( _product, @@ -262,9 +263,9 @@ class _EditProductPageState extends State { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => EditOcrPage( product: _product, helper: OcrPackagingHelper(), @@ -296,9 +297,9 @@ class _EditProductPageState extends State { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => SimpleInputPage( helper: helper, product: _product, @@ -344,9 +345,9 @@ class _EditProductPageState extends State { if (!await ProductRefresher().checkIfLoggedIn(context)) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => SimpleInputPage.multiple( helpers: helpers, product: _product, 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 df9d3b3baf8..79f8ed64652 100644 --- a/packages/smooth_app/lib/pages/product/new_product_page.dart +++ b/packages/smooth_app/lib/pages/product/new_product_page.dart @@ -300,9 +300,9 @@ class _ProductPageState extends State with TraceableClientMixin { _buildActionBarItem( Icons.edit, appLocalizations.edit_product_label, - () async => Navigator.push( + () async => Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => EditProductPage(_product), ), ), diff --git a/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart b/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart index ba0c04407dd..cbddded424e 100644 --- a/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart +++ b/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart @@ -331,6 +331,7 @@ class _ProductImageGalleryViewState extends State { return; } + // TODO(monsieurtanuki): careful, waiting for pop'ed value // ignore: use_build_context_synchronously final File? photoUploaded = await Navigator.push( context, diff --git a/packages/smooth_app/lib/pages/product/summary_card.dart b/packages/smooth_app/lib/pages/product/summary_card.dart index 2cbed6021e5..6ef65a20bb7 100644 --- a/packages/smooth_app/lib/pages/product/summary_card.dart +++ b/packages/smooth_app/lib/pages/product/summary_card.dart @@ -321,9 +321,9 @@ class _SummaryCardState extends State { addPanelButton( localizations.completed_basic_details_btn_text, onPressed: () async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => AddBasicDetailsPage(_product), ), @@ -433,9 +433,9 @@ class _SummaryCardState extends State { InkWell( borderRadius: const BorderRadius.only(topRight: ROUNDED_RADIUS), onTap: widget.isSettingClickable - ? () async => Navigator.push( + ? () async => Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => const UserPreferencesPage( type: PreferencePageType.FOOD, @@ -621,9 +621,9 @@ class _SummaryCardState extends State { if (questions.isNotEmpty && !_annotationVoted) { return InkWell( onTap: () async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => QuestionPage( product: _product, questions: questions, @@ -740,9 +740,9 @@ class _SummaryCardState extends State { final KnowledgePanelPanelGroupElement? group = KnowledgePanelGroupCard.groupElementOf(context); - Navigator.push( + Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => KnowledgePanelPage( groupElement: group, panel: knowledgePanel, diff --git a/packages/smooth_app/lib/pages/question_page.dart b/packages/smooth_app/lib/pages/question_page.dart index f6a0711a923..b9c6decdc90 100644 --- a/packages/smooth_app/lib/pages/question_page.dart +++ b/packages/smooth_app/lib/pages/question_page.dart @@ -424,9 +424,9 @@ class CongratsWidget extends StatelessWidget { action: SmoothActionButton( text: appLocalizations.sign_in, onPressed: () async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (_) => const LoginPage(), ), ); diff --git a/packages/smooth_app/lib/pages/scan/scan_header.dart b/packages/smooth_app/lib/pages/scan/scan_header.dart index 731adf8b967..6cbcff5abf9 100644 --- a/packages/smooth_app/lib/pages/scan/scan_header.dart +++ b/packages/smooth_app/lib/pages/scan/scan_header.dart @@ -72,9 +72,9 @@ class _ScanHeaderState extends State { if (!mounted) { return; } - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => PersonalizedRankingPage( barcodes: model.productList.barcodes, diff --git a/packages/smooth_app/lib/pages/scan/scan_product_card.dart b/packages/smooth_app/lib/pages/scan/scan_product_card.dart index a404f32b105..ffa95411536 100644 --- a/packages/smooth_app/lib/pages/scan/scan_product_card.dart +++ b/packages/smooth_app/lib/pages/scan/scan_product_card.dart @@ -34,9 +34,9 @@ class ScanProductCard extends StatelessWidget { } Future _openProductPage(BuildContext context) async { - await Navigator.push( + await Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => ProductPage(product), ), ); diff --git a/packages/smooth_app/lib/pages/user_management/login_page.dart b/packages/smooth_app/lib/pages/user_management/login_page.dart index 33dac8da0b8..3e8c4a87d23 100644 --- a/packages/smooth_app/lib/pages/user_management/login_page.dart +++ b/packages/smooth_app/lib/pages/user_management/login_page.dart @@ -250,7 +250,7 @@ class _LoginPageState extends State with TraceableClientMixin { onPressed: () { Navigator.push( context, - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => const ForgotPasswordPage(), ), @@ -274,6 +274,8 @@ class _LoginPageState extends State with TraceableClientMixin { height: size.height * 0.06, child: OutlinedButton( onPressed: () async { + // TODO(monsieurtanuki): we probably don't need the returned value and could check the "logged in?" question differently + // TODO(monsieurtanuki): careful, waiting for pop'ed value final bool? registered = await Navigator.push( context, MaterialPageRoute(