brianegan / flutter_redux

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

How to not accept change notifications when the Router is not at the top level, and then take the initiative to obtain the changes when the Router returns to the top level #223

Closed anatta-feng closed 2 years ago

anatta-feng commented 2 years ago

This may improve performance and is more suitable for certain business scenarios

brianegan commented 2 years ago

I haven't done this myself since I haven't measured any severe performance impacts in my own apps, but you could set maintainState property to false when navigating between routes. This has some caveats, of course, but as long as you're aware of them it could help out.

https://api.flutter.dev/flutter/widgets/ModalRoute/maintainState.html