@@ -27,13 +27,13 @@ void main() {
2727
2828 final Map <ResolutionPreset , Size > presetExpectedSizes =
2929 < ResolutionPreset , Size > {
30- ResolutionPreset .low: const Size (240 , 320 ),
31- ResolutionPreset .medium: const Size (480 , 720 ),
32- ResolutionPreset .high: const Size (720 , 1280 ),
33- ResolutionPreset .veryHigh: const Size (1080 , 1920 ),
34- ResolutionPreset .ultraHigh: const Size (2160 , 3840 ),
35- // Don't bother checking for max here since it could be anything.
36- };
30+ ResolutionPreset .low: const Size (240 , 320 ),
31+ ResolutionPreset .medium: const Size (480 , 720 ),
32+ ResolutionPreset .high: const Size (720 , 1280 ),
33+ ResolutionPreset .veryHigh: const Size (1080 , 1920 ),
34+ ResolutionPreset .ultraHigh: const Size (2160 , 3840 ),
35+ // Don't bother checking for max here since it could be anything.
36+ };
3737
3838 /// Verify that [actual] has dimensions that are at most as large as
3939 /// [expectedSize] . Allows for a mismatch in portrait vs landscape. Returns
@@ -45,20 +45,24 @@ void main() {
4545 actual.longestSide == expectedSize.longestSide;
4646 }
4747
48- testWidgets ('availableCameras only supports valid back or front cameras' ,
49- (WidgetTester tester) async {
48+ testWidgets ('availableCameras only supports valid back or front cameras' , (
49+ WidgetTester tester,
50+ ) async {
5051 final List <CameraDescription > availableCameras =
5152 await CameraPlatform .instance.availableCameras ();
5253
5354 for (final CameraDescription cameraDescription in availableCameras) {
5455 expect (
55- cameraDescription.lensDirection, isNot (CameraLensDirection .external ));
56+ cameraDescription.lensDirection,
57+ isNot (CameraLensDirection .external ),
58+ );
5659 expect (cameraDescription.sensorOrientation, anyOf (0 , 90 , 180 , 270 ));
5760 }
5861 });
5962
60- testWidgets ('Preview takes expected resolution from preset' ,
61- (WidgetTester tester) async {
63+ testWidgets ('Preview takes expected resolution from preset' , (
64+ WidgetTester tester,
65+ ) async {
6266 final List <CameraDescription > cameras =
6367 await CameraPlatform .instance.availableCameras ();
6468 if (cameras.isEmpty) {
@@ -80,21 +84,26 @@ void main() {
8084 }
8185
8286 final bool presetExactlySupported = assertExpectedDimensions (
83- preset.value, controller.value.previewSize! );
87+ preset.value,
88+ controller.value.previewSize! ,
89+ );
8490 // Ensures that if a lower resolution was used for previous (lower)
8591 // resolution preset, then the current (higher) preset also is adjusted,
8692 // as it demands a hgher resolution.
8793 expect (
88- previousPresetExactlySupported || ! presetExactlySupported, isTrue,
89- reason: 'The preview has a lower resolution than that specified.' );
94+ previousPresetExactlySupported || ! presetExactlySupported,
95+ isTrue,
96+ reason: 'The preview has a lower resolution than that specified.' ,
97+ );
9098 previousPresetExactlySupported = presetExactlySupported;
9199 await controller.dispose ();
92100 }
93101 }
94102 });
95103
96- testWidgets ('Images from streaming have expected resolution from preset' ,
97- (WidgetTester tester) async {
104+ testWidgets ('Images from streaming have expected resolution from preset' , (
105+ WidgetTester tester,
106+ ) async {
98107 final List <CameraDescription > cameras =
99108 await CameraPlatform .instance.availableCameras ();
100109 if (cameras.isEmpty) {
@@ -117,14 +126,17 @@ void main() {
117126
118127 final CameraImage image = await imageCompleter.future;
119128 final bool presetExactlySupported = assertExpectedDimensions (
120- preset.value,
121- Size (image.height.toDouble (), image.width.toDouble ()));
129+ preset.value,
130+ Size (image.height.toDouble (), image.width.toDouble ()),
131+ );
122132 // Ensures that if a lower resolution was used for previous (lower)
123133 // resolution preset, then the current (higher) preset also is adjusted,
124134 // as it demands a hgher resolution.
125135 expect (
126- previousPresetExactlySupported || ! presetExactlySupported, isTrue,
127- reason: 'The preview has a lower resolution than that specified.' );
136+ previousPresetExactlySupported || ! presetExactlySupported,
137+ isTrue,
138+ reason: 'The preview has a lower resolution than that specified.' ,
139+ );
128140 previousPresetExactlySupported = presetExactlySupported;
129141
130142 await controller.dispose ();
@@ -138,9 +150,12 @@ void main() {
138150 return ;
139151 }
140152
141- final CameraController controller = CameraController (cameras[0 ],
142- mediaSettings:
143- const MediaSettings (resolutionPreset: ResolutionPreset .low));
153+ final CameraController controller = CameraController (
154+ cameras[0 ],
155+ mediaSettings: const MediaSettings (
156+ resolutionPreset: ResolutionPreset .low,
157+ ),
158+ );
144159 await controller.initialize ();
145160 await controller.prepareForVideoRecording ();
146161
@@ -170,9 +185,12 @@ void main() {
170185 return ;
171186 }
172187
173- final CameraController controller = CameraController (cameras[0 ],
174- mediaSettings:
175- const MediaSettings (resolutionPreset: ResolutionPreset .low));
188+ final CameraController controller = CameraController (
189+ cameras[0 ],
190+ mediaSettings: const MediaSettings (
191+ resolutionPreset: ResolutionPreset .low,
192+ ),
193+ );
176194 await controller.initialize ();
177195 await controller.prepareForVideoRecording ();
178196
0 commit comments