Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter refresh page

// Just insert this code to button to refresh page

Navigator.pushAndRemoveUntil(
  context,
  MaterialPageRoute(builder: (context) => MainPage()), // this mainpage is your page to refresh
  (Route<dynamic> route) => false,
);

// Example
IconButton(
	onPressed: () {
    	Navigator.pushAndRemoveUntil(
  			context,
  			MaterialPageRoute(builder: (context) => MyMainPage()), // this mymainpage is your page to refresh
  			(Route<dynamic> route) => false,
		);
    },
    icon: const Icon(Icons.refresh),
),
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter materialpageroute no animation 
Dart :: dart try catch 
Dart :: delay in flutter 
Dart :: dart sort list by date 
Dart :: dart string to bytes 
Dart :: bottomsheet shape flutter 
Dart :: flutter icon logout 
Dart :: flutter listview inside a column 
Dart :: getters and setters dart 
Dart :: cast variable dart 
Dart :: flutter int max value 
Dart :: dart convert iterable to list 
Dart :: flutter thin line 
Dart :: dart terbary 
Dart :: dart read csv files 
Dart :: flutter ios disable back gesture 
Dart :: flutter print http response 
Dart :: Flutter bottom navigation bar change page programmatically 
Dart :: dart list from 0 to n 
Dart :: using flutter google places 
Dart :: dart keybord input 
Dart :: dart regex,regex dart 
Dart :: special characters flutter 
Dart :: dart list remove item by text 
Dart :: flutter remove character from string 
Dart :: late in dart 
Dart :: dart how to tell if an object is an instance of a class 
Dart :: flutter sembast delete a single record 
Dart :: flutter: unhandled element defs; Picture key: AssetBundlePictureKey 
Dart :: cricle in flutter 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =