From b04c30be643bc208d5862319b48bf515bef9fdc1 Mon Sep 17 00:00:00 2001 From: Yaakov Schectman Date: Mon, 28 Oct 2024 15:52:43 -0400 Subject: [PATCH] Format --- .../lib/display_cutout_rotation_main.dart | 20 ++++++++++++------- .../display_cutout_rotation_main_test.dart | 19 +++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dev/integration_tests/native_driver_test/lib/display_cutout_rotation_main.dart b/dev/integration_tests/native_driver_test/lib/display_cutout_rotation_main.dart index 392f6ba488e..3a04b50a588 100644 --- a/dev/integration_tests/native_driver_test/lib/display_cutout_rotation_main.dart +++ b/dev/integration_tests/native_driver_test/lib/display_cutout_rotation_main.dart @@ -32,18 +32,24 @@ final class MainApp extends StatefulWidget { class _MainAppState extends State { @override Widget build(BuildContext context) { - final List displayFeatures = MediaQuery.of(context).displayFeatures; - displayFeatures.retainWhere((DisplayFeature feature) => feature.type == DisplayFeatureType.cutout); + final List displayFeatures = + MediaQuery.of(context).displayFeatures; + displayFeatures.retainWhere( + (DisplayFeature feature) => feature.type == DisplayFeatureType.cutout); String text; if (displayFeatures.isEmpty) { text = 'CutoutNone'; - } else if (displayFeatures.length > 1) {text = 'CutoutMany';} - else { - final Rect cutout =displayFeatures[0].bounds; + } else if (displayFeatures.length > 1) { + text = 'CutoutMany'; + } else { + final Rect cutout = displayFeatures[0].bounds; if (cutout.top == 0) { text = 'CutoutTop'; - } else if (cutout.left == 0) {text = 'CutoutLeft';} - else {text = 'CutoutNeither';} + } else if (cutout.left == 0) { + text = 'CutoutLeft'; + } else { + text = 'CutoutNeither'; + } } return MaterialApp( debugShowCheckedModeBanner: false, diff --git a/dev/integration_tests/native_driver_test/test_driver/display_cutout_rotation_main_test.dart b/dev/integration_tests/native_driver_test/test_driver/display_cutout_rotation_main_test.dart index 824f5e11909..3305c497b58 100644 --- a/dev/integration_tests/native_driver_test/test_driver/display_cutout_rotation_main_test.dart +++ b/dev/integration_tests/native_driver_test/test_driver/display_cutout_rotation_main_test.dart @@ -11,7 +11,6 @@ import 'package:test/test.dart'; const String _tallCutout = 'com.android.internal.display.cutout.emulation.tall'; void main() async { - late final FlutterDriver flutterDriver; late final NativeDriver nativeDriver; @@ -20,9 +19,17 @@ void main() async { nativeDriver = await AndroidNativeDriver.connect(flutterDriver); await flutterDriver.waitUntilFirstFrameRasterized(); // Enable developer settings in order to simulate a cutout. - await Process.run('adb', ['shell', 'settings', 'put', 'global', 'development_settings_enabled', '1']); + await Process.run('adb', [ + 'shell', + 'settings', + 'put', + 'global', + 'development_settings_enabled', + '1' + ]); // Simulate the tall cutout. A singular cutout that aligns to the "top" of the display. - await Process.run('adb', ['shell', 'cmd', 'overlay', 'enable', _tallCutout]); + await Process.run( + 'adb', ['shell', 'cmd', 'overlay', 'enable', _tallCutout]); }); tearDownAll(() async { @@ -33,14 +40,16 @@ void main() async { test('cutout should be on top in portrait mode', () async { await nativeDriver.rotateResetDefault(); await flutterDriver.waitFor(find.byType('Text')); - final String status = await flutterDriver.getText(find.byValueKey('CutoutTop')); + final String status = + await flutterDriver.getText(find.byValueKey('CutoutTop')); expect(status, 'Cutout status: CutoutTop'); }, timeout: const Timeout(Duration(seconds: 5))); test('cutout should be on left in landscape mode', () async { await nativeDriver.rotateToLandscape(); await flutterDriver.waitFor(find.byType('Text')); - final String status = await flutterDriver.getText(find.byValueKey('CutoutLeft')); + final String status = + await flutterDriver.getText(find.byValueKey('CutoutLeft')); expect(status, 'Cutout status: CutoutLeft'); }, timeout: const Timeout(Duration(seconds: 5)));