Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.5k stars 375 forks source link

How to scope a Same and Specific Bloc to some of the Routes using Auto Route? #1905

Closed cavin-7span closed 2 months ago

cavin-7span commented 2 months ago

I've been using AutoRouteWrapper for quite some time, but I needed the functionality to scope the same Bloc to 2 to 3 screens. I've tried Custom Route, but I'm not able to achieve the functionality.

Milad-Akarie commented 2 months ago

Hey @cavin-7span what you need is to wrap all those shared screens inside a sub router and provide your shared block above it.

Cavin6080 commented 2 months ago

Thanks @Milad-Akarie for the help 😄 It is working as intended now with the tweaks you suggested.