VarianceBreakpoints extension

A variance node's responsive layout (DESIGN.md §5.3).

on

Properties

currentVarianceVariant → Json?

Available on Node, provided by the VarianceBreakpoints extension

The variant shown: VarianceProps.current's, else the first.
no setter
isResponsive → bool

Available on Node, provided by the VarianceBreakpoints extension

Whether it maps variants to breakpoints (and shows the one for the screen's width).
no setter
varianceVariants → List<Json>

Available on Node, provided by the VarianceBreakpoints extension

Its variants ({"id", "name", "children", "breakpoint"?}).
no setter

Methods

breakpointForWidth(double width, Breakpoints breakpoints) → Breakpoint

Available on Node, provided by the VarianceBreakpoints extension

The breakpoint this responsive variance shows at width of breakpoints, by its own switch points (VarianceProps.minWidths).
variantForWidth(double width, Breakpoints breakpoints) → Json?

Available on Node, provided by the VarianceBreakpoints extension

The variant this variance shows on a screen width wide: a responsive one, the variant of the breakpoint the width resolves to by its own switch points (breakpointForWidth), else of the widest narrower breakpoint that has one, else the narrowest (variantIdForBreakpoint); any other, its current one.
variantIdForBreakpoint(String breakpointId, Breakpoints breakpoints) → String?

Available on Node, provided by the VarianceBreakpoints extension

The id of the variant for breakpoint breakpointId: a variant shows from its breakpoint up to the next variant's (min-width semantics, as a screen's canvases), so its own, else the widest narrower one's (Breakpoints.governing); below every variant, the narrowest. Null when no variant names a breakpoint of breakpoints.

Static Methods

breakpointOfVariant(Json v) → String?

Available on Node, provided by the VarianceBreakpoints extension

The breakpoint id variant v is the layout for, if any.