ResponsiveValue<T> class Null safety

Conditional values based on the active breakpoint.

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

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

Constructors

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

Properties

context BuildContext
final
defaultValue → T
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value ↔ T?
read / write
valueWhen List<Condition>
final

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 non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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