How to programmatically exit the app in flutter

 

* Refer to link below

 

https://stackoverflow.com/questions/45109557/flutter-how-to-programmatically-exit-the-app

 

If you use SystemChannels.platform.invokeMethod('SystemNavigator.pop'); note that doc is clearly mentioning:

Instructs the system navigator to remove this activity from the stack and return to the previous activity.

On iOS, calls to this method are ignored because Apple's human interface guidelines state that applications should not exit themselves.

You can use exit(0). And that will terminate the Dart VM process immediately with the given exit code. But remember that doc says:

This does not wait for any asynchronous operations to terminate. Using exit is therefore very likely to lose data.

 

'플러터(Flutter) > 플러터 일반(Flutter General)' 카테고리의 다른 글

stream data listening  (0) 2020.04.23
Listening for Data from Firebase using Streams  (0) 2020.03.19
setup Firebase Project  (0) 2020.03.19
[Dart] Mixins  (0) 2020.03.19
Hero Animation  (0) 2020.03.19

+ Recent posts