Linked Questions

0 votes
1 answer
13k views

how to close the app programmatically in Flutter? [duplicate]

I want to add exit button to my project , i tried using import 'dart:io'; . . . RaisedButton( child: Text("exit"), onPressed: () { exit(0); }, ) and import '...
Hasan's user avatar
  • 348
1 vote
1 answer
303 views

Back button for exit the app not for back to other screen [duplicate]

I have a problem with closing the app from home screen. This is my home screen code for close the app` Future<bool> onWillPop() { return showDialog( context: context, builder: (...
Adam Theory's user avatar
6 votes
3 answers
17k views

How to use systemNavigator.pop in below code to exit app in flutter

Here is my code. I used SystemNavigator.pop but it says undefined name SystemNavigator All I want is to exit the app using OnTap class AppDrawer extends StatelessWidget { @override Widget build(...
raman raman's user avatar
  • 1,831
8 votes
3 answers
16k views

How to close/kill app on Flutter

I am actually aware of this implementation: Flutter programmatically closing the app, but when the app closes is still in background. How can I absolutely kill the app and not let it be in background? ...
Lu Chinke's user avatar
  • 693
5 votes
6 answers
6k views

Would a button to exit my iPhone app be in violation of Apple's guidelines? [closed]

I'd like to create a button in my iPhone app that quits the app (with exit(0)) when pressed. Would this be in violation of Apple's human interface guidelines?
S.J. Lim's user avatar
  • 3,155
1 vote
4 answers
3k views

How to get the number of routes in Navigator's stack

Is there a way to know if the current page is the last page in the Navigator Stack and calling Navigator.pop() at this point will close the app?
Ali Qanbari's user avatar
  • 3,131
2 votes
2 answers
4k views

Getting a black screen when navigating between two pages in flutter

This is my home page code: routes: { '/second' : (context) => addExpence(), }, my second-page code is: FlatButton( child: Text("Done".toUpperCase()), onPressed: (){ ...
Jamilur Rahman's user avatar
1 vote
2 answers
2k views

Flutter force to release foreground

How to release foreground to the previous application in Flutter (Dart) ? I mean, how to force to call the onPause or viewWillDisappear to let my app disappear and let the previous app come back to ...
Jérémy's user avatar
  • 1,910
1 vote
2 answers
3k views

Flutter Ios how to exit app without exit(0)?

Hi im tryng to exit with button. I know that using exit(0) is not recommended. I have tried SystemChannels.platform.invokeMethod('SystemNavigator.pop'); but it didnt worked also any reccomendations ? ...
Yigit Kaya's user avatar
1 vote
1 answer
3k views

Flutter programmatically closing the app but from appState

The answer here shows exiting application through Widget. I want to know, if I can exit from initPlatformState(){...} Specifically to my case I have bool response in initPlatformState(){...} i.e., ...
Sahdeep Singh's user avatar
2 votes
1 answer
2k views

stop flutter_background_service when app is killed flutter

How can I stop the flutter_background_service when the app is killed by the user? final _androidConfiguration = AndroidConfiguration( onStart: _onStart, autoStart: true, isForegroundMode: ...
DeKekem's user avatar
  • 1,835
1 vote
3 answers
1k views

Pop until there is no more root (i.e exit the app)

i am trying to use the navigator's popUntil method to exit my app so i was thinking if there was a way to pop all previous pages including the firstPage/route and cause the app to exit at this point. ...
mtkguy's user avatar
  • 275
0 votes
2 answers
2k views

How do I close my Flutter app programmatically on iOS?

I want to close my Flutter my app programmatically, I have tried all available solutions they work pretty well for Android but do not work for iOS. Below code works well for Android but not for iOS ...
HMAD's user avatar
  • 7
0 votes
0 answers
1k views

How to force stop any application in Flutter?

I need to make a mobile application in which we can force stop any app, using Flutter. Thanks in advance for your suggestions.
Faizan Jivani's user avatar
1 vote
0 answers
1k views

How to actively crash Flutter app on Android

The requirement is to exit the app when the button is clicked. I created a MethodChannel to do this. Using the principle of array out of bounds, respectively on both sides of the array out of bounds, ...
jintao wang's user avatar

15 30 50 per page