brianegan / flutter_redux

A library that connects Widgets to a Redux Store
MIT License
1.65k stars 217 forks source link

Is there a way of calling StoreProvider without context #192

Closed Linspirit98 closed 3 years ago

Linspirit98 commented 4 years ago

Hi I am using WebsocketProvider and I need to call StoreProvider but there's no context in storeprovider. I tried using a global variable for context that i created in app.dart but it didn't work. Hope to hear from you soon!

sumitkakshapati commented 3 years ago

Use can use navigation key in the material widget. than u can get context from that navigation key. I have used like this in my app to navigate,for provider and for bloc to use without context. I hav not used with redux but i should work.

you can get context from navigationkey in this way. _navigatorKey.currentState.overlay.context;

brianegan commented 3 years ago

Would it be possible to just pass the Store instance to the Websocket provider? The StoreProvider is built to provide access to Widgets that have a context.