Answers for "how to use initstate with provider in flutter"

5

initstate flutter

@override
  void initState() {
    super.initState();
///whatever you want to run on page build
  }
Posted by: Guest on January-04-2021
0

flutter call provider in initstate

@override
void initState() {
    super.initState();

    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      auth = Provider.of<Auth>(context, listen: false);
    });
}
Posted by: Guest on April-19-2021

Code answers related to "how to use initstate with provider in flutter"

Browse Popular Code Answers by Language