Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Web - How to reload currently Active Page

I am using Flutter for developing a website. Everything is working fine with Flutter except when it comes to reloading the page. When I press the refresh button in the browser, the whole web app gets reloaded.

For example, if I have navigated to four pages from the initial page, when I press the refresh button from the fourth page, the initial page gets loaded and I'll have to manually browse all the way to the fourth page again.

Is there any way to load the currently active page in Flutter?

like image 529
Ashfaq Avatar asked Jan 04 '20 05:01

Ashfaq


People also ask

How do you reload in flutter?

Once your flutter project has been created do some changes in your code and perform a hot reload. In windows, you can perform a hot reload using 'ctrl+\' or using the hot reload button. In mac devices, you perform hot reload using 'cmd+s'. If you are working in the command prompt using flutter run enter 'r' to run.

How do you refresh scaffold in flutter?

Pull to refresh (swipe to refresh) feature can be implemented in flutter using RefreshIndicator widget. Pull (swipe) to refresh feature lets the user refresh current data or fetch updated data from the server by pulling down on a list.

Which widget is used to refresh the screen in flutter?

Flutter is all about widgets everything in flutter is nothing but widgets. Flutter also provides a widget to implement this feature as well as i.e RefreshIndicator.


1 Answers

Or you can just use this as it refreshes the whole window natively

import 'dart:html' as html;
html.window.location.reload();
like image 81
Shekar Mudaliyar Avatar answered Sep 25 '22 12:09

Shekar Mudaliyar