browser_routes 1.0.0-nullsafety.1 copy "browser_routes: ^1.0.0-nullsafety.1" to clipboard
browser_routes: ^1.0.0-nullsafety.1 copied to clipboard

Platformweb

General Purpose In-Browser Routing. Null safe.

example/browser_routes_example.dart

import 'package:browser_routes/browser_routes.dart';

bool authOk(void Function() f) {
  f();
  return true;
}

void main() {
  final router = HashRouter(onError: (Url<StateObject> url) => authOk(() => print('${url.code}: $url')));
  final hello_route = router.register('/', 'hello/:name', (Url url) => 
    authOk(() => print("hello '${url.params['name']}'"))
  );
  // ignore: unused_local_variable
  final home_route = router.register('/', 'Home', (Url url) => 
    authOk(() => print('home screen'))
  );

  hello_route.navigateTo(params: {'name': 'Peter'});
}
1
likes
105
pub points
0%
popularity

Publisher

unverified uploader

General Purpose In-Browser Routing. Null safe.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on browser_routes