Commit a0d65729 authored by Hixie's avatar Hixie

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.
parent 1d16ebff
......@@ -145,7 +145,7 @@ class Navigator extends StatefulComponent {
static bool canPop(BuildContext context) {
NavigatorState navigator = context.ancestorStateOfType(NavigatorState);
return navigator.canPop();
return navigator != null && navigator.canPop();
}
static void popAndPushNamed(BuildContext context, String routeName, { Set<Key> mostValuableKeys }) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment