fluro
fluro copied to clipboard
Arguments is null when using HandlerType.function
Add type: HandlerType.function to the example code in README.
FluroRouter.appRouter.navigateTo(
context,
'home',
routeSettings: RouteSettings(
arguments: MyArgumentsDataClass('foo!'),
),
);
var homeHandler = Handler(
type: HandlerType.function, // set function as the type.
handlerFunc: (context, params) {
final args = context.settings.arguments as MyArgumentsDataClass; // args will be null.
return HomeComponent(args);
},
);
expected: args is MyArgumentsDataClass('foo!')
I have the same problem