属性 const WillPopScope({ Key? key, required this.child,//布局内容 required this.onWillPop,//返回拦截处理 }) 需要注意:WillPopScope必须包裹在布局的最外层。 使用实例: main() { runApp( MaterialApp( home: _WillPopScopeWidget(), )); } class _WillPopScopeWidget extends StatefulWidget