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
-
- Object
- LayoutValue<
T> - BreakpointValue
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
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(
LayoutData layout) → T -
override
-
resolveForLayoutData(
double width, LayoutBreakpoint breakpoint) → T -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited