Skip to content

Chrome Configuration

Source: ui/chrome_config.py

Configuration objects and route mappings for shared app bars, navigation drawers, and other shell chrome. Runtime control refs are in App chrome. See Chrome and wrappers.

Declarative visibility and title settings for shared shell chrome.

SHELL_CHROME maps each shell route path to its ShellChromeConfig. Deep routes omit chrome and are not present in this mapping.

ShellChromeConfig dataclass

Configure shared chrome for a shell route.

Attributes:

Name Type Description
appbar_title str

Text displayed in the app bar. The "__greeting__" sentinel requests a generated greeting.

appbar_menu_leading bool

Whether the app bar shows the drawer menu button.

bottom_appbar_visible bool

Whether the shared bottom app bar is visible.

fab_visible bool

Whether the shared floating action button is visible.

search_button_visible bool

Whether the bottom app bar's search action is visible.

bottom_appbar_height int

Content height of the bottom app bar in logical pixels (menu/search row). The on-screen bar may be taller once the system navigation inset is applied by Flutter's built-in SafeArea.

Source code in src/learning_app/ui/chrome_config.py
@dataclass(frozen=True)
class ShellChromeConfig:
    """Configure shared chrome for a shell route.

    Attributes:
        appbar_title: Text displayed in the app bar. The ``"__greeting__"``
            sentinel requests a generated greeting.
        appbar_menu_leading: Whether the app bar shows the drawer menu button.
        bottom_appbar_visible: Whether the shared bottom app bar is visible.
        fab_visible: Whether the shared floating action button is visible.
        search_button_visible: Whether the bottom app bar's search action is
            visible.
        bottom_appbar_height: Content height of the bottom app bar in logical
            pixels (menu/search row). The on-screen bar may be taller once the
            system navigation inset is applied by Flutter's built-in SafeArea.
    """

    appbar_title: str
    appbar_menu_leading: bool = False
    bottom_appbar_visible: bool = True
    fab_visible: bool = True
    search_button_visible: bool = True
    bottom_appbar_height: int = 80