So in my view I am fetching data whenever it inits.
@override
void initState() {
super.initState();
context.read<UseAuth>().fetchUserInfo();
}
After I display data in my app like context.watch<UseAuth>().getNick then it's all fine, however I have a drawer here as well and in that drawer I display context.watch<UseAuth>().getAvatar.
The drawer is in same widget.
But when I open the drawer, I don't see the avatar for like a 1-2 seconds. I am not sure why this is happening?
Both are getters in my provider file, nick load instantly.
String? get getNick => _userData?.nick;
String? get getAvatar => _userData?.avatar_url;
I am using this in the drawer
child: Image.network('${context.watch<UseAuth>().getAvatar}'),. Should the image not be loaded already because drawer is in same Widget? Can this be happening because the Image.network?
Can I force this Image.network to load whenever the widget is loaded b efore opening the drawer?