value property

T get value

Gets the value for the current device type.

Implementation

T get value {
  final data = AdaptiveData.of(_context);
  final info = data.getDeviceInfo(_context);

  switch (info.deviceType) {
    case DeviceType.phone:
      return _phone ?? _defaultValue ?? _tablet ?? _desktop as T;
    case DeviceType.tablet:
      return _tablet ?? _phone ?? _desktop ?? _defaultValue as T;
    case DeviceType.desktop:
      return _desktop ?? _tablet ?? _phone ?? _defaultValue as T;
    case DeviceType.foldable:
      return _foldable ?? _phone ?? _tablet ?? _defaultValue as T;
  }
}