Commit dfcc0c71 authored by Adam Barth's avatar Adam Barth

Merge pull request #1110 from abarth/widgets_back

Move default back behavior to FlutterWidgetBinding
parents c44f0a57 e3d587ea
...@@ -86,11 +86,11 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver { ...@@ -86,11 +86,11 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
assert(mounted); assert(mounted);
NavigatorState navigator = _navigator.currentState; NavigatorState navigator = _navigator.currentState;
assert(navigator != null); assert(navigator != null);
bool result = false;
navigator.openTransaction((NavigatorTransaction transaction) { navigator.openTransaction((NavigatorTransaction transaction) {
if (!transaction.pop()) result = transaction.pop();
activity.finishCurrentActivity();
}); });
return true; return result;
} }
void didChangeSize(Size size) => setState(() { _size = size; }); void didChangeSize(Size size) => setState(() { _size = size; });
......
...@@ -77,8 +77,9 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Rendere ...@@ -77,8 +77,9 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Rendere
void handlePopRoute() { void handlePopRoute() {
for (BindingObserver observer in _observers) { for (BindingObserver observer in _observers) {
if (observer.didPopRoute()) if (observer.didPopRoute())
break; return;
} }
activity.finishCurrentActivity();
} }
void handleAppLifecycleStateChanged(ui.AppLifecycleState state) { void handleAppLifecycleStateChanged(ui.AppLifecycleState state) {
......
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