【问题标题】:How to disable reloading or refresh button in browser in flutter web?如何在flutter web的浏览器中禁用重新加载或刷新按钮?
【发布时间】:2021-01-21 11:49:59
【问题描述】:

我在小部件中使用计时器进行考试,我想防止用户重新加载或显示确认对话框

【问题讨论】:

  • 嗨,Abdelrahman,你有什么办法可以停止刷新按钮
  • 我没有找到解决方案,但我发现我可以在重新加载之前执行一些代码,所以我在重新加载之前将数据保存在共享首选项中

标签: flutter-web


【解决方案1】:

我没有找到解决办法,但我发现我可以在重新加载之前执行一些代码:

import 'dart:html' as html;
html.window.onUnload.listen((event) async {
  print('Reloaded');
  
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-26
    • 2018-03-14
    • 2020-04-09
    • 1970-01-01
    • 2023-02-05
    • 2019-03-16
    • 2018-06-06
    • 1970-01-01
    相关资源
    最近更新 更多