DeviceFrame constructor

DeviceFrame({
  1. required String id,
  2. required String label,
  3. required Size logicalSize,
  4. double devicePixelRatio = 1.0,
  5. BezelConfig? bezel,
  6. EdgeInsets? safeArea,
})

Implementation

DeviceFrame({
  required this.id,
  required this.label,
  required this.logicalSize,
  this.devicePixelRatio = 1.0,
  this.bezel,
  this.safeArea,
}) {
  if (logicalSize.width <= 0 || logicalSize.height <= 0) {
    throw ArgumentError.value(
      logicalSize,
      'logicalSize',
      'DeviceFrame logicalSize must be strictly positive',
    );
  }
  if (devicePixelRatio <= 0) {
    throw ArgumentError.value(
      devicePixelRatio,
      'devicePixelRatio',
      'DeviceFrame devicePixelRatio must be > 0',
    );
  }
}