Documentation
¶
Overview ¶
Command navigation shows the navigation of Glutter on a WidgetsApp, without Material. The home page has two tabs. The first one navigates with the imperative API: a thumbnail (a Hero) opens a detail page through a custom PageRouteBuilder that slides in, and the "Pick a color" link opens a page that returns a value, which the home page reads from the channel of NavigatorPush. The second tab keeps a stack of pages in a nested Navigator, the Pages API: the "Push page" link adds a page to the list, and the Back link of a page removes it again. Every link takes the keyboard focus: Tab and Shift+Tab move between the links, the focused link has a thick border, Enter or Space follows it, and Escape goes back (every page maps the DismissIntent to a pop). It uses only the public packages.
Run it with: go run ./examples/navigation
On Windows: go run ./cmd/glutter-windows run ./examples/navigation (under Wine on Linux, headless with -headless; GLUTTER_BACKEND is win32 there). Nothing of this example is missing on Windows (Escape goes back as on the other platforms).
Environment: GLUTTER_BACKEND=x11|wayland (Linux) or win32 (Windows), GLUTTER_SCREENSHOT=<file.png>, GLUTTER_SCREENSHOT_AFTER=<duration>. In debug builds: GLUTTER_DEV_ROUTE=<"/", "/detail" or "/pick"> opens that page first, and GLUTTER_DEV_TAB=<0 or 1> opens that tab of the home page.