Is there a way to load async data on InitState method?

前端 未结 9 1566
你的背包
你的背包 2020-12-05 16:39

I\'m a looking for a way to load async data on InitState method, I need some data before build method runs. I\'m using a GoogleAuth code, and I need to execute build method

9条回答
  •  余生分开走
    2020-12-05 17:25

    Sweet and Short :

    (() async { await your_method(); setState(() {....anything here}); })();

提交回复
热议问题