1. 程式人生 > >flutter 監控返回鍵

flutter 監控返回鍵

return new WillPopScope(
        child: Scaffold(
      body: new Center(
          child: new Column(
        children: <Widget>[
      ......  
        ],
      )),
      floatingActionButton: FloatingActionButton(
        onPressed: () => Navigator.pop(context),
//      tooltip: 'Update Text',
child: Icon(Icons.reply), ), ), onWillPop: (){print("返回鍵點選了");Navigator.pop(context);}); }