CustomDeviceInfoData constructor

const CustomDeviceInfoData({
  1. required String id,
  2. required DeviceType type,
  3. required TargetPlatform platform,
  4. required String name,
  5. @Default(null) @NullableEdgeInsetsJsonConverter() EdgeInsets? rotatedSafeAreas,
  6. @EdgeInsetsJsonConverter() required EdgeInsets safeAreas,
  7. required double pixelRatio,
  8. @SizeJsonConverter() required Size screenSize,
})

Create a new device info.

Implementation

const factory CustomDeviceInfoData({
  /// Identifier of the device.
  required String id,

  /// The device type.
  required DeviceType type,

  /// The device operating system.
  required TargetPlatform platform,

  /// The display name of the device.
  required String name,

  /// The safe areas when the device is in landscape orientation.
  @Default(null)
  @NullableEdgeInsetsJsonConverter()
      EdgeInsets? rotatedSafeAreas,

  /// The safe areas when the device is in portrait orientation.
  @EdgeInsetsJsonConverter() required EdgeInsets safeAreas,

  /// The screen pixel density of the device.
  required double pixelRatio,

  /// The size in points of the screen content.
  @SizeJsonConverter() required Size screenSize,
}) = _CustomDeviceInfoData;