I have 3 categories of products laptops, desktops, mobiles. on each category page there is a list of products which on clicking shows product details page
.
to pop back to category list page
from product details page
I've added product details page as a sub route on each one of them. So that on back press or Navigator.of(context).pop()
I can go back to the relevant category list page
. How to avoid this duplication ?
Routes
GoRoute( routes: [ Laptops ( routes : [ product details page] ) ] )
GoRoute( routes: [ Mobiles ( routes : [ product details page] ) ] )
GoRoute( routes: [ Desktops ( routes : [ product details page] ) ] )
three different products details page routes, share one same page (duplicates).