Skip to content

Commit 5bcf490

Browse files
committed
Adds miscellaneous formatting fixes
1 parent b813cf9 commit 5bcf490

File tree

3 files changed

+94
-30
lines changed

3 files changed

+94
-30
lines changed

packages/camera/camera_avfoundation/example/lib/main.dart

Lines changed: 86 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
138138
decoration: BoxDecoration(
139139
color: Colors.black,
140140
border: Border.all(
141-
color: controller != null && controller!.value.isRecordingVideo
141+
color:
142+
controller != null && controller!.value.isRecordingVideo
142143
? Colors.redAccent
143144
: Colors.grey,
144145
width: 3.0,
@@ -154,7 +155,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
154155
_modeControlRowWidget(),
155156
Padding(
156157
padding: const EdgeInsets.all(5.0),
157-
child: Row(children: <Widget>[_cameraTogglesRowWidget(), _thumbnailWidget()]),
158+
child: Row(
159+
children: <Widget>[_cameraTogglesRowWidget(), _thumbnailWidget()],
160+
),
158161
),
159162
],
160163
),
@@ -168,7 +171,11 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
168171
if (cameraController == null || !cameraController.value.isInitialized) {
169172
return const Text(
170173
'Tap a camera',
171-
style: TextStyle(color: Colors.white, fontSize: 24.0, fontWeight: FontWeight.w900),
174+
style: TextStyle(
175+
color: Colors.white,
176+
fontSize: 24.0,
177+
fontWeight: FontWeight.w900,
178+
),
172179
);
173180
} else {
174181
return Listener(
@@ -182,7 +189,8 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
182189
behavior: HitTestBehavior.opaque,
183190
onScaleStart: _handleScaleStart,
184191
onScaleUpdate: _handleScaleUpdate,
185-
onTapDown: (TapDownDetails details) => onViewFinderTap(details, constraints),
192+
onTapDown: (TapDownDetails details) =>
193+
onViewFinderTap(details, constraints),
186194
);
187195
},
188196
),
@@ -201,9 +209,15 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
201209
return;
202210
}
203211

204-
_currentScale = (_baseScale * details.scale).clamp(_minAvailableZoom, _maxAvailableZoom);
212+
_currentScale = (_baseScale * details.scale).clamp(
213+
_minAvailableZoom,
214+
_maxAvailableZoom,
215+
);
205216

206-
await CameraPlatform.instance.setZoomLevel(controller!.cameraId, _currentScale);
217+
await CameraPlatform.instance.setZoomLevel(
218+
controller!.cameraId,
219+
_currentScale,
220+
);
207221
}
208222

209223
/// Display the thumbnail of the captured image or video.
@@ -228,9 +242,13 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
228242
// pointing to a location within the browser. It may be displayed
229243
// either with Image.network or Image.memory after loading the image
230244
// bytes to memory.
231-
kIsWeb ? Image.network(imageFile!.path) : Image.file(File(imageFile!.path)))
245+
kIsWeb
246+
? Image.network(imageFile!.path)
247+
: Image.file(File(imageFile!.path)))
232248
: Container(
233-
decoration: BoxDecoration(border: Border.all(color: Colors.pink)),
249+
decoration: BoxDecoration(
250+
border: Border.all(color: Colors.pink),
251+
),
234252
child: Center(
235253
child: AspectRatio(
236254
aspectRatio: localVideoController.value.aspectRatio,
@@ -263,12 +281,16 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
263281
IconButton(
264282
icon: const Icon(Icons.exposure),
265283
color: Colors.blue,
266-
onPressed: controller != null ? onExposureModeButtonPressed : null,
284+
onPressed: controller != null
285+
? onExposureModeButtonPressed
286+
: null,
267287
),
268288
IconButton(
269289
icon: const Icon(Icons.filter_center_focus),
270290
color: Colors.blue,
271-
onPressed: controller != null ? onFocusModeButtonPressed : null,
291+
onPressed: controller != null
292+
? onFocusModeButtonPressed
293+
: null,
272294
),
273295
]
274296
: <Widget>[],
@@ -284,7 +306,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
284306
: Icons.screen_rotation,
285307
),
286308
color: Colors.blue,
287-
onPressed: controller != null ? onCaptureOrientationLockButtonPressed : null,
309+
onPressed: controller != null
310+
? onCaptureOrientationLockButtonPressed
311+
: null,
288312
),
289313
],
290314
),
@@ -304,28 +328,36 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
304328
children: <Widget>[
305329
IconButton(
306330
icon: const Icon(Icons.flash_off),
307-
color: controller?.value.flashMode == FlashMode.off ? Colors.orange : Colors.blue,
331+
color: controller?.value.flashMode == FlashMode.off
332+
? Colors.orange
333+
: Colors.blue,
308334
onPressed: controller != null
309335
? () => onSetFlashModeButtonPressed(FlashMode.off)
310336
: null,
311337
),
312338
IconButton(
313339
icon: const Icon(Icons.flash_auto),
314-
color: controller?.value.flashMode == FlashMode.auto ? Colors.orange : Colors.blue,
340+
color: controller?.value.flashMode == FlashMode.auto
341+
? Colors.orange
342+
: Colors.blue,
315343
onPressed: controller != null
316344
? () => onSetFlashModeButtonPressed(FlashMode.auto)
317345
: null,
318346
),
319347
IconButton(
320348
icon: const Icon(Icons.flash_on),
321-
color: controller?.value.flashMode == FlashMode.always ? Colors.orange : Colors.blue,
349+
color: controller?.value.flashMode == FlashMode.always
350+
? Colors.orange
351+
: Colors.blue,
322352
onPressed: controller != null
323353
? () => onSetFlashModeButtonPressed(FlashMode.always)
324354
: null,
325355
),
326356
IconButton(
327357
icon: const Icon(Icons.highlight),
328-
color: controller?.value.flashMode == FlashMode.torch ? Colors.orange : Colors.blue,
358+
color: controller?.value.flashMode == FlashMode.torch
359+
? Colors.orange
360+
: Colors.blue,
329361
onPressed: controller != null
330362
? () => onSetFlashModeButtonPressed(FlashMode.torch)
331363
: null,
@@ -362,11 +394,15 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
362394
TextButton(
363395
style: styleAuto,
364396
onPressed: controller != null
365-
? () => onSetExposureModeButtonPressed(ExposureMode.auto)
397+
? () =>
398+
onSetExposureModeButtonPressed(ExposureMode.auto)
366399
: null,
367400
onLongPress: () {
368401
if (controller != null) {
369-
CameraPlatform.instance.setExposurePoint(controller!.cameraId, null);
402+
CameraPlatform.instance.setExposurePoint(
403+
controller!.cameraId,
404+
null,
405+
);
370406
showInSnackBar('Resetting exposure point');
371407
}
372408
},
@@ -375,13 +411,17 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
375411
TextButton(
376412
style: styleLocked,
377413
onPressed: controller != null
378-
? () => onSetExposureModeButtonPressed(ExposureMode.locked)
414+
? () => onSetExposureModeButtonPressed(
415+
ExposureMode.locked,
416+
)
379417
: null,
380418
child: const Text('LOCKED'),
381419
),
382420
TextButton(
383421
style: styleLocked,
384-
onPressed: controller != null ? () => controller!.setExposureOffset(0.0) : null,
422+
onPressed: controller != null
423+
? () => controller!.setExposureOffset(0.0)
424+
: null,
385425
child: const Text('RESET OFFSET'),
386426
),
387427
],
@@ -396,7 +436,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
396436
min: _minAvailableExposureOffset,
397437
max: _maxAvailableExposureOffset,
398438
label: _currentExposureOffset.toString(),
399-
onChanged: _minAvailableExposureOffset == _maxAvailableExposureOffset
439+
onChanged:
440+
_minAvailableExposureOffset ==
441+
_maxAvailableExposureOffset
400442
? null
401443
: setExposureOffset,
402444
),
@@ -412,7 +454,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
412454

413455
Widget _focusModeControlRowWidget() {
414456
final ButtonStyle styleAuto = TextButton.styleFrom(
415-
foregroundColor: controller?.value.focusMode == FocusMode.auto ? Colors.orange : Colors.blue,
457+
foregroundColor: controller?.value.focusMode == FocusMode.auto
458+
? Colors.orange
459+
: Colors.blue,
416460
);
417461
final ButtonStyle styleLocked = TextButton.styleFrom(
418462
foregroundColor: controller?.value.focusMode == FocusMode.locked
@@ -438,7 +482,10 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
438482
: null,
439483
onLongPress: () {
440484
if (controller != null) {
441-
CameraPlatform.instance.setFocusPoint(controller!.cameraId, null);
485+
CameraPlatform.instance.setFocusPoint(
486+
controller!.cameraId,
487+
null,
488+
);
442489
}
443490
showInSnackBar('Resetting focus point');
444491
},
@@ -516,10 +563,13 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
516563
),
517564
IconButton(
518565
icon: const Icon(Icons.pause_presentation),
519-
color: cameraController != null && cameraController.value.isPreviewPaused
566+
color:
567+
cameraController != null && cameraController.value.isPreviewPaused
520568
? Colors.red
521569
: Colors.blue,
522-
onPressed: cameraController == null ? null : onPausePreviewButtonPressed,
570+
onPressed: cameraController == null
571+
? null
572+
: onPausePreviewButtonPressed,
523573
),
524574
],
525575
);
@@ -567,7 +617,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
567617
String timestamp() => DateTime.now().millisecondsSinceEpoch.toString();
568618

569619
void showInSnackBar(String message) {
570-
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message)));
620+
ScaffoldMessenger.of(
621+
context,
622+
).showSnackBar(SnackBar(content: Text(message)));
571623
}
572624

573625
void onViewFinderTap(TapDownDetails details, BoxConstraints constraints) {
@@ -593,7 +645,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
593645
}
594646
}
595647

596-
Future<void> _initializeCameraController(CameraDescription cameraDescription) async {
648+
Future<void> _initializeCameraController(
649+
CameraDescription cameraDescription,
650+
) async {
597651
final CameraController cameraController = CameraController(
598652
cameraDescription,
599653
kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium,
@@ -618,10 +672,14 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
618672
? <Future<Object?>>[
619673
CameraPlatform.instance
620674
.getMinExposureOffset(cameraController.cameraId)
621-
.then((double value) => _minAvailableExposureOffset = value),
675+
.then(
676+
(double value) => _minAvailableExposureOffset = value,
677+
),
622678
CameraPlatform.instance
623679
.getMaxExposureOffset(cameraController.cameraId)
624-
.then((double value) => _maxAvailableExposureOffset = value),
680+
.then(
681+
(double value) => _maxAvailableExposureOffset = value,
682+
),
625683
]
626684
: <Future<Object?>>[],
627685
CameraPlatform.instance

packages/two_dimensional_scrollables/example/lib/table_view/table_explorer.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ class _TableExplorerState extends State<TableExplorer> {
9090
title: Text(_getTitle()),
9191
bottom: PreferredSize(
9292
preferredSize: const Size.fromHeight(50),
93-
child: Padding(padding: const EdgeInsets.all(8.0), child: _getRadioRow()),
93+
child: Padding(
94+
padding: const EdgeInsets.all(8.0),
95+
child: _getRadioRow(),
96+
),
9497
),
9598
),
9699
body: _getTable(),

packages/two_dimensional_scrollables/example/lib/tree_view/tree_explorer.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ class _TreeExplorerState extends State<TreeExplorer> {
8181
title: Text(_getTitle()),
8282
bottom: PreferredSize(
8383
preferredSize: const Size.fromHeight(50),
84-
child: Padding(padding: const EdgeInsets.all(8.0), child: _getRadioRow()),
84+
child: Padding(
85+
padding: const EdgeInsets.all(8.0),
86+
child: _getRadioRow(),
87+
),
8588
),
8689
),
8790
body: _getTree(),

0 commit comments

Comments
 (0)