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

Primary Unrouter package with Flutter, Nocterm, and shared core entrypoints.

unrouter

Declarative routing toolkit for Flutter and Nocterm.

Test dart flutter pub license

unrouter is the primary package for the Unrouter family. It gives you one dependency with Flutter and Nocterm entrypoints, plus shared core and history APIs from the package root.

Start here if you want one package for Flutter, Nocterm, and the shared routing building blocks.

What You Get #

  • Declarative route trees
  • Shared routing and history APIs from package:unrouter/unrouter.dart
  • Named navigation, params, and query helpers
  • Guards and redirects
  • Nested route rendering
  • Flutter and Nocterm entrypoints from one package
  • A stable brand-level import path for app code

Install #

dependencies:
  unrouter: <latest>
dart pub add unrouter

Flutter Entry Point #

import 'package:unrouter/flutter.dart';

Use this in Flutter apps.

Other Entrypoints #

import 'package:unrouter/nocterm.dart';
import 'package:unrouter/unrouter.dart';
  • package:unrouter/flutter.dart Flutter routing APIs.
  • package:unrouter/nocterm.dart Nocterm routing APIs, including history exports.
  • package:unrouter/unrouter.dart Shared core and history APIs.

If you import more than one adapter library in the same file, use prefixes to avoid symbol collisions such as Inlet, Outlet, and createRouter.

Flutter Example #

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

final Unrouter router = createRouter(
  routes: [Inlet(path: '/', view: HomePage.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'));
  }
}

More Examples #

Run the Flutter example:

cd examples/flutter_example
flutter run -d chrome

Run the Nocterm example:

cd examples/nocterm_example
dart run
8
likes
160
points
323
downloads

Documentation

API reference

Publisher

verified publishermedz.dev

Weekly Downloads

Primary Unrouter package with Flutter, Nocterm, and shared core entrypoints.

Repository (GitHub)
View/report issues

Topics

#router #navigation #flutter #terminal #deep-linking

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter_unrouter, nocterm_unrouter, unrouter_core, unstory

More

Packages that depend on unrouter