logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·05.11.26
← Back to news

Kaisel – Routes as Values. Dart 3 Native Router for Flutter

Original article
kaisel.dev|16 points|0 comments|by TheWiggles|Aug 1, 2026

Kaisel: Redefining Flutter Navigation with Routes as Values

Kaisel is a modern, Dart 3-native routing solution designed specifically for Flutter. It departs from traditional routing paradigms by treating routes as values rather than mere string paths.

"The core philosophy of Kaisel is simple: eliminate the fragility of string-based navigation and the overhead of code generation."


🚀 Getting Started

To integrate Kaisel into your project, run the following command in your terminal:

flutter pub add kaisel

Quick Setup Checklist:

  • Install the kaisel package.
  • Define your routes using a sealed class.
  • Implement an exhaustive switch expression to build your pages.

Kaisel Logo Placeholder


🛠 Core Technical Pillars

1. Sealed Routes & Exhaustive Builds

By leveraging Dart 3's sealed classes, navigation becomes a type-safe operation. Instead of hoping a string matches a route, you use a switch over a sealed type.

Mathematically, if your set of routes is defined as: Routes={Rhome,Rprofile,Rsettings}\text{Routes} = \{R_{home}, R_{profile}, R_{settings}\}Routes={Rhome​,Rprofile​,Rsettings​} The compiler ensures that the UI build function handles ∀R∈Routes\forall R \in \text{Routes}∀R∈Routes.

sealed class AppRoute {}
class HomeRoute extends AppRoute {}
class ProfileRoute extends AppRoute { final String userId; ProfileRoute(this.userId); }

// The compiler forces you to handle every case!
Widget buildPage(AppRoute route) => switch (route) {
  HomeRoute() => const HomePage(),
  ProfileRoute(userId: var id) => ProfilePage(id: id),
};

2. The Navigation Stack as a Value

In Kaisel, your navigation history is not a hidden internal state; it is a simple List of route objects.

FeatureTraditional RoutersKaisel
State RepresentationInternal/OpaqueList<Route>
TestingRequires Widget TreePure Dart Logic
PersistenceComplex SerializationSimple List Restoration

Because the stack is a value, operations like push, pop, and set are essentially just list manipulations.

3. Enhanced Observation

Kaisel integrates with a standard NavigatorObserver. Unlike other routers, it can detect:

  • Tab switches
  • Adaptive in-place layout changes

These events often produce no "route event" in other systems, but Kaisel captures them seamlessly.

4. Zero Codegen

Kaisel removes the need for build_runner, generated .g.dart files, or "magic" strings. It is pure Dart.


🗺 Navigation Architecture

The following diagram illustrates how Kaisel processes a route value to render a screen:


📚 Learning & Migration Resources

Whether you are starting fresh or moving from another ecosystem, Kaisel provides comprehensive documentation:

  • The Basics: Tutorial: Your First App
  • Advanced Concepts:
    • Navigation Shells (for tabs)
    • Modal flows & Adaptive layouts
    • Route Guards
    • Deep linking via URLs
  • Migration Paths:
    • Moving from go_router
    • Moving from auto_route
    • Moving from the standard Navigator
  • Reference: Roadmap and API Reference