From 75c07ef1a6db411ff5c0b73d3f7c44db8f0c2cbe Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 2 Oct 2019 15:36:07 -0700 Subject: [PATCH] Updated the docstring for SystemNavigator.pop. It had an Android bias and was incorrect for iOS. --- .../lib/src/services/system_navigator.dart | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/services/system_navigator.dart b/packages/flutter/lib/src/services/system_navigator.dart index 5922f8f984..d48d3afa05 100644 --- a/packages/flutter/lib/src/services/system_navigator.dart +++ b/packages/flutter/lib/src/services/system_navigator.dart @@ -10,15 +10,20 @@ import 'system_channels.dart'; class SystemNavigator { SystemNavigator._(); - /// Instructs the system navigator to remove this activity from the stack and - /// return to the previous activity. + /// Removes the topmost Flutter instance, presenting what was before + /// it. /// - /// On iOS, calls to this method are ignored because Apple's human interface - /// guidelines state that applications should not exit themselves. + /// On Android, removes this activity from the stack and returns to + /// the previous activity. /// - /// This method should be preferred over calling `dart:io`'s [exit] method, as - /// the latter may cause the underlying platform to act as if the application - /// had crashed. + /// On iOS, calls `popViewControllerAnimated:` if the root view + /// controller is a `UINavigationController`, or + /// `dismissViewControllerAnimated:completion:` if the top view + /// controller is a `FlutterViewController`. + /// + /// This method should be preferred over calling `dart:io`'s [exit] + /// method, as the latter may cause the underlying platform to act + /// as if the application had crashed. static Future pop() async { await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); }