how to use initstate with provider in flutter code example
Example 1: initstate flutter
@override
void initState() {
super.initState();
///whatever you want to run on page build
}
Example 2: flutter call provider in initstate
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
auth = Provider.of<Auth>(context, listen: false);
});
}