modular icon indicating copy to clipboard operation
modular copied to clipboard

v6 migration help: ChildRoute with a return type

Open burekas7 opened this issue 2 years ago • 2 comments

How do I convert this from v5 to the new format v6:

ChildRoute<bool>('/',
        child: (_, args) => APage(args.data['0'], args.data['1'], args.data['2'])),

There is no example for this case in the docs when there was a return type (For example "bool") for ChildRoute.

burekas7 avatar Aug 28 '23 10:08 burekas7

@override
void routes(r) {
  r.child('/', child: (context) => APage(r.args.data['0'], r.args.data['1'], r.args.data['2'])),
}

eduardoflorence avatar Aug 28 '23 17:08 eduardoflorence

@eduardoflorence So there is no difference when a screen returns a value or not?

v5:

ChildRoute<bool>('/',
        child: (_, args) => APage(args.data['0'], args.data['1'], args.data['2'])),
ChildRoute('/',
        child: (_, args) => APage(args.data['0'], args.data['1'], args.data['2'])), 

Do I need to specify the type when calling to Modular.to.pushNamed<T>() or there is no need for that?

burekas7 avatar Aug 28 '23 17:08 burekas7