I have an app, when the user clicks on the login button, the user’s information is sent to the profile page after verifying the identity.
Well, no problem so far
The problem is when I use this profile class in several other places and I have to pass parameters to those classes as well.
What is the solution?
Thankful
2
Answers
InheritedWidget could be used for this. Or you could use a more advanced state management solution like Bloc or Riverpod
Here are 2 ways to accomplish what you’re looking for:
profile.dart
file, with global variables to store all the information you need. Then for any other page that needs this info, you can useimport "profile.dart"
.class
. That way, you only need to pass 1 extra parameter when the profile info is needed.