routers.dart 645 B

123456789101112131415161718192021
  1. import 'package:fluro/fluro.dart';
  2. import 'router_handler.dart';
  3. class Routers {
  4. static String root = '/';
  5. static String details = '/details';
  6. static String map = '/map';
  7. static String settings = '/settings';
  8. static void configureRouters(Router router) {
  9. router.notFoundHandler = Handler(handlerFunc: (_, params) {
  10. print('not found');
  11. });
  12. router.define(root, handler: rootHandler);
  13. router.define(details, handler: detailHandler);
  14. router.define(map, handler: mapHandler);
  15. router.define(settings, handler: settingHandler);
  16. }
  17. static String generateDetailsRouterPath(String id) => '$details?id=$id';
  18. }