I have a listitem on RefreshIndicator and each of the items have a navigator.pushNamed which redirect a new page. I need reload RefreshIndicator when i run Navigator.pop(context) in the new page.
//Home
RefreshIndicator(
onRefresh: _con.refreshHome,
child: ListView.separated(
itemBuilder: (context, index) => SizedBox(
width: size.width * 0.8,
child: OrdenWidget(
orden: currentData[index],
mostrarComenzar: true,
onTap: currentData[index].aceptada ==
true
? () {
Navigator.PushNamed(
context,
"/New Page",
arguments: currentData[index],
).then((_) {
_con.refreshHome();
});
}
: null,
),
),
separatorBuilder: (context, index) => const Divider(
color: Colors.white,
),
itemCount: currentData.length,
),
),
//Second Screen
TextButton(onPressed:(){ Navigator.pop(context);}, child: const Text("Go Back"),),
CodePudding user response:
try with Navigator.push
Navigator.push(
context,
MaterialPageRoute<void>(builder: (_) => NewPage()),
).then((_){
_con.refreshHome();
});