use provider inside initstate
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
auth = Provider.of<Auth>(context, listen: false);
});
}
################ OR
@override
void initState() {
super.initState();
Future.delayed(Duration.zero,() {
//Do your stuff here
});
}