2024-05-10 14:24:12 +00:00
|
|
|
enum ScreenshotDevicePlatform { android, ios }
|
|
|
|
|
|
|
|
class ScreenshotDevice {
|
|
|
|
final String name;
|
|
|
|
final ScreenshotDevicePlatform platform;
|
2024-05-11 12:59:28 +00:00
|
|
|
final ({int dx, int dy}) screenshotFrameOffset;
|
2024-05-10 14:24:12 +00:00
|
|
|
|
|
|
|
const ScreenshotDevice({
|
|
|
|
required this.name,
|
|
|
|
required this.platform,
|
2024-05-11 12:59:28 +00:00
|
|
|
this.screenshotFrameOffset = (dx: 0, dy: 0),
|
2024-05-10 14:24:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
ScreenshotDevice.fromDisplayName({
|
|
|
|
required String displayName,
|
|
|
|
required this.platform,
|
2024-05-11 12:59:28 +00:00
|
|
|
this.screenshotFrameOffset = (dx: 0, dy: 0),
|
2024-05-10 14:24:12 +00:00
|
|
|
}) : name = displayName.replaceAll(' ', '_').toLowerCase();
|
|
|
|
|
|
|
|
String get systemOverlayPathLight =>
|
|
|
|
'screenshots/assets/system_overlays/${platform.name}/${name}_system_overlay_light.png';
|
|
|
|
String get systemOverlayPathDark =>
|
|
|
|
'screenshots/assets/system_overlays/${platform.name}/${name}_system_overlay_dark.png';
|
2024-05-11 12:59:28 +00:00
|
|
|
String get deviceFramePath => 'screenshots/assets/frames/${platform.name}/${name}_frame.png';
|
2024-05-10 14:24:12 +00:00
|
|
|
}
|
2024-05-14 12:44:26 +00:00
|
|
|
|
|
|
|
final screenshotDevices = <String, ScreenshotDevice>{for (final d in _screenshotDevicesIos) d.name: d};
|
|
|
|
final List<ScreenshotDevice> _screenshotDevicesIos = [
|
|
|
|
ScreenshotDevice.fromDisplayName(
|
|
|
|
displayName: 'iPhone 8 Plus',
|
|
|
|
platform: ScreenshotDevicePlatform.ios,
|
|
|
|
),
|
|
|
|
ScreenshotDevice.fromDisplayName(
|
|
|
|
displayName: 'iPhone 13 Pro',
|
|
|
|
platform: ScreenshotDevicePlatform.ios,
|
|
|
|
screenshotFrameOffset: (dx: 72, dy: 60),
|
|
|
|
),
|
|
|
|
];
|