buildGenericPhoneDevice function
DeviceInfo
buildGenericPhoneDevice({
- required TargetPlatform platform,
- required String id,
- required String name,
- required Size screenSize,
- EdgeInsets safeAreas = EdgeInsets.zero,
- EdgeInsets rotatedSafeAreas = EdgeInsets.zero,
- double pixelRatio = 2.0,
- GenericPhoneFramePainter framePainter = const GenericPhoneFramePainter(),
Creates a generic phone device definition.
Implementation
DeviceInfo buildGenericPhoneDevice({
required TargetPlatform platform,
required String id,
required String name,
required Size screenSize,
EdgeInsets safeAreas = EdgeInsets.zero,
EdgeInsets rotatedSafeAreas = EdgeInsets.zero,
double pixelRatio = 2.0,
GenericPhoneFramePainter framePainter = const GenericPhoneFramePainter(),
}) {
return DeviceInfo(
identifier: DeviceIdentifier(
platform,
DeviceType.phone,
id,
),
name: name,
pixelRatio: pixelRatio,
frameSize: framePainter.calculateFrameSize(screenSize),
screenSize: screenSize,
safeAreas: safeAreas,
rotatedSafeAreas: rotatedSafeAreas,
framePainter: framePainter,
screenPath: framePainter.createScreenPath(screenSize),
);
}