diff --git a/pubspec.yaml b/pubspec.yaml index 6ba2d42..78a07cf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,6 +51,7 @@ dev_dependencies: sdk: flutter golden_toolkit: 0.15.0 google_fonts: 3.0.1 + image: 4.1.7 integration_test: sdk: flutter lint: 2.1.2 diff --git a/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_dark.png b/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_dark.png new file mode 100644 index 0000000..7b2086f Binary files /dev/null and b/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_dark.png differ diff --git a/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_light.png b/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_light.png new file mode 100644 index 0000000..43b0878 Binary files /dev/null and b/screenshots/assets/system_overlays/ios/iphone_13_pro_system_overlay_light.png differ diff --git a/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_dark.png b/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_dark.png new file mode 100644 index 0000000..c3407a0 Binary files /dev/null and b/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_dark.png differ diff --git a/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_light.png b/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_light.png new file mode 100644 index 0000000..f5b0abf Binary files /dev/null and b/screenshots/assets/system_overlays/ios/iphone_8_plus_system_overlay_light.png differ diff --git a/screenshots/devices_config.dart b/screenshots/devices_config.dart new file mode 100644 index 0000000..2cc7a3e --- /dev/null +++ b/screenshots/devices_config.dart @@ -0,0 +1,26 @@ +enum ScreenshotDevicePlatform { android, ios } + +class ScreenshotDevice { + final String name; + final ScreenshotDevicePlatform platform; + + const ScreenshotDevice({ + required this.name, + required this.platform, + }); + + ScreenshotDevice.fromDisplayName({ + required String displayName, + required this.platform, + }) : 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'; +} + +final screenshotDevicesIos = [ + ScreenshotDevice.fromDisplayName(displayName: 'iPhone 8 Plus', platform: ScreenshotDevicePlatform.ios), + ScreenshotDevice.fromDisplayName(displayName: 'iPhone 13 Pro', platform: ScreenshotDevicePlatform.ios), +]; diff --git a/screenshots/generate_screenshots.dart b/screenshots/generate_screenshots.dart index fae038a..48d45bd 100644 --- a/screenshots/generate_screenshots.dart +++ b/screenshots/generate_screenshots.dart @@ -138,7 +138,9 @@ final String _platformFolder = Platform.isAndroid ? 'android' : 'ios'; extension on WidgetTester { Future takeScreenshot(IntegrationTestWidgetsFlutterBinding binding, String name) async { - await binding.takeScreenshot("$_platformFolder/${const String.fromEnvironment('deviceName')}/$name"); + await binding.takeScreenshot( + "$_platformFolder/${const String.fromEnvironment('deviceName').replaceAll(' ', '_').toLowerCase()}/$name", + ); await pumpAndSettle(); } }