【问题标题】:How to reload browser tab in a Flutter Web Application如何在 Flutter Web 应用程序中重新加载浏览器选项卡
【发布时间】:2021-03-10 07:03:55
【问题描述】:

我有一个在 web 上运行的 Flutter 应用程序,我需要以编程方式重新加载浏览器选项卡,我想知道 html.window.close() 是否有类似的东西,但需要重新加载。在 Flutter 中有没有办法做到这一点?

【问题讨论】:

    标签: flutter dart flutter-web


    【解决方案1】:

    使用location.reload方法

    import 'package:universal_html/html.dart' as html;
    
    FlatButton(
      child: Text('Refresh'),
      onPressed: () {
        html.window.location.reload();
      },
    ),
    

    【讨论】:

      猜你喜欢
      • 2020-08-02
      • 1970-01-01
      • 1970-01-01
      • 2018-12-12
      • 1970-01-01
      • 2020-09-25
      • 1970-01-01
      • 2014-06-16
      • 1970-01-01
      相关资源
      最近更新 更多