Make Navigator.canPop handle the no-navigator case
Scaffold calls this to see if it should show a back arrow when there's no drawer. With this change, everything continues to work. Fixes styled_text and probably others.
This commit is contained in:
parent
1d16ebff05
commit
a0d6572977
@ -145,7 +145,7 @@ class Navigator extends StatefulComponent {
|
|||||||
|
|
||||||
static bool canPop(BuildContext context) {
|
static bool canPop(BuildContext context) {
|
||||||
NavigatorState navigator = context.ancestorStateOfType(NavigatorState);
|
NavigatorState navigator = context.ancestorStateOfType(NavigatorState);
|
||||||
return navigator.canPop();
|
return navigator != null && navigator.canPop();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void popAndPushNamed(BuildContext context, String routeName, { Set<Key> mostValuableKeys }) {
|
static void popAndPushNamed(BuildContext context, String routeName, { Set<Key> mostValuableKeys }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user