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: (BuildContext context){
return AlertDialog(
title: Text("Are you sure"),
content: Text("kamu mau keluar?"),
actions: <Widget>[
FlatButton(
child: Text("NO"),
onPressed: (){Navigator.of(context).pop(false);},
),
FlatButton(
child: Text("YES"),
onPressed: (){Navigator.of(context).pop(true);},
),
],
);
}
);
}`
but it go to login screen, not exit the app. Can someone help me? Please.