modular
modular copied to clipboard
v6 migration help: ChildRoute with a return type
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.
@override
void routes(r) {
r.child('/', child: (context) => APage(r.args.data['0'], r.args.data['1'], r.args.data['2'])),
}
@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?