flutter_unrouter 0.2.0 copy "flutter_unrouter: ^0.2.0" to clipboard
flutter_unrouter: ^0.2.0 copied to clipboard

Declarative nested router for Flutter with guards and Router API integration.

Flutter Unrouter #

Test pub dart flutter license

Routing for Flutter apps with nested screens, guards, params, query state, and named navigation.

Install #

dart pub add flutter_unrouter

Quick Start #

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

final router = createRouter(
  routes: [
    Inlet(path: '/', view: HomePage.new),
    Inlet(
      path: '/settings',
      view: SettingsPage.new,
      children: [Inlet(path: 'profile', view: ProfilePage.new)],
    ),
  ],
);

void main() {
  runApp(MaterialApp.router(routerConfig: createRouterConfig(router)));
}

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

  @override
  Widget build(BuildContext context) {
    return const Center(child: Text('Home'));
  }
}

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

  @override
  Widget build(BuildContext context) {
    return const Scaffold(body: Outlet());
  }
}

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

  @override
  Widget build(BuildContext context) {
    return const Center(child: Text('Profile'));
  }
}

Use this package when you want one route tree to drive both navigation and nested UI.

Learn More #

1
likes
160
points
26
downloads

Documentation

API reference

Publisher

verified publishermedz.dev

Weekly Downloads

Declarative nested router for Flutter with guards and Router API integration.

Repository (GitHub)
View/report issues

Topics

#router #navigation #flutter #deep-linking #url

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, ht, oref, unrouter_core, unstory

More

Packages that depend on flutter_unrouter