📜  限制后退按钮 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:03.510000             🧑  作者: Mango

代码示例1
@override
Widget build(BuildContext context) {
  return new WillPopScope(
    onWillPop: () async => false,
    child: new Scaffold(
      appBar: new AppBar(
        title: new Text("data"),
        leading: new IconButton(
          icon: new Icon(Icons.ac_unit),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
    ),
  );
}