Provider Throw Errors in InitState. Provider.of(context)

后端 未结 3 472
说谎
说谎 2021-01-28 05:34

How do I access the context for the Provider in the initState

I keep getting the error

flutter: The following assertion was thrown building Builder:
fl         


        
3条回答
  •  自闭症患者
    2021-01-28 06:14

    Use Simon's AfterLayout package https://pub.dev/packages/after_layout and call it in the function you need to implement. It will be called after Build() has been run

提交回复
热议问题