material_expressive_host library
Material Expressive's host layer, for an app that shows the look's screens in a shell of its own: the scaffold every
look shares (package:ui_core/host.dart: its tabs, its main action, its background and insets, the
preview frame and platform) and Material Expressive's own part of it. An app that draws its screens from
package:material_expressive_ui/material_expressive_ui.dart does not need this library; the look's own chrome, gallery and tests import it
beside that one.
Outside semver: this library may change in any version, a patch included; the CHANGELOG says how to move.
Classes
- ChromeGroundScope
-
Publishes the ChromeGround of the page it wraps.
ChromeRoutes.pagemounts one inside a pushed page and inside a branch root (from its NavTab.ground); a system's chrome inside the page reads it. - DisplayFormat
- English display formats for amounts, counts and dates.
- ExpressiveArtwork
- Looks up a picture’s colour scheme for the active app theme.
- ExpressiveArtworkScheme
- A picture’s light and dark colour roles at a given contrast.
- ExpressiveChromeMetrics
- Expressive's chrome geometry, in logical pixels (dp).
-
ExpressiveFullScreenDialogPage<
T> -
The go_router Page for a full-screen dialog: a focused task that
covers the whole screen and is closed explicitly (its pop, the system
back). An ExpressiveSheetPage with
drawer: true; the screen inside draws its close and confirm actions. - ExpressiveHost
-
The app's host: mounts the Expressive theme in force (light or dark by
brightness, or by the platform's when null) on an
ExpressiveTheme; under it a thin Material
ThemeDatafor the primitives Expressive builds on (ink, text editing and selection, scrolling, page transitions), whose platform is the ambient one; the ground (thesurfacerole); the text and icon defaults (Compose'sbodyLargeinonSurface); the text-selection colours (primary, its background atHostBehavior.textSelectionBackgroundOpacity); and on Android, edge-to-edge system bars: transparent, their icons contrasting with the ground. - ExpressiveInventoryGallery
-
The inventory as one scrolling list, group by group: each group's
heading in
titleLargewith how many rows it carries, each row its name intitleSmall, its class inlabelMedium(and, for a part that paints a ui_core behaviour, that behaviour), then its specimen, live, in a card's column: at most 560dp wide and 560dp tall. - ExpressiveMediaGround
-
A subtree on a media ground (design_kit's
ChromeGround.media): the host's dark theme (ExpressiveHost.mediaThemeOf), the primitives it reads and its system bars — light icons — whatever brightness the app is in. The shell mounts it around its bar on a media tab andExpressiveScaffoldaround a page that stands on media, so a feed's bar and a pushed player's back arrow are drawn in the dark scheme. -
ExpressivePage<
T> -
The go_router Page for a route pushed off a root, keyed by go_router's
page key. The page's chrome is derived, never authored: a screen inside
reads the pushed register (
RoutePresentation.of) from the route's place. - ExpressivePageTransitionsBuilder
-
The look's push and pop for a page route it does not build itself (a
MaterialPageRoute, go_router'sMaterialPage): the fade-forwards an ExpressivePage pushes with, on its clock (ExpressivePage.fadeForwardsDuration): the page travels 96dp and fades in while the page beneath travels 96dp the other way; the pop is the reverse. expressivePageTransitions names it for macOS, Windows, Linux and Fuchsia. - ExpressivePredictiveBackTransition
- A page's own push and pop on Android, and its frame while the system's predictive back gesture runs: one widget tree either way, so the page keeps its state when a gesture starts. ExpressivePage's route pushes by fade-forwards; with rise the page rises from the bottom edge instead (the full-screen dialog, whose route drives animation on its springs). The route claims and settles the gesture.
- ExpressivePreview
- One page previewed alone, in the platform's register (Android, the lab's default, or iOS) and the brightness asked for.
-
ExpressiveSheetPage<
T> -
The go_router Page for a route raised as a sheet: a modal bottom
sheet, or with drawer a full-screen dialog. The route names the root
navigator (
parentNavigatorKey), so the sheet stands above the shell and the bar under it does not move. The page publishes RoutePresentation.sheet, so the screen inside derives its dismiss affordance; the sheet draws only its container, handle, scrim and anchors. - ExpressiveShellAction
-
The shell's action: the design kit's ShellAction
(icon, onPressed, label, accent, key) plus menu. As a spec it goes to
ExpressiveShell(action:); as a widget —ExpressiveShellAction(action: spec), what the shell draws — it draws any spec by its type: - ExpressiveShellInsets
-
The bottom allowance the shell asks each branch root to reserve
: the bar (64dp) + the system's
bottom inset + the floating action button's clearance + the docked
accessory. The shell publishes it through the design kit's
ShellInsets; a screen reads it with of. - ExpressiveShellScaffold
- The scaffold that owns an app's navigation: body (the branches), and one labelled item per tabs entry, in branch order, with the action and the accessory.
- MediaSlot
- Where a slot's picture comes from.
- MediaSlotImage
- Trusted image delivery for one declared media slot, shared by a system's photo and avatar components. fallback stands in while the picture is pending and whenever it misses, so a pending image never delays layout, first paint or publication.
-
One tab of the shell's navigation: a branch's root, with the glyph and
the words it wears. The runtime emits one per
StatefulShellBranch, in branch order; the system decides how it looks. - PreviewDevice
- The device a platform previews on: its logical size and pixel density. The oracle captures and the gallery's renders use the same numbers.
- PreviewFrame
- The frame a preview stands in: publishes its platform and brightness to everything inside it, scopes the platform override there, and publishes its box as the screen.
- PreviewFrameData
- What a PreviewFrame publishes to everything inside it.
- PreviewStage
- A stage that raises a previewed page on a route over itself once it is on screen, and keeps it raised: how a pushed or sheet page is previewed alone, so its exit renders as it does live and the chrome it derives is the real one (RoutePresentation.pushed or the sheet's).
- RoutePresentationScope
- Publishes the RoutePresentation of the route it stands in, overriding what the route's position implies. A system's sheet page wraps its child in one with RoutePresentation.sheet; a preview or a hand-built navigator may publish any presentation.
- ShellAction
- The app-level act beside the shell's tabs: the one thing reachable from every root — add, compose, capture — with the glyph it wears and what it does. A system draws it in its own way (a floating action button, a disc in the bar, a square at its end).
- ShellInsets
- The bottom inset the shell's bar asks every branch root to keep clear: published by a system's shell over its branch container (and by a preview that stands the bar under a lone page), spent by the system's screen on its scroll padding and by its toast on its inset.
Enums
- ChromeGround
- The ground a page stands on, which is what its chrome is drawn against: the system's own surface, or media — a full-bleed feed of video or photographs, over which the chrome is dark and solid.
- How the Android register's navigation bar is drawn: Android's two system navigation modes.
- PreviewPlatform
- The platform a preview is drawn for: its device size and the platform whose behaviour applies inside it. The look is the system's everywhere; behaviour (scroll physics, back gestures, text handling) follows this platform.
- RoutePresentation
- How a route is presented, which is what a screen derives its bar from: the title on a root, the back affordance on a pushed page, the dismiss affordance on a sheet. A page never authors its own back or close; it reads its presentation (of).
Mixins
-
ExpressivePredictiveBackRoute<
T> -
A page route whose system back gesture is Android's predictive back
: ExpressivePage's route and the full-screen dialog
(ExpressiveSheetPage with
drawer) share it. The route builds its page inside an ExpressivePredictiveBackTransition, which draws the gesture's frame; the route claims the gesture, follows it and settles it by spring.
Extensions
- PreviewPlatformDevice on PreviewPlatform
- The platform's device, as data on the enum.
Constants
- expressiveInventory → const DesignInventory
-
Every inventory row, each a live specimen of its
Expressive<Stem>.
Functions
-
predictiveBackGeometry(
{required Size size, required double progress, SwipeEdge edge = SwipeEdge.left, double startY = 0, double touchY = 0}) → ({double corner, Offset offset, double scale}) -
The page's frame at a predictive back gesture's
progress(0 to 1) on a screen ofsize, swiped fromedge, the finger having moved vertically fromstartYtotouchY: its scale about its centre, then its offset, and the corner it rounds to when the display publishes none. The spec is cited in this file's header.
Typedefs
- ExpressiveFormat = DisplayFormat
- Expressive's formatters: the design kit's DisplayFormat, named for the system.