Merge pull request #1110 from abarth/widgets_back

Move default back behavior to FlutterWidgetBinding
This commit is contained in:
Adam Barth 2016-01-07 10:59:03 -08:00
commit dfcc0c71ba
2 changed files with 5 additions and 4 deletions

View File

@ -86,11 +86,11 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
assert(mounted);
NavigatorState navigator = _navigator.currentState;
assert(navigator != null);
bool result = false;
navigator.openTransaction((NavigatorTransaction transaction) {
if (!transaction.pop())
activity.finishCurrentActivity();
result = transaction.pop();
});
return true;
return result;
}
void didChangeSize(Size size) => setState(() { _size = size; });

View File

@ -77,8 +77,9 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Rendere
void handlePopRoute() {
for (BindingObserver observer in _observers) {
if (observer.didPopRoute())
break;
return;
}
activity.finishCurrentActivity();
}
void handleAppLifecycleStateChanged(ui.AppLifecycleState state) {