WillPopScope 注册一个回调 onWillPop 用来自定义用户对路由的操作
(1)自定义双击退出回调函数
1 | int _lastClickTime = 0; |
(2)将事先创建好的子节点 _getBody() 嵌套在 WillPopScope 中
1 | class _HomePageState extends State<HomePage> { |
WillPopScope 注册一个回调 onWillPop 用来自定义用户对路由的操作
(1)自定义双击退出回调函数
1 | int _lastClickTime = 0; |
(2)将事先创建好的子节点 _getBody() 嵌套在 WillPopScope 中
1 | class _HomePageState extends State<HomePage> { |