sdk/python/examples/apps/router/modal_routes/README.md
Routes marked modal=True are rendered as fullscreen-dialog overlays on
top of the previous location's view stack. Closing the modal pops it
without rebuilding the views underneath.
This example demonstrates both modes:
/settings — a global modal declared at the top level. Reachable
from /, /items, /items/<id> — closing returns to whichever URL was
active when it opened. Deep-linking to /settings directly defaults the
base to /.
/items/<id>/edit — a local modal declared as a child of
/items/:id. The URL embeds the item id, so deep-linking restores the
full stack [ItemList, ItemDetails(id), EditItemModal] from URL alone.
flet run
Home, tap "Open Settings" → modal slides up over Home. Close →
back to Home with no rebuild.Home → Items → Apples → tap "Edit" → local modal slides over
the Apples detail view. Close → back to Apples with the detail view
still mounted./items/2/edit into the URL — the stack rebuilds and the modal
opens directly. Close → /items/2.