-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added deeplinking for the sign up page #4169 #5332
Changes from 3 commits
c0e6ab1
bb1462c
da71ec5
4e10b34
0553eb3
ed7215b
a4b4d5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | |
import 'package:matomo_tracker/matomo_tracker.dart'; | ||
import 'package:openfoodfacts/openfoodfacts.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:smooth_app/data_models/preferences/user_preferences.dart'; | ||
import 'package:smooth_app/data_models/user_management_provider.dart'; | ||
import 'package:smooth_app/generic_lib/design_constants.dart'; | ||
import 'package:smooth_app/generic_lib/dialogs/smooth_alert_dialog.dart'; | ||
|
@@ -46,8 +47,20 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin { | |
bool _subscribe = false; | ||
bool _disagreed = false; | ||
|
||
late UserPreferences _userPreferences; | ||
|
||
@override | ||
String get actionName => 'Opened sign_up_page'; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
getUserPreferences(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be careful about formatting your code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Launch the |
||
} | ||
|
||
Future<void> getUserPreferences() async { | ||
_userPreferences = await UserPreferences.getUserPreferences(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
@@ -314,6 +327,7 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin { | |
} | ||
|
||
Future<void> _signUp() async { | ||
///add and make complete onboarding false at signup. | ||
final AppLocalizations appLocalisations = AppLocalizations.of(context); | ||
_disagreed = !_agree; | ||
setState(() {}); | ||
|
@@ -411,6 +425,8 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin { | |
if (!mounted) { | ||
return; | ||
} | ||
debugPrint('Reseting Onboarding'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For debugging purposes, you have our custom |
||
_userPreferences.resetOnboarding(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just get the preferences here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
await showDialog<void>( | ||
context: context, | ||
builder: (BuildContext context) => SmoothAlertDialog( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserPreferences
is only used after a successful registration.For all other scenarios, it's totally unnecessary.
Instead, you just need to access the preferences when you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay I see what you are saying