Radu Hrihoreanu
Radu Hrihoreanu

Reputation: 384

How to reload browser tab in a Flutter Web Application

I have a Flutter Application running on web and I need to reload the browser tab programmatically, and I wonder if there is something similarly with html.window.close() but for reload. Is there any way to do this in Flutter?

Upvotes: 1

Views: 2039

Answers (1)

BambinoUA
BambinoUA

Reputation: 7100

Use location.reload method

import 'package:universal_html/html.dart' as html;

FlatButton(
  child: Text('Refresh'),
  onPressed: () {
    html.window.location.reload();
  },
),

Upvotes: 5

Related Questions