Skip to content

Instantly share code, notes, and snippets.

@xrnd
Created July 9, 2018 08:54
Show Gist options
  • Select an option

  • Save xrnd/fddc3d7c9521374348b27db0e80ede98 to your computer and use it in GitHub Desktop.

Select an option

Save xrnd/fddc3d7c9521374348b27db0e80ede98 to your computer and use it in GitHub Desktop.
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutterstart/view/FutureWidgetView.dart';
import 'package:flutterstart/view/LayoutWidgetView.dart';
import 'package:flutterstart/view/StateWidgetView.dart';
final String homeRoute = '/home';
final String stateRoute = '/state';
final String layoutRoute = '/layout';
final String futureRoute = '/future';
class Routes {
static void configureRoutes(Router router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
print("ROUTE WAS NOT FOUND !!!");
});
/// ROUTES FOR Widgets
router.define(stateRoute, handler: new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
return new StateWidgetView();
}));
router.define(layoutRoute, handler: new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
return new LayoutWidgetView();
}));
router.define(futureRoute, handler: new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
return new FutureWidgetView();
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment