BreakpointValue<T> class

A responsive value that adapts dynamically dinamically to relative width screen breakpoints

final cellCount = BreakpointValue(xs: 1, s: 2, sm: 4, lg: 20);

This class is not usually used directly and if you are using Layout, it is recommended to use the context.layout.value(xs: 1, s: 2, sm: 4, lg: 20); to get directly the responsive value.

Calculating the responsive values is usually done by this library automatically but it can also be calculated with the following methods: To get the value for a given breakpoint use the method resolveForBreakpoint. If there is a Layout inside the widget you can also use resolve(context) that will automatically calulate the value for the container width provided by the closest Layout inside the upper widget tree from the context referenced provided as param.

See also:

  • BreakpointValue, a value that adapts dinamically to relative width screen breakpoints
Inheritance

Constructors

BreakpointValue({required T xs, T? sm, T? md, T? lg, T? xl})
const
BreakpointValue.all({required T xs, required T sm, required T md, required T lg, required T xl})
const
BreakpointValue.fromMap(Map<LayoutBreakpoint, T> values, [T? defaultValue])

Properties

hashCode int
The hash code for this object.
no setterinherited
lg → T?
final
md → T?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sm → T?
final
xl → T?
final
xs → T
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(BuildContext context) → T
inherited
resolveForBreakpoint(LayoutBreakpoint breakpoint) → T
resolveForLayout(LayoutContext layout) → T
override
toString() String
A string representation of this object.
inherited

Operators

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