More Strict Assertions in the Navigator and the Hero Controller Scope

Summary

Context

Description of change

Migration guide

Timeline

References

Summary

The framework throws an assertion error when it detects there are
multiple navigators registered with one hero controller scope.

Context

The hero controller scope hosts a hero controller for its widget
subtree. The hero controller can only support one navigator at
a time. Previously, there was no assertion to guarantee that.

Description of change

If the code starts throwing assertion errors after this change,
it means the code was already broken even before this change.
Multiple navigators may be registered under the same hero
controller scope, and they can not trigger hero animations when
their route changes. This change only surfaced this problem.

Migration guide

An example application that starts to throw exceptions.

import