You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I require name and email for the sendFeedback function. So it is necessary that just after the user logs in the the profile data should get saved in the sharedPreferences.
Basically we need to shift the getProfile function to menu.dart and save the response recieved in shared Preferences.
Its better to move it to splash screen. In there, if the user is logged in, we can call the get_user_details api then and there. We can use provider to convey the User model object. But then cubit for profile will be useless.
Think what you can do and lemme know.
I guess as the user logs in we should call the getUserProfile that's a better approach according to me? What say?
That should be the case when he's not logged in already. See, do this
in splash screen:
If user is logged in
get_user_details
redirect to homescreen
else
redirect to loginscreen:
when user logs in:
get_user_details
redirect to homescreen
ToDo:
Remove ProfileCubit
In SplashScreen, handle the api call directly and in LoginScreen, add it to the cubit
add a Provider with User model just before the HomeScreen (whenever you redirect to homescreen, as you did for cubits)
Get the User model using Provider.of<User>(context, listener: false) in the ProfileScreen
Describe the bug
I require
name
andemail
for the sendFeedback function. So it is necessary that just after the user logs in the the profile data should get saved in the sharedPreferences.Basically we need to shift the getProfile function to menu.dart and save the response recieved in shared Preferences.
@werainkhatri sir! What say on this?
The text was updated successfully, but these errors were encountered: