ResponsiveValue<T> class

Conditional values based on the active breakpoint.

Get a value that corresponds to active breakpoint determined by Conditions set in conditionalValues. Set a value for when no condition is active. Requires a parent context that contains a ResponsiveBreakpoints.

No validation is performed on Conditions so valid conditions must be passed.

Constructors

ResponsiveValue(BuildContext context, {required List<Condition<T>> conditionalValues, T? defaultValue})

Properties

conditionalValues List<Condition<T>>
final
context BuildContext
final
defaultValue → T?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
getter/setter pair

Methods

getActiveCondition(BuildContext context, List<Condition> conditions) Condition?
Set activeCondition. The active condition is found by matching the search criteria in order of precedence:
getValue(BuildContext context, List<Condition> conditions) → T?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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