mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
added system overlays for iPhone 8 Plus & iPhone 13 Pro
This commit is contained in:
parent
5c27f726c5
commit
41b7730f82
7 changed files with 30 additions and 1 deletions
|
@ -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
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
26
screenshots/devices_config.dart
Normal file
26
screenshots/devices_config.dart
Normal file
|
@ -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),
|
||||
];
|
|
@ -138,7 +138,9 @@ final String _platformFolder = Platform.isAndroid ? 'android' : 'ios';
|
|||
|
||||
extension on WidgetTester {
|
||||
Future<void> 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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue