davidmarne / flutter_built_redux

Built_redux provider for Flutter.
MIT License
77 stars 23 forks source link

Example of using the Navigator #33

Open mfulgo opened 6 years ago

mfulgo commented 6 years ago

As referenced in davidmarne/built_redux/issues/92, it would be nice to have an easy to find, canonical example of how to use the navigator when working in Flutter with built_redux.

This information could either be included in documentation or incorporated into the example code.

smiLLe commented 5 years ago

what i am doing is to give a callback into my middleware through the payload.

somewhere in my middleware i am doing sth like this: action.payload.onSuccess();

and i dispatch my actions like this: actions.foo(Payload(onSuccess: () { if (mounted) { Navigator.of(context).pop(); }));