How do I send the green string from the HomePage page to the ContaPage page?
I think it\'s so Navigator.of(context).pushNamed(\'/conta/green\');
but I do no
It is a bit late, but it might help some one. I think the best way is to use flutter route project fluro.
define some where globally:
final router = Router();
after that define the routes
var contaHandler = Handler(handlerFunc: (BuildContext context, Map params) {
return ContaPage(color: params["color"][0]);
});
void defineRoutes(Router router) {
router.define("/conta/:color", handler: contaHandler);
}
set the onGenerateRoute
in MaterialApp
to use the router generator:
new MaterialApp (
...
nGenerateRoute: router.generator
...
),
you have to add the fluro in the dependencies :
dependencies:
fluro: "^1.3.4"
and do the package upgrade by the following or the IDE way.
flutter packages upgrade