ResponsiveValue<T> class

A responsive value that changes based on device type or screen size.

This class provides type-safe responsive values that can be configured for different device types or screen sizes.

final padding = ResponsiveValue<double>(
  context,
  phone: 16,
  tablet: 24,
  desktop: 32,
).value;

Constructors

ResponsiveValue(BuildContext _context, {T? phone, T? tablet, T? desktop, T? foldable, T? defaultValue})
Creates a responsive value based on device type.
const

Properties

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
Gets the value for the current device type.
no setter

Methods

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