DEV Community

Cover image for Keep Route Parameters Beside the Page
YeLinAung for dust

Posted on Originally published at dust-codegen.pages.dev

Keep Route Parameters Beside the Page

Manual Flutter route parameter parsing beside a Dust route parameter example

Flutter routing gets harder when URLs carry real state.

A product page may need an id, a selected tab, and a list of filter tags.

You can parse those values by hand in the router.

That works, but the route shape can drift away from the page constructor.

Dust Routing keeps them beside the page.

Path parameters match required constructor fields. Other constructor fields become query values.

Dust can parse and restore values such as int, bool, DateTime, and repeated List<String> query parameters.

The page shows what it needs. The generated router handles the URL mapping.

Use this when your app needs deep links that stay close to screen code.

Read the Dust route parameters guide.

Dust #Routing #Flutter #Dart #CodeGeneration

Top comments (0)