Unrouter Core

Test pub dart license

Core routing primitives for matching, navigation, guards, params, query helpers, and route metadata.

Install

dart pub add unrouter_core

Quick Start

import 'package:unrouter_core/unrouter_core.dart';
import 'package:unstory/unstory.dart';

final router = createRouter<String>(
  history: MemoryHistory(initialEntries: [HistoryLocation(Uri(path: '/'))]),
  routes: const [
    RouteNode<String>(path: '/', view: homeView),
    RouteNode<String>(path: '/users/:id', name: 'user', view: userView),
  ],
);

String homeView() => 'home';
String userView() => 'user';

Use this package when you are building on top of the routing engine itself.

This package does not render UI. For Flutter and Nocterm packages, see flutter_unrouter and nocterm_unrouter.

Libraries

unrouter_core