fluro icon indicating copy to clipboard operation
fluro copied to clipboard

Arguments is null when using HandlerType.function

Open 623637646 opened this issue 4 years ago • 1 comments

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!')

623637646 avatar Apr 08 '22 12:04 623637646

I have the same problem

sbalex27 avatar Apr 28 '22 03:04 sbalex27