flutter_built_redux icon indicating copy to clipboard operation
flutter_built_redux copied to clipboard

Unsubscribe to state when not active route?

Open martinory opened this issue 5 years ago • 1 comments

Hi!

I changed the formulation of the problem.

When navigating to a new page, the previous page in the router stack still subscribes to the state which results in unnecessary rebuilds which affect performance.

Is there a way to only subscribe to the state if it is the active one in the router stack?

martinory avatar Jun 11 '19 14:06 martinory

@martinory can't you just use a Route Observer to do the unsubscribing?

https://master-api.flutter.dev/flutter/widgets/RouteObserver-class.html

abacaj avatar Dec 30 '19 18:12 abacaj