Currently I am getting currentUser on each flutter screen as follows:
FirebaseUser user = await FirebaseAuth.instance.currentUser();
Is there a way to just do this once and save data in some form of global variable which can be accessed on all screens. In django we have session object. Is there a equivalent in flutter. Not sure if getting currentuser on each screen is a flutter way of doing things. If so do I create an async func and call it on each screen.
I do same thing with FirebaseStorage
and Firestore
.
thanks