API Reference

Router

Focused reference for Flint Dart and Flint UI APIs, with copyable examples and practical notes.

Router

Matches incoming requests to handlers and supports route params, regex, and wildcards.

Flint routes are defined on the Flint app, which internally uses Router and RouteBuilder for matching and middleware composition.

void add(String method, String path, Handler handler, {List<Middleware> middlewares = const []})

Low-level route registration used by the framework and builders.

RouteBuilder get/post/put/delete/patch/query(...)

Use the app-level helpers to register routes and attach middleware.

query(...) registers safe, idempotent HTTP QUERY routes with request content support.

Path params: /users/:id or /users/:id(\d+)

Named params can include optional regex patterns for validation.

Wildcard: /public/*

Match all paths under a prefix (used by static file routing).

Example

CodeBlock dart
app.get('/users/:id(\\d+)', (Context ctx) async {
  final id = ctx.req.params['id'];
  return ctx.res?.json({'id': id});
});
Flint Dart logo
Flint EcosystemThe Unified Dart Technology Stack

One language powering Full-Stack Web, Cross-Platform Clients, Native AI, and Connected Robotics.

Fullstack
Client SDK
AI Engine
Hardware
Copyright 2026 Flint Dart. Maintained by Eulogia Technologies.
v 1.3.2
MIT License
Built with Dart