I need to go to my home page on tap of a Middle screen button. For some reason I have already emptied the Navigation Stack.
I tried runApp(MyApp()); Its not working
onTap: () {
print('sdg');
runApp(MyApp1());
}
You can use Navigator
Navigator.push(context, MaterialPageRoute(builder: (context) => WidgetName()));
in your case use
onTap: () {
print('sdg');
Navigator.push(context,
MaterialPageRoute(builder: (context) => MyApp1()));
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.