Open naveeez10 opened 1 month ago
Lets say i have a condition to route to RouteA if a boolean value loggedIn is true, otherwise we want to route to RouteB.
RouteA
loggedIn
RouteB
I need to define it as :
final PageRouteInfo route = loggedIn ? RouteA() : RouteB();
But this doesn't work. We need to explicitly typecase it as follows.
final PageRouteInfo route = (loggedIn ? RouteA() : RouteB()) as PageRouteInfo;
I think this should be handled and there shouldn't be a need for explicit typecast
@naveeez10 This should work just fine final PageRouteInfo route = loggedIn ? RouteA() : RouteB(); This's dart specification, not related to auto_route, any sub-type can be assigned to it's parent
Lets say i have a condition to route to
RouteA
if a boolean valueloggedIn
is true, otherwise we want to route toRouteB
.I need to define it as :
final PageRouteInfo route = loggedIn ? RouteA() : RouteB();
But this doesn't work. We need to explicitly typecase it as follows.
final PageRouteInfo route = (loggedIn ? RouteA() : RouteB()) as PageRouteInfo;
I think this should be handled and there shouldn't be a need for explicit typecast