nubank / nuvigator

A powerful routing abstraction over Flutter Navigator, with nested Navigator and Deeplinks
Apache License 2.0
275 stars 33 forks source link

Fix NuRouteLoader by caching the NuRouter instead of the Widget #95

Closed leoiacovini closed 2 years ago

leoiacovini commented 2 years ago

The last change that allowed to disable the rebuilds of Nuvigators on certain conditions highlighted a few problems with the current approach of caching the Nuvigator instance, which could cause the App to become non-responsive to other external state changes that should trigger a re-render of the Widget.

This PR aims to fix that by instead caching in the state of the NuRoute instance, and always providing it to the builder function.