From 7f31861914ffdfd56a94ca9af66cefef58ce7426 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Wed, 28 Apr 2021 22:54:49 +0200 Subject: [PATCH] add missing trailing commas (#81406) --- examples/flutter_view/lib/main.dart | 3 +- examples/hello_world/lib/main.dart | 6 +- examples/image_list/lib/main.dart | 27 +++++--- examples/layers/raw/shader_warm_up.dart | 5 +- examples/layers/raw/spinning_square.dart | 6 +- examples/layers/raw/text.dart | 6 +- .../layers/rendering/spinning_square.dart | 2 +- examples/layers/services/isolate.dart | 4 +- examples/layers/widgets/gestures.dart | 5 +- examples/layers/widgets/sectors.dart | 2 +- examples/layers/widgets/styled_text.dart | 4 +- examples/platform_view/lib/main.dart | 12 ++-- .../flutter/lib/src/cupertino/dialog.dart | 11 ++-- .../flutter/lib/src/material/app_bar.dart | 3 +- .../flutter/lib/src/material/popup_menu.dart | 3 +- .../flutter/lib/src/painting/text_style.dart | 2 +- .../flutter/lib/src/services/binding.dart | 2 +- .../lib/src/services/keyboard_key.dart | 3 +- .../flutter/lib/src/widgets/autocomplete.dart | 2 +- .../lib/src/widgets/interactive_viewer.dart | 11 ++-- .../lib/src/widgets/scroll_configuration.dart | 2 +- .../flutter/lib/src/widgets/shortcuts.dart | 29 +++++---- packages/flutter/test/image_data.dart | 2 +- .../test/material/bottom_sheet_test.dart | 62 ++++++++++++------- .../test/material/input_decorator_test.dart | 4 +- .../material/progress_indicator_test.dart | 6 +- 26 files changed, 131 insertions(+), 93 deletions(-) diff --git a/examples/flutter_view/lib/main.dart b/examples/flutter_view/lib/main.dart index 592f1ca9f7..f572719212 100644 --- a/examples/flutter_view/lib/main.dart +++ b/examples/flutter_view/lib/main.dart @@ -68,7 +68,8 @@ class _MyHomePageState extends State { child: Center( child: Text( 'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.', - style: const TextStyle(fontSize: 17.0)), + style: const TextStyle(fontSize: 17.0), + ), ), ), Container( diff --git a/examples/hello_world/lib/main.dart b/examples/hello_world/lib/main.dart index 3cefcf3662..3fcab6a389 100644 --- a/examples/hello_world/lib/main.dart +++ b/examples/hello_world/lib/main.dart @@ -10,7 +10,7 @@ void main() => child: Text('Hello, world!', key: Key('title'), - textDirection: TextDirection.ltr - ) - ) + textDirection: TextDirection.ltr, + ), + ), ); diff --git a/examples/image_list/lib/main.dart b/examples/image_list/lib/main.dart index a09b3cbbfb..c13d68feef 100644 --- a/examples/image_list/lib/main.dart +++ b/examples/image_list/lib/main.dart @@ -83,7 +83,7 @@ class MyHttpOverrides extends HttpOverrides { @override HttpClient createHttpClient(SecurityContext? context) { return super.createHttpClient( - (context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits) + (context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits), ); } } @@ -189,11 +189,13 @@ class _MyHomePageState extends State with TickerProviderStateMixin { Completer(), ]; final List> futures = completers.map( - (Completer completer) => completer.future).toList(); + (Completer completer) => completer.future, + ).toList(); final DateTime started = DateTime.now(); Future.wait(futures).then((_) { print( - '===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.'); + '===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.', + ); }); return Scaffold( appBar: AppBar( @@ -222,16 +224,21 @@ class _MyHomePageState extends State with TickerProviderStateMixin { ); } - List createImageList(int count, List> completers, - List controllers) { + List createImageList( + int count, + List> completers, + List controllers, + ) { final List list = []; for (int i = 0; i < count; i++) { list.add(Flexible( - fit: FlexFit.tight, - flex: i + 1, - child: RotationTransition( - turns: controllers[i], - child: createImage(i + 1, completers[i])))); + fit: FlexFit.tight, + flex: i + 1, + child: RotationTransition( + turns: controllers[i], + child: createImage(i + 1, completers[i]), + ), + )); } return list; } diff --git a/examples/layers/raw/shader_warm_up.dart b/examples/layers/raw/shader_warm_up.dart index 55c420d940..35ac5bc4fa 100644 --- a/examples/layers/raw/shader_warm_up.dart +++ b/examples/layers/raw/shader_warm_up.dart @@ -16,8 +16,9 @@ Future beginFrame(Duration timeStamp) async { final ui.Paint backgroundPaint = ui.Paint()..color = Colors.white; canvas.drawRect(paintBounds, backgroundPaint); await const DefaultShaderWarmUp( - drawCallSpacing: 80.0, canvasSize: ui.Size(1024, 1024)) - .warmUpOnCanvas(canvas); + drawCallSpacing: 80.0, + canvasSize: ui.Size(1024, 1024), + ).warmUpOnCanvas(canvas); final ui.Picture picture = recorder.endRecording(); // COMPOSITE diff --git a/examples/layers/raw/spinning_square.dart b/examples/layers/raw/spinning_square.dart index 7e68b636b1..38b32e29bc 100644 --- a/examples/layers/raw/spinning_square.dart +++ b/examples/layers/raw/spinning_square.dart @@ -29,8 +29,10 @@ void beginFrame(Duration timeStamp) { final double t = timeStamp.inMicroseconds / Duration.microsecondsPerMillisecond / 1800.0; canvas.rotate(math.pi * (t % 1.0)); - canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), - ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0)); + canvas.drawRect( + const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), + ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0), + ); final ui.Picture picture = recorder.endRecording(); // COMPOSITE diff --git a/examples/layers/raw/text.dart b/examples/layers/raw/text.dart index e73c4b86ab..ca29627b5f 100644 --- a/examples/layers/raw/text.dart +++ b/examples/layers/raw/text.dart @@ -19,8 +19,10 @@ ui.Picture paint(ui.Rect paintBounds) { final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio; canvas.translate(logicalSize.width / 2.0, logicalSize.height / 2.0); - canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), - ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0)); + canvas.drawRect( + const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), + ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0), + ); // The paint method of Paragraph draws the contents of the paragraph onto the // given canvas. diff --git a/examples/layers/rendering/spinning_square.dart b/examples/layers/rendering/spinning_square.dart index 2ac5c2d2f1..b1f0027744 100644 --- a/examples/layers/rendering/spinning_square.dart +++ b/examples/layers/rendering/spinning_square.dart @@ -20,7 +20,7 @@ class NonStopVSync implements TickerProvider { void main() { // We first create a render object that represents a green box. final RenderBox green = RenderDecoratedBox( - decoration: const BoxDecoration(color: Color(0xFF00FF00)) + decoration: const BoxDecoration(color: Color(0xFF00FF00)), ); // Second, we wrap that green box in a render object that forces the green box // to have a specific size. diff --git a/examples/layers/services/isolate.dart b/examples/layers/services/isolate.dart index 4260b403e1..52285351ce 100644 --- a/examples/layers/services/isolate.dart +++ b/examples/layers/services/isolate.dart @@ -40,7 +40,7 @@ class Calculator { if (key is int && i++ % _NOTIFY_INTERVAL == 0) onProgressListener(i.toDouble(), _NUM_ITEMS.toDouble()); return value; - } + }, ); try { final List result = decoder.convert(_data) as List; @@ -249,7 +249,7 @@ class IsolateExampleState extends State with SingleTickerProvide Opacity( opacity: _calculationManager.isRunning ? 1.0 : 0.0, child: CircularProgressIndicator( - value: _progress + value: _progress, ), ), Text(_status), diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart index 436f1ec372..2c58dd7931 100644 --- a/examples/layers/widgets/gestures.dart +++ b/examples/layers/widgets/gestures.dart @@ -30,8 +30,9 @@ class _GesturePainter extends CustomPainter { final Offset center = size.center(Offset.zero) * zoom + offset; final double radius = size.width / 2.0 * zoom; final Gradient gradient = RadialGradient( - colors: forward ? [swatch.shade50, swatch.shade900] - : [swatch.shade900, swatch.shade50] + colors: forward + ? [swatch.shade50, swatch.shade900] + : [swatch.shade900, swatch.shade50], ); final Paint paint = Paint() ..shader = gradient.createShader(Rect.fromCircle( diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart index 7434180b1a..b98f7559e0 100644 --- a/examples/layers/widgets/sectors.dart +++ b/examples/layers/widgets/sectors.dart @@ -135,7 +135,7 @@ class SectorAppState extends State { child: Container( margin: const EdgeInsets.all(8.0), decoration: BoxDecoration( - border: Border.all() + border: Border.all(), ), padding: const EdgeInsets.all(8.0), child: WidgetToRenderBoxAdapter( diff --git a/examples/layers/widgets/styled_text.dart b/examples/layers/widgets/styled_text.dart index 4ef90f98eb..8e72bf155f 100644 --- a/examples/layers/widgets/styled_text.dart +++ b/examples/layers/widgets/styled_text.dart @@ -67,8 +67,8 @@ class SpeakerSeparator extends StatelessWidget { margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0), decoration: const BoxDecoration( border: Border( - bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0)) - ) + bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0)), + ), ), ); } diff --git a/examples/platform_view/lib/main.dart b/examples/platform_view/lib/main.dart index 5b59bc0e78..7c9dab9534 100644 --- a/examples/platform_view/lib/main.dart +++ b/examples/platform_view/lib/main.dart @@ -75,10 +75,11 @@ class _MyHomePageState extends State { Padding( padding: const EdgeInsets.all(18.0), child: ElevatedButton( - child: Platform.isIOS - ? const Text('Continue in iOS view') - : const Text('Continue in Android view'), - onPressed: _launchPlatformCount), + child: Platform.isIOS + ? const Text('Continue in iOS view') + : const Text('Continue in Android view'), + onPressed: _launchPlatformCount, + ), ), ], ), @@ -88,8 +89,7 @@ class _MyHomePageState extends State { padding: const EdgeInsets.only(bottom: 15.0, left: 5.0), child: Row( children: [ - Image.asset('assets/flutter-mark-square-64.png', - scale: 1.5), + Image.asset('assets/flutter-mark-square-64.png', scale: 1.5), const Text( 'Flutter', style: TextStyle(fontSize: 30.0), diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index e118aad7d4..21e21aa7e7 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -1199,8 +1199,10 @@ class _RenderCupertinoDialog extends RenderBox { // Set the position of the actions box to sit at the bottom of the dialog. // The content box defaults to the top left, which is where we want it. - assert((!isActionSheet && actionsSection!.parentData is BoxParentData) - || (isActionSheet && actionsSection!.parentData is MultiChildLayoutParentData)); + assert( + (!isActionSheet && actionsSection!.parentData is BoxParentData) || + (isActionSheet && actionsSection!.parentData is MultiChildLayoutParentData), + ); if (isActionSheet) { final MultiChildLayoutParentData actionParentData = actionsSection!.parentData! as MultiChildLayoutParentData; actionParentData.offset = Offset(0.0, dialogSizes.contentHeight + dialogSizes.dividerThickness); @@ -1880,8 +1882,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget { } @override - void updateRenderObject( - BuildContext context, _RenderCupertinoDialogActions renderObject) { + void updateRenderObject(BuildContext context, _RenderCupertinoDialogActions renderObject) { renderObject ..dialogWidth = _isActionSheet ? null @@ -2226,7 +2227,7 @@ class _RenderCupertinoDialogActions extends RenderBox ); return constraints.constrain( - Size(dialogWidth!, childSize.height) + Size(dialogWidth!, childSize.height), ); } else { // Each button gets half the available width, minus a single divider. diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 33f7d90779..1a67acdc31 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -812,7 +812,8 @@ class _AppBarState extends State { states, widget.backgroundColor, appBarTheme.backgroundColor, - colorScheme.brightness == Brightness.dark ? colorScheme.surface : colorScheme.primary); + colorScheme.brightness == Brightness.dark ? colorScheme.surface : colorScheme.primary, + ); final Color foregroundColor = widget.foregroundColor ?? appBarTheme.foregroundColor diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index cf7feb6ba9..2e3f2ef685 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -651,7 +651,8 @@ class _PopupMenuRouteLayout extends SingleChildLayoutDelegate { // The menu can be at most the size of the overlay minus 8.0 pixels in each // direction. return BoxConstraints.loose(constraints.biggest).deflate( - const EdgeInsets.all(_kMenuScreenPadding) + EdgeInsets.only(top: topPadding, bottom: bottomPadding)); + const EdgeInsets.all(_kMenuScreenPadding) + EdgeInsets.only(top: topPadding, bottom: bottomPadding), + ); } @override diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 0651de773e..b771e0e473 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -830,7 +830,7 @@ class TextStyle with Diagnosticable { decorationStyle: decorationStyle ?? this.decorationStyle, decorationThickness: decorationThickness ?? this.decorationThickness, debugLabel: newDebugLabel, - overflow: overflow ?? this.overflow + overflow: overflow ?? this.overflow, ); } diff --git a/packages/flutter/lib/src/services/binding.dart b/packages/flutter/lib/src/services/binding.dart index 7c8cd579c9..9ddca8a8c5 100644 --- a/packages/flutter/lib/src/services/binding.dart +++ b/packages/flutter/lib/src/services/binding.dart @@ -119,7 +119,7 @@ mixin ServicesBinding on BindingBase, SchedulerBinding { List bytes = licenseBytes.buffer.asUint8List(); bytes = gzip.decode(bytes); return utf8.decode(bytes); - }() + }(), ); }, Priority.animation); await rawLicenses.future; diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index 260ef8aecd..6a5cdac01d 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -148,8 +148,7 @@ class LogicalKeyboardKey extends KeyboardKey { // Equivalent to assert(divisorForValueMask == (1 << valueMaskWidth)). const int _firstDivisorWidth = 28; - assert(divisorForValueMask == - (1 << _firstDivisorWidth) * (1 << (valueMaskWidth - _firstDivisorWidth))); + assert(divisorForValueMask == (1 << _firstDivisorWidth) * (1 << (valueMaskWidth - _firstDivisorWidth))); // JS only supports up to 2^53 - 1, therefore non-value bits can only // contain (maxSafeIntegerWidth - valueMaskWidth) bits. diff --git a/packages/flutter/lib/src/widgets/autocomplete.dart b/packages/flutter/lib/src/widgets/autocomplete.dart index 1962d2178e..0a69798ae9 100644 --- a/packages/flutter/lib/src/widgets/autocomplete.dart +++ b/packages/flutter/lib/src/widgets/autocomplete.dart @@ -505,7 +505,7 @@ class RawAutocomplete extends StatefulWidget { assert((focusNode == null) == (textEditingController == null)), assert( !(textEditingController != null && initialValue != null), - 'textEditingController and initialValue cannot be simultaneously defined.' + 'textEditingController and initialValue cannot be simultaneously defined.', ), super(key: key); diff --git a/packages/flutter/lib/src/widgets/interactive_viewer.dart b/packages/flutter/lib/src/widgets/interactive_viewer.dart index 97a350d731..ce22ea1abf 100644 --- a/packages/flutter/lib/src/widgets/interactive_viewer.dart +++ b/packages/flutter/lib/src/widgets/interactive_viewer.dart @@ -153,10 +153,13 @@ class InteractiveViewer extends StatefulWidget { assert(scaleEnabled != null), // boundaryMargin must be either fully infinite or fully finite, but not // a mix of both. - assert((boundaryMargin.horizontal.isInfinite - && boundaryMargin.vertical.isInfinite) || (boundaryMargin.top.isFinite - && boundaryMargin.right.isFinite && boundaryMargin.bottom.isFinite - && boundaryMargin.left.isFinite)), + assert( + (boundaryMargin.horizontal.isInfinite && boundaryMargin.vertical.isInfinite) || + (boundaryMargin.top.isFinite && + boundaryMargin.right.isFinite && + boundaryMargin.bottom.isFinite && + boundaryMargin.left.isFinite), + ), constrained = false, child = null, super(key: key); diff --git a/packages/flutter/lib/src/widgets/scroll_configuration.dart b/packages/flutter/lib/src/widgets/scroll_configuration.dart index 9aa72d37d8..38a7632081 100644 --- a/packages/flutter/lib/src/widgets/scroll_configuration.dart +++ b/packages/flutter/lib/src/widgets/scroll_configuration.dart @@ -79,7 +79,7 @@ class ScrollBehavior { /// instead. @Deprecated( 'Migrate to buildOverscrollIndicator. ' - 'This feature was deprecated after v2.1.0-11.0.pre.' + 'This feature was deprecated after v2.1.0-11.0.pre.', ) Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) { switch (getPlatform(context)) { diff --git a/packages/flutter/lib/src/widgets/shortcuts.dart b/packages/flutter/lib/src/widgets/shortcuts.dart index ff3fb64046..3bdf7e9d4a 100644 --- a/packages/flutter/lib/src/widgets/shortcuts.dart +++ b/packages/flutter/lib/src/widgets/shortcuts.dart @@ -298,7 +298,8 @@ class LogicalKeySet extends KeySet with Diagnosticable @override Iterable get triggers => _triggers; late final Set _triggers = keys.expand( - (LogicalKeyboardKey key) => _unmapSynonyms[key] ?? [key]).toSet(); + (LogicalKeyboardKey key) => _unmapSynonyms[key] ?? [key], + ).toSet(); @override bool accepts(RawKeyEvent event, RawKeyboard state) { @@ -475,18 +476,20 @@ class SingleActivator with Diagnosticable implements ShortcutActivator { // since const constructors can not call functions such as `==` or // `Set.contains`. Checking with `identical` is sufficient since // `LogicalKeyboardKey` only provides cached values. - assert(!identical(trigger, LogicalKeyboardKey.control) - && !identical(trigger, LogicalKeyboardKey.controlLeft) - && !identical(trigger, LogicalKeyboardKey.controlRight) - && !identical(trigger, LogicalKeyboardKey.shift) - && !identical(trigger, LogicalKeyboardKey.shiftLeft) - && !identical(trigger, LogicalKeyboardKey.shiftRight) - && !identical(trigger, LogicalKeyboardKey.alt) - && !identical(trigger, LogicalKeyboardKey.altLeft) - && !identical(trigger, LogicalKeyboardKey.altRight) - && !identical(trigger, LogicalKeyboardKey.meta) - && !identical(trigger, LogicalKeyboardKey.metaLeft) - && !identical(trigger, LogicalKeyboardKey.metaRight)); + assert( + !identical(trigger, LogicalKeyboardKey.control) && + !identical(trigger, LogicalKeyboardKey.controlLeft) && + !identical(trigger, LogicalKeyboardKey.controlRight) && + !identical(trigger, LogicalKeyboardKey.shift) && + !identical(trigger, LogicalKeyboardKey.shiftLeft) && + !identical(trigger, LogicalKeyboardKey.shiftRight) && + !identical(trigger, LogicalKeyboardKey.alt) && + !identical(trigger, LogicalKeyboardKey.altLeft) && + !identical(trigger, LogicalKeyboardKey.altRight) && + !identical(trigger, LogicalKeyboardKey.meta) && + !identical(trigger, LogicalKeyboardKey.metaLeft) && + !identical(trigger, LogicalKeyboardKey.metaRight), + ); /// The non-modifier key of the shortcut that is pressed after all modifiers /// to activate the shortcut. diff --git a/packages/flutter/test/image_data.dart b/packages/flutter/test/image_data.dart index 22ee7b2328..aa42d38c32 100644 --- a/packages/flutter/test/image_data.dart +++ b/packages/flutter/test/image_data.dart @@ -84,5 +84,5 @@ const List kBlueRectPng = [ 99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 204, 5, 234, 78, 2, 198, 180, - 170, 48, 200, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 + 170, 48, 200, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130, ]; diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 15a379de6d..7db0d42026 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -842,8 +842,10 @@ void main() { ), )); expect(find.text('BottomSheet'), findsOneWidget); - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(0, 586, 154, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(0, 586, 154, 600), + ); }); testWidgets('No constraints by default for showBottomSheet', (WidgetTester tester) async { @@ -855,7 +857,7 @@ void main() { child: const Text('Press me'), onPressed: () { Scaffold.of(context).showBottomSheet( - (BuildContext context) => const Text('BottomSheet') + (BuildContext context) => const Text('BottomSheet'), ); }, ), @@ -867,8 +869,10 @@ void main() { await tester.tap(find.text('Press me')); await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(0, 586, 154, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(0, 586, 154, 600), + ); }); testWidgets('No constraints by default for showModalBottomSheet', (WidgetTester tester) async { @@ -893,8 +897,10 @@ void main() { await tester.tap(find.text('Press me')); await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(0, 586, 800, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(0, 586, 800, 600), + ); }); testWidgets('Theme constraints used for bottomSheet property', (WidgetTester tester) async { @@ -902,7 +908,7 @@ void main() { theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: 80), - ) + ), ), home: const Scaffold( body: Center(child: Text('body')), @@ -911,8 +917,10 @@ void main() { )); expect(find.text('BottomSheet'), findsOneWidget); // Should be centered and only 80dp wide - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(360, 558, 440, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(360, 558, 440, 600), + ); }); testWidgets('Theme constraints used for showBottomSheet', (WidgetTester tester) async { @@ -920,7 +928,7 @@ void main() { theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: 80), - ) + ), ), home: Scaffold( body: Builder(builder: (BuildContext context) { @@ -929,7 +937,7 @@ void main() { child: const Text('Press me'), onPressed: () { Scaffold.of(context).showBottomSheet( - (BuildContext context) => const Text('BottomSheet') + (BuildContext context) => const Text('BottomSheet'), ); }, ), @@ -942,8 +950,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); // Should be centered and only 80dp wide - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(360, 558, 440, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(360, 558, 440, 600), + ); }); testWidgets('Theme constraints used for showModalBottomSheet', (WidgetTester tester) async { @@ -951,7 +961,7 @@ void main() { theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: 80), - ) + ), ), home: Scaffold( body: Builder(builder: (BuildContext context) { @@ -974,8 +984,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); // Should be centered and only 80dp wide - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(360, 558, 440, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(360, 558, 440, 600), + ); }); testWidgets('constraints param overrides theme for showBottomSheet', (WidgetTester tester) async { @@ -983,7 +995,7 @@ void main() { theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: 80), - ) + ), ), home: Scaffold( body: Builder(builder: (BuildContext context) { @@ -1006,8 +1018,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); // Should be centered and only 100dp wide instead of 80dp wide - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(350, 572, 450, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(350, 572, 450, 600), + ); }); testWidgets('constraints param overrides theme for showModalBottomSheet', (WidgetTester tester) async { @@ -1015,7 +1029,7 @@ void main() { theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: 80), - ) + ), ), home: Scaffold( body: Builder(builder: (BuildContext context) { @@ -1039,8 +1053,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('BottomSheet'), findsOneWidget); // Should be centered and only 100dp instead of 80dp wide - expect(tester.getRect(find.text('BottomSheet')), - const Rect.fromLTRB(350, 572, 450, 600)); + expect( + tester.getRect(find.text('BottomSheet')), + const Rect.fromLTRB(350, 572, 450, 600), + ); }); }); diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 3a2144fc2d..4186c55bca 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -1744,7 +1744,7 @@ void main() { constraints: BoxConstraints(maxWidth: 300, maxHeight: 40), ), ), - ) + ), ); // Theme settings should make it 300x40 pixels @@ -1762,7 +1762,7 @@ void main() { decoration: const InputDecoration( constraints: BoxConstraints(maxWidth: 200, maxHeight: 32), ), - ) + ), ); // InputDecoration.constraints should override the theme. It should be diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index c8579886d5..01846efb40 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -475,7 +475,7 @@ void main() { expect(find.byType(RefreshProgressIndicator), paints..arc(color: blue)); final Material backgroundMaterial = tester.widget(find.descendant( of: find.byType(RefreshProgressIndicator), - matching: find.byType(Material) + matching: find.byType(Material), )); expect(backgroundMaterial.type, MaterialType.circle); expect(backgroundMaterial.color, green); @@ -491,8 +491,8 @@ void main() { expect(find.byType(RefreshProgressIndicator), paintsExactlyCountTimes(#drawArc, 1)); expect(find.byType(RefreshProgressIndicator), paints..arc(color: green)); final Material themeBackgroundMaterial = tester.widget(find.descendant( - of: find.byType(RefreshProgressIndicator), - matching: find.byType(Material) + of: find.byType(RefreshProgressIndicator), + matching: find.byType(Material), )); expect(themeBackgroundMaterial.type, MaterialType.circle); expect(themeBackgroundMaterial.color, blue);