BreakifyValue<T> class

A responsive value that resolves different values at different breakpoints.

Each breakpoint can define its own value. If a value is omitted, Brekify automatically falls back to the nearest previous breakpoint with a defined value.

This makes it possible to specify only the breakpoints that need to change while inheriting values for the others.

Example

const columns = BreakifyValue<int>(
  sm: 2,
  md: 3,
  lg: 4,
);
// xl and xxl automatically inherit the value 4.

Constructors

BreakifyValue({required T sm, T? md, T? lg, T? xl, T? xxl})
Creates a responsive value.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
lg → T?
Value for the lg breakpoint.
final
md → T?
Value for the md breakpoint.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sm → T
This value is required.
final
xl → T?
Value for the xl breakpoint.
final
xxl → T?
Value for the xxl breakpoint.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(BreakifyBreakpoint breakpoint, double width, BreakifyBreakpoints breakpoints) → T
Resolves the value for the current breakpoint.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited