From 09a48cd2dcaf70718433a42f6bb0effee9fcfe26 Mon Sep 17 00:00:00 2001 From: Jordan Nnabugwu Date: Wed, 5 Jun 2024 20:09:57 -0400 Subject: [PATCH 1/5] feat: added deeplinking to forgot password page --- .../lib/pages/navigator/app_navigator.dart | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index 8016d313cb2..765876d7700 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -19,6 +19,7 @@ import 'package:smooth_app/pages/product/new_product_page.dart'; import 'package:smooth_app/pages/product/product_loader_page.dart'; import 'package:smooth_app/pages/scan/search_page.dart'; import 'package:smooth_app/pages/scan/search_product_helper.dart'; +import 'package:smooth_app/pages/user_management/forgot_password_page.dart'; import 'package:smooth_app/query/product_query.dart'; /// A replacement for the [Navigator], where we internally use [GoRouter]. @@ -221,6 +222,11 @@ class _SmoothGoRouter { } }, ), + GoRoute( + path: _InternalAppRoutes.FORGOT_PASSWORD_PAGE, + builder:(_, __) => const ForgotPasswordPage(), + ), + GoRoute( path: _InternalAppRoutes.EXTERNAL_PAGE, builder: (BuildContext context, GoRouterState state) { @@ -276,7 +282,10 @@ class _SmoothGoRouter { } } else if (path == _ExternalRoutes.MOBILE_APP_DOWNLOAD) { return AppRoutes.HOME; - } else if (path == _ExternalRoutes.GUIDE_NUTRISCORE_V2) { + } else if (path == _ExternalRoutes.FORGOT_PASSWORD){ + return AppRoutes.FORGOT_PASSWORD; + } + else if (path == _ExternalRoutes.GUIDE_NUTRISCORE_V2) { return AppRoutes.GUIDE_NUTRISCORE_V2; } else if (path != _InternalAppRoutes.HOME_PAGE) { externalLink = true; @@ -387,6 +396,7 @@ class _InternalAppRoutes { static const String PREFERENCES_PAGE = '_preferences'; static const String SEARCH_PAGE = '_search'; static const String EXTERNAL_PAGE = '_external'; + static const String FORGOT_PASSWORD_PAGE = '_forgot_password'; static const String _GUIDES = '_guides'; static const String GUIDE_NUTRISCORE_V2_PAGE = '_nutriscore-v2'; @@ -396,6 +406,7 @@ class _ExternalRoutes { static const String MOBILE_APP_DOWNLOAD = '/open-food-facts-mobile-app'; static const String PRODUCT_EDITION = '/cgi/product.pl'; static const String GUIDE_NUTRISCORE_V2 = '/nutriscore-v2'; + static const String FORGOT_PASSWORD = '/forgot-password'; } /// A list of internal routes to use with [AppNavigator] @@ -440,6 +451,9 @@ class AppRoutes { static String get GUIDE_NUTRISCORE_V2 => '/${_InternalAppRoutes._GUIDES}/${_InternalAppRoutes.GUIDE_NUTRISCORE_V2_PAGE}'; + static String get FORGOT_PASSWORD => + '/${_InternalAppRoutes.FORGOT_PASSWORD_PAGE}'; + // Open an external link (where path is relative to the OFF website) static String EXTERNAL(String path) => '/${_InternalAppRoutes.EXTERNAL_PAGE}/?path=$path'; From 8f528a3bd270f789af657063d65f0404dbfc33b5 Mon Sep 17 00:00:00 2001 From: Jordan Nnabugwu Date: Mon, 10 Jun 2024 19:56:05 -0400 Subject: [PATCH 2/5] fix: fix merge conflicts --- packages/smooth_app/lib/pages/navigator/app_navigator.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index 3cfa57364eb..0fcde3c364e 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -416,6 +416,8 @@ class _ExternalRoutes { static const String MOBILE_APP_DOWNLOAD = '/open-food-facts-mobile-app'; static const String PRODUCT_EDITION = '/cgi/product.pl'; static const String GUIDE_NUTRISCORE_V2 = '/nutriscore-v2'; + static const String SIGNUP = '/signup'; + static const String FORGOT_PASSWORD = '/forgot-password'; } /// A list of internal routes to use with [AppNavigator] From 07d551103dfbe89258c69d28ad5234f649b24abd Mon Sep 17 00:00:00 2001 From: Jordan Nnabugwu Date: Mon, 1 Jul 2024 19:39:29 -0400 Subject: [PATCH 3/5] fix: formatted app navigator page --- .../lib/pages/navigator/app_navigator.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index 0fcde3c364e..0f96da18859 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -226,9 +226,8 @@ class _SmoothGoRouter { ), GoRoute( path: _InternalAppRoutes.FORGOT_PASSWORD_PAGE, - builder:(_, __) => const ForgotPasswordPage(), - ), - + builder: (_, __) => const ForgotPasswordPage(), + ), GoRoute( path: _InternalAppRoutes.EXTERNAL_PAGE, builder: (BuildContext context, GoRouterState state) { @@ -288,10 +287,9 @@ class _SmoothGoRouter { } } else if (path == _ExternalRoutes.MOBILE_APP_DOWNLOAD) { return AppRoutes.HOME; - } else if (path == _ExternalRoutes.FORGOT_PASSWORD){ + } else if (path == _ExternalRoutes.FORGOT_PASSWORD) { return AppRoutes.FORGOT_PASSWORD; - } - else if (path == _ExternalRoutes.GUIDE_NUTRISCORE_V2) { + } else if (path == _ExternalRoutes.GUIDE_NUTRISCORE_V2) { return AppRoutes.GUIDE_NUTRISCORE_V2; } else if (path == _ExternalRoutes.SIGNUP) { return AppRoutes.SIGNUP; @@ -463,7 +461,7 @@ class AppRoutes { '/${_InternalAppRoutes._GUIDES}/${_InternalAppRoutes.GUIDE_NUTRISCORE_V2_PAGE}'; static String get SIGNUP => '/${_InternalAppRoutes.SIGNUP_PAGE}'; - static String get FORGOT_PASSWORD => + static String get FORGOT_PASSWORD => '/${_InternalAppRoutes.FORGOT_PASSWORD_PAGE}'; // Open an external link (where path is relative to the OFF website) From 29973d27fb599c1466b3c340ced589260448130f Mon Sep 17 00:00:00 2001 From: Jordan Nnabugwu Date: Tue, 2 Jul 2024 12:40:28 -0400 Subject: [PATCH 4/5] fix: organized imports --- packages/smooth_app/lib/pages/navigator/app_navigator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index 0f96da18859..b242b7449c9 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -20,8 +20,8 @@ import 'package:smooth_app/pages/product/new_product_page.dart'; import 'package:smooth_app/pages/product/product_loader_page.dart'; import 'package:smooth_app/pages/scan/search_page.dart'; import 'package:smooth_app/pages/scan/search_product_helper.dart'; -import 'package:smooth_app/pages/user_management/sign_up_page.dart'; import 'package:smooth_app/pages/user_management/forgot_password_page.dart'; +import 'package:smooth_app/pages/user_management/sign_up_page.dart'; import 'package:smooth_app/query/product_query.dart'; /// A replacement for the [Navigator], where we internally use [GoRouter]. From f357c8e7f231c4cbb0b3175e5ca74444739debc4 Mon Sep 17 00:00:00 2001 From: Jordan Nnabugwu Date: Wed, 6 Nov 2024 13:23:47 -0600 Subject: [PATCH 5/5] fix: moving forgot_password after signup --- packages/smooth_app/lib/pages/navigator/app_navigator.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index fb9f852c025..5f72c2cc73a 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -287,12 +287,12 @@ class _SmoothGoRouter { } } else if (path == _ExternalRoutes.MOBILE_APP_DOWNLOAD) { return AppRoutes.HOME; - } else if (path == _ExternalRoutes.FORGOT_PASSWORD) { - return AppRoutes.FORGOT_PASSWORD; } else if (path == _ExternalRoutes.GUIDE_NUTRISCORE_V2) { return AppRoutes.GUIDE_NUTRISCORE_V2; } else if (path == _ExternalRoutes.SIGNUP) { return AppRoutes.SIGNUP; + } else if (path == _ExternalRoutes.FORGOT_PASSWORD) { + return AppRoutes.FORGOT_PASSWORD; } else if (path != _InternalAppRoutes.HOME_PAGE) { externalLink = true; }