url_router 0.2.1+3 copy "url_router: ^0.2.1+3" to clipboard
url_router: ^0.2.1+3 copied to clipboard

An un-opinionated url-based Router implementation (Navigator 2.0)

example/lib/main.dart

import 'package:example/stateful_tabs.dart';
import 'package:example/widgets.dart';
import 'package:flutter/material.dart';
import 'package:url_router/url_router.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({Key? key}) : super(key: key);

  late final router = UrlRouter(
    // Return a single MainView regardless of path
    onGeneratePages: (router) => [
      const MaterialPage(child: MainView()),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routeInformationParser: UrlRouteParser(),
      routerDelegate: router,
    );
  }
}
21
likes
140
points
10
downloads

Publisher

verified publishergskinner.com

Weekly Downloads

An un-opinionated url-based Router implementation (Navigator 2.0)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on url_router