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

后端 未结 3 432
说谎
说谎 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:08

    Provider.of(context, listen: false).selectedProduct and ensure there are no NotifyListeners in the initState call.

提交回复
热议问题