buildGenericLaptopDevice function

DeviceInfo buildGenericLaptopDevice({
  1. required TargetPlatform platform,
  2. required String id,
  3. required String name,
  4. required Size screenSize,
  5. required Rect windowPosition,
  6. EdgeInsets safeAreas = EdgeInsets.zero,
  7. double pixelRatio = 2.0,
  8. EdgeInsets? rotatedSafeAreas,
  9. GenericLaptopFramePainter? framePainter,
})

Creates a generic laptop device definition.

Implementation

DeviceInfo buildGenericLaptopDevice({
  required TargetPlatform platform,
  required String id,
  required String name,
  required Size screenSize,
  required Rect windowPosition,
  EdgeInsets safeAreas = EdgeInsets.zero,
  double pixelRatio = 2.0,
  EdgeInsets? rotatedSafeAreas,
  GenericLaptopFramePainter? framePainter,
}) {
  final effectivePainter = framePainter ??
      GenericLaptopFramePainter(
        platform: platform,
        windowPosition: windowPosition,
      );
  return DeviceInfo(
    identifier: DeviceIdentifier(
      platform,
      DeviceType.laptop,
      id,
    ),
    name: name,
    pixelRatio: pixelRatio,
    frameSize: effectivePainter.calculateFrameSize(screenSize),
    screenSize: effectivePainter.effectiveWindowSize,
    safeAreas: safeAreas,
    rotatedSafeAreas: rotatedSafeAreas,
    framePainter: effectivePainter,
    screenPath: effectivePainter.createScreenPath(screenSize),
  );
}