How to access Provided (Provider.of()) value inside showModalBottomSheet?

前端 未结 5 1462
长情又很酷
长情又很酷 2021-01-01 23:50

I have a FloatingActionButton inside a widget tree which has a BlocProvider from flutter_bloc. Something like this:

BlocProvider(
  builder: (co         


        
5条回答
  •  伪装坚强ぢ
    2021-01-02 00:14

    You need move Provider to top layer(MaterialApp)

    According to picture, Dialog widget is under MaterialApp, so this is why you using wrong context

提交回复
热议问题