[j Flutter ] 앱 종료하기
Future _onBackPressed() { return showDialog( context: context, builder: (context) => AlertDialog( title: Text("종료하시겠습니까?"), actions: [ FlatButton( child: Text("종료하기"), onPressed: () => SystemChannels.platform.invokeMethod('SystemNavigator.pop'), ), FlatButton( child: Text("취소"), onPressed: () => Navigator.pop(context, false), ), ], ), ) ?? false; }