F
Flint DartDocs
GitHub

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(...)

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

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});
});
F
Flint DartBackend framework and Dart UI docs

Build routes, controllers, APIs, docs, and browser UI from one Dart-shaped stack.

Controllers
OpenAPI
Flint UI
Copyright 2024 Flint Dart. Maintained by Eulogia Technologies.
v 1.1.14
MIT License
Built with Dart