I have a action in my flutter app, which navigates to a named route like so:
InkWell(
onTap: () {
Navigator.pushNamed(context, '/add_request');
},
splashColor: Theme.of(_selfContext).colorScheme.secondary,
child: ListTile(
leading: Icon(Icons.nature_people_rounded),
title: Text("Add request"),
)
However what I really want is the line Navigator.pushNamed(context, '/add_request'); to be replaced by something like Navigator.pushOrBringToTopNamed(context, '/add_request')
i.e., I do not want to always create a new Route but instead bring an existing one to the top of the navigation stack if it exists already.
I did not find any proper way in doing so. Someone knows how to achieve such a thing in somewhat proper flutter?