m3_lightmeter/screenshots/models/screenshot_device.dart
Vadim f62f658be8
Automated release screenshots generation (#177)
* added system overlays for iPhone 8 Plus & iPhone 13 Pro

* add device frame (wip)

* scale device frame (wip)

* add text to screenshots (wip)

* added screenshots config json

* reorganized screenshot models

* cleanup

* added fonts for dark screenshots

* typo

* store raw screenshots

* added standalone script to update screenshots

* wip

* refined screenshots naming

* skip metering layout dialog screenshot

* parse ipad name

* added assets for Pixel 6

* typo

* added text for incident light metering

* reorganized store script

* typo

* wip

* synced outlined icons

* added timer screen to screenshot generator

* constrained timer screen timeline for tablets

* added timer screenshot title

* typo

* revised scripts

* track release screenshots

* Update README.md

* iphone 6.5" -> iphone 6.7"

* Update google_play_resources.md

* softened screenshot font colors

* cleanup
2024-05-21 19:13:33 +02:00

49 lines
1.6 KiB
Dart

enum ScreenshotDevicePlatform { android, ios }
class ScreenshotDevice {
final String name;
final ScreenshotDevicePlatform platform;
final ({int dx, int dy}) screenshotFrameOffset;
const ScreenshotDevice({
required this.name,
required this.platform,
this.screenshotFrameOffset = (dx: 0, dy: 0),
});
ScreenshotDevice.fromDisplayName({
required String displayName,
required this.platform,
this.screenshotFrameOffset = (dx: 0, dy: 0),
}) : 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';
String get deviceFramePath => 'screenshots/assets/frames/${platform.name}/${name}_frame.png';
}
final screenshotDevices = <String, ScreenshotDevice>{
for (final d in _screenshotDevicesAndroid + _screenshotDevicesIos) d.name: d,
};
final List<ScreenshotDevice> _screenshotDevicesAndroid = [
ScreenshotDevice.fromDisplayName(
displayName: 'Pixel 6',
platform: ScreenshotDevicePlatform.android,
screenshotFrameOffset: (dx: 67, dy: 66),
),
];
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),
),
];