unrouter 0.11.0 copy "unrouter: ^0.11.0" to clipboard
unrouter: ^0.11.0 copied to clipboard

Declarative, guard-driven router for Flutter with nested routes and typed helpers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:unrouter/unrouter.dart';

import 'advanced/advanced_app.dart';
import 'quickstart/quickstart_app.dart';

import 'home/example_home_view.dart';

final Unrouter exampleRouter = createRouter(
  routes: [
    Inlet(path: '/', view: ExampleHomeView.new),
    ...quickstartRoutes,
    ...advancedRoutes,
  ],
);

void main() {
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Unrouter Examples',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.teal),
        useMaterial3: true,
      ),
      routerConfig: createRouterConfig(exampleRouter),
    );
  }
}
6
likes
160
points
458
downloads

Publisher

verified publishermedz.dev

Weekly Downloads

Declarative, guard-driven router for Flutter with nested routes and typed helpers.

Repository (GitHub)
View/report issues

Topics

#flutter #router #navigation #guard #history

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, ht, oref, roux, unstory

More

Packages that depend on unrouter