GridBoxStyler class
Fluent style for GridBox.
Geometry fields are nullable so partial merges (e.g. attaching variants) do not clobber earlier values with constructor defaults.
Constraint-responsive geometry uses Grid-only onConstraints — patches may contain columns, rows, autoRows, and gaps only. Paint configuration such as clipBehavior remains on the base style. Constraint branches are snapshotted into GridBoxSpec at resolve and applied at render time.
clipBehavior defaults to Clip.none. Fixed tracks keep their declared
size when they overflow; clipping changes paint containment, not geometry.
Numeric geometry accepts SpaceToken and DoubleToken references and
resolves them before GridBoxSpec validation.
- Inheritance
-
- Object
- Mixable<
StyleSpec< GridBoxSpec> > - Mix<
StyleSpec< GridBoxSpec> > - Style<
GridBoxSpec> - MixStyler<
GridBoxStyler, GridBoxSpec> - GridBoxStyler
- Implemented types
Constructors
-
GridBoxStyler({List<
GridTrack> ? columns, List<GridTrack> ? rows, GridTrack? autoRows, double? columnGap, double? rowGap, Clip? clipBehavior, List<GridConstraintBranch> ? constraintBranches, List<VariantStyle< ? variants, WidgetModifierConfig? modifier, AnimationConfig? animation})GridBoxSpec> > -
Creates a potentially partial Grid style.
const
- GridBoxStyler.animate(AnimationConfig animation)
-
Creates a Grid style using
animationfor implicit style changes.factory - GridBoxStyler.autoRows(GridTrack autoRows)
-
Creates a style that repeats
autoRowsfor undeclared rows.factory - GridBoxStyler.clipBehavior(Clip clipBehavior)
-
Creates a style with
clipBehavioras its paint clipping policy.factory - GridBoxStyler.columnGap(double columnGap)
-
Creates a style with the logical-pixel
columnGap.factory -
GridBoxStyler.columns(List<
GridTrack> columns) -
Creates a style with the given
columns.factory - GridBoxStyler.equalColumns(int count)
-
Creates a style with
countequally sizedfr(1)columns.factory - GridBoxStyler.gap(double gap)
-
Creates a style that sets both Grid gaps to
gap.factory - GridBoxStyler.onConstraints(Breakpoint breakpoint, GridBoxStyler patch)
-
Creates a style with one local constraint branch.
factory
- GridBoxStyler.rowGap(double rowGap)
-
Creates a style with the logical-pixel
rowGap.factory -
GridBoxStyler.rows(List<
GridTrack> rows) -
Creates a style with the given explicit
rows.factory
Properties
- $animation → AnimationConfig?
-
finalinherited
- $autoRows → GridTrack?
-
Unresolved track repeated for rows required beyond $rows.
final
- $clipBehavior → Clip?
-
Paint clipping policy, defaulting to Clip.none after resolution.
final
- $columnGap → double?
-
Unresolved logical-pixel gap between columns.
final
-
$columns
→ List<
GridTrack> ? -
Unresolved column tracks, or
nullto use onefr(1)column.final -
$constraintBranches
→ List<
GridConstraintBranch> ? -
Ordered local-constraint branches attached by onConstraints.
final
- $modifier → WidgetModifierConfig?
-
finalinherited
- $rowGap → double?
-
Unresolved logical-pixel gap between rows.
final
-
$rows
→ List<
GridTrack> ? -
Unresolved explicit row tracks, or
nullto use no explicit rows.final -
$stylerFieldNames
→ Set<
String> -
Names of every field represented by the Styler's Mix.props.
no setteroverride
-
$variants
→ List<
VariantStyle< ?GridBoxSpec> > -
finalinherited
- hashCode → int
-
Overrides the hash code getter to compute hash code based on properties.
no setterinherited
- mergeKey → Object
-
Default implementation uses runtimeType as the merge key
no setterinherited
-
props
→ List<
Object?> -
The properties based on which equality and hash code are computed.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool
-
Whether to use a detailed string representation of the object.
no setterinherited
Methods
-
animate(
AnimationConfig value) → GridBoxStyler -
Adds implicit animation to compatible Grid geometry changes.
override
-
applyVariants(
Iterable< NamedVariant> variantsToApply) → GridBoxStyler -
Applies the specified named variants by merging their styles into this style.
inherited
-
autoRows(
GridTrack value) → GridBoxStyler - Sets the track repeated for each row required beyond explicit rows.
-
build(
BuildContext context, {Set< NamedVariant> namedVariants = const {}}) → StyleSpec<GridBoxSpec> -
Builds the style into a fully resolved spec with metadata.
inherited
-
clipBehavior(
Clip value) → GridBoxStyler - Sets the paint clipping policy without changing Grid geometry.
-
columnGap(
double value) → GridBoxStyler - Sets the logical-pixel gap between adjacent columns.
-
columns(
List< GridTrack> value) → GridBoxStyler -
Replaces the column tracks with
value. -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
equalColumns(
int count) → GridBoxStyler -
Replaces the columns with
countequally sizedfr(1)tracks. -
gap(
double value) → GridBoxStyler -
Sets both the column and row gap to
value. -
getDiff(
Equatable other) → Map< String, String> -
Returns a map of properties that differ between this object and another.
inherited
-
keyframeAnimation(
{Listenable? trigger, required List< KeyframeTrack> timeline, required KeyframeStyleBuilder<GridBoxSpec, GridBoxStyler> styleBuilder}) → GridBoxStyler -
Creates a keyframe animation. It will animate through the given timeline.
inherited
-
merge(
covariant GridBoxStyler? other) → GridBoxStyler -
Merges this attribute with another attribute of the same type.
override
-
mergeActiveVariants(
BuildContext context, {required Set< NamedVariant> namedVariants}) → Style<GridBoxSpec> -
Merges all active variants with their nested variants recursively.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAndroid(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for Android platform.
inherited
-
onBreakpoint(
Breakpoint breakpoint, GridBoxStyler style) → GridBoxStyler -
Creates a variant based on the specified breakpoint.
inherited
-
onBuilder(
GridBoxStyler fn(BuildContext context)) → GridBoxStyler -
Creates a variant using a builder function that receives the build context.
inherited
-
onConstraints(
Breakpoint breakpoint, GridBoxStyler patch) → GridBoxStyler - Attaches a Grid-only constraint branch applied at render time.
-
onDark(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for dark mode.
inherited
-
onDesktop(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for desktop breakpoint.
inherited
-
onDisabled(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for disabled state
inherited
-
onEnabled(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for enabled state (opposite of disabled)
inherited
-
onFocused(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for focused state.
inherited
-
onFocusVisible(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for focus shown in Flutter's traditional highlight mode.
inherited
-
onFuchsia(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for Fuchsia platform.
inherited
-
onHovered(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for hover state
inherited
-
onIos(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for iOS platform.
inherited
-
onLandscape(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for landscape device orientation.
inherited
-
onLight(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for light mode.
inherited
-
onLinux(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for Linux platform.
inherited
-
onLtr(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for left-to-right text direction.
inherited
-
onMacos(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for macOS platform.
inherited
-
onMobile(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for mobile breakpoint.
inherited
-
onNot(
ContextVariant contextVariant, GridBoxStyler style) → GridBoxStyler -
Creates a variant for when the context does NOT match the provided variant.
inherited
-
onPortrait(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for portrait device orientation.
inherited
-
onPressed(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for pressed state
inherited
-
onRtl(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for right-to-left text direction.
inherited
-
onTablet(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for tablet breakpoint.
inherited
-
onWeb(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for web platform.
inherited
-
onWindows(
GridBoxStyler style) → GridBoxStyler -
Creates a variant for Windows platform.
inherited
-
phaseAnimation<
P> ({Listenable? trigger, required List< P> phases, required GridBoxStyler styleBuilder(P phase, GridBoxStyler style), required CurveAnimationConfig configBuilder(P phase)}) → GridBoxStyler -
Creates a phase animation. It will animate through the given phases.
inherited
-
resolve(
BuildContext context) → StyleSpec< GridBoxSpec> -
Resolves this attribute to its concrete value using the provided BuildContext.
override
-
rowGap(
double value) → GridBoxStyler - Sets the logical-pixel gap between adjacent rows.
-
rows(
List< GridTrack> value) → GridBoxStyler -
Replaces the explicit row tracks with
value. -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
-
variant(
Variant variant, GridBoxStyler style) → GridBoxStyler -
Must be implemented by the class using this mixin
inherited
-
variants(
List< VariantStyle< value) → GridBoxStylerGridBoxSpec> > -
Sets the list of variant styles. Must be implemented by the class using this mixin.
override
-
wrap(
WidgetModifierConfig value) → GridBoxStyler -
Applies the given
valuewidget modifier configuration.override
Operators
-
operator ==(
Object other) → bool -
Overrides the equality operator to compare based on the properties.
inherited