LayoutValue<T> class abstract

A responsive value that adapts dynamically to the width of the screen.

The valueBuilder callback returns the responsive value for a given container width.

final isTablet = FluidValue.fromWidth((containerWidth) {
    return containerWidth >= 600;
});

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 width screen use the method resolveForWidth. If there is a Layout inside the widget you can also use resolveForContext 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
Mixed in types
Implementers

Constructors

LayoutValue({required T xs, T? sm, T? md, T? lg, T? xl})
factory
LayoutValue.builder(LayoutValueBuilder<T> builder)
factory
LayoutValue.value(T value)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Constants

screenWidth → const _ScreenWidthValue