From 09a585ba1dd3b856c6a168005ce40553e61f7f2d Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Thu, 26 Dec 2024 16:06:41 -0800 Subject: [PATCH] apply dart_style 3.0.1 (#160875) dart_style 3.0.1 comes with some minor style fixes: https://github.com/dart-lang/dart_style/blob/main/CHANGELOG.md#301 This PR applies this fixes in bulk across the repository. (Otherwise, the next person touching these files would have been the one updating them to the new format by running the formatter). --- dev/bots/custom_rules/render_box_intrinsics.dart | 4 ++-- dev/conductor/core/lib/src/start.dart | 5 +++-- dev/conductor/core/lib/src/version.dart | 5 +++-- packages/flutter/lib/src/cupertino/nav_bar.dart | 7 ++----- .../cupertino/text_selection_toolbar_button.dart | 3 +-- packages/flutter/lib/src/gestures/tap_and_drag.dart | 3 +-- packages/flutter/lib/src/material/app_bar.dart | 3 +-- .../flutter/lib/src/material/elevated_button.dart | 12 ++++++------ .../flutter/lib/src/material/filled_button.dart | 12 ++++++------ .../lib/src/material/flexible_space_bar.dart | 3 +-- .../flutter/lib/src/material/outlined_button.dart | 12 ++++++------ .../lib/src/material/page_transitions_theme.dart | 3 +-- .../lib/src/material/progress_indicator_theme.dart | 3 +-- .../flutter/lib/src/material/reorderable_list.dart | 7 ++----- packages/flutter/lib/src/material/scaffold.dart | 6 ++---- packages/flutter/lib/src/material/tabs.dart | 5 +++-- packages/flutter/lib/src/material/text_button.dart | 12 ++++++------ packages/flutter/lib/src/material/time_picker.dart | 4 ++-- packages/flutter/lib/src/material/tooltip.dart | 10 ++++++---- packages/flutter/lib/src/painting/flutter_logo.dart | 3 ++- packages/flutter/lib/src/painting/text_painter.dart | 9 +++------ packages/flutter/lib/src/rendering/binding.dart | 3 +-- packages/flutter/lib/src/rendering/flex.dart | 9 +++------ packages/flutter/lib/src/rendering/paragraph.dart | 3 +-- packages/flutter/lib/src/rendering/table.dart | 3 +-- packages/flutter/lib/src/widgets/editable_text.dart | 3 +-- .../flutter/lib/src/widgets/focus_traversal.dart | 8 ++++---- .../flutter/lib/src/widgets/layout_builder.dart | 3 +-- .../lib/src/widgets/overscroll_indicator.dart | 3 +-- .../flutter/lib/src/widgets/selectable_region.dart | 13 +++++-------- .../flutter/lib/src/widgets/text_selection.dart | 4 ++-- packages/flutter_test/lib/src/finders.dart | 4 ++-- .../lib/src/build_system/targets/common.dart | 3 +-- packages/flutter_tools/lib/src/ios/devices.dart | 3 +-- .../native_assets/macos/native_assets_host.dart | 7 +++---- .../lib/src/reporting/unified_analytics.dart | 3 +-- packages/flutter_tools/lib/src/reporting/usage.dart | 3 +-- .../isolated/macos/native_assets_test.dart | 12 ++++-------- .../isolated/windows/native_assets_test.dart | 4 ++-- .../test/integration.shard/daemon_mode_test.dart | 10 ++++++---- 40 files changed, 101 insertions(+), 131 deletions(-) diff --git a/dev/bots/custom_rules/render_box_intrinsics.dart b/dev/bots/custom_rules/render_box_intrinsics.dart index 986d0247b3..b5890e7695 100644 --- a/dev/bots/custom_rules/render_box_intrinsics.dart +++ b/dev/bots/custom_rules/render_box_intrinsics.dart @@ -108,8 +108,8 @@ class _RenderBoxSubclassVisitor extends RecursiveAstVisitor { return; } final bool isCallingSuperImplementation = switch (node.parent) { - PropertyAccess(target: SuperExpression()) || MethodInvocation(target: SuperExpression()) => - true, + PropertyAccess(target: SuperExpression()) || + MethodInvocation(target: SuperExpression()) => true, _ => false, }; if (isCallingSuperImplementation) { diff --git a/dev/conductor/core/lib/src/start.dart b/dev/conductor/core/lib/src/start.dart index 1bd18e8032..ca4254e9ef 100644 --- a/dev/conductor/core/lib/src/start.dart +++ b/dev/conductor/core/lib/src/start.dart @@ -242,8 +242,9 @@ class StartContext extends Context { return switch (lastVersion.type) { VersionType.stable => ReleaseType.STABLE_HOTFIX, - VersionType.development || VersionType.gitDescribe || VersionType.latest => - ReleaseType.STABLE_INITIAL, + VersionType.development || + VersionType.gitDescribe || + VersionType.latest => ReleaseType.STABLE_INITIAL, }; } diff --git a/dev/conductor/core/lib/src/version.dart b/dev/conductor/core/lib/src/version.dart index d92cd3efc8..8aa3f10cbb 100644 --- a/dev/conductor/core/lib/src/version.dart +++ b/dev/conductor/core/lib/src/version.dart @@ -141,8 +141,9 @@ class Version { int? nextN = previousVersion.n; nextVersionType ??= switch (previousVersion.type) { VersionType.stable => VersionType.stable, - VersionType.latest || VersionType.gitDescribe || VersionType.development => - VersionType.development, + VersionType.latest || + VersionType.gitDescribe || + VersionType.development => VersionType.development, }; switch (increment) { diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index b49d2d5fcb..283cc8058c 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -2268,11 +2268,8 @@ class _NavigationBarComponentsTransition { bottomLargeExpanded = bottomNavBar.largeExpanded, topLargeExpanded = topNavBar.largeExpanded, transitionBox = - // paintBounds are based on offset zero so it's ok to expand the Rects. - bottomNavBar - .renderBox - .paintBounds - .expandToInclude(topNavBar.renderBox.paintBounds), + // paintBounds are based on offset zero so it's ok to expand the Rects. + bottomNavBar.renderBox.paintBounds.expandToInclude(topNavBar.renderBox.paintBounds), forwardDirection = directionality == TextDirection.ltr ? 1.0 : -1.0; static final Animatable fadeOut = Tween(begin: 1.0, end: 0.0); diff --git a/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart b/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart index 3aa6b5a6c6..685e38fbb7 100644 --- a/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart +++ b/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart @@ -96,8 +96,7 @@ class CupertinoTextSelectionToolbarButton extends StatefulWidget { ContextMenuButtonType.share => localizations.shareButtonLabel, ContextMenuButtonType.liveTextInput || ContextMenuButtonType.delete || - ContextMenuButtonType.custom => - '', + ContextMenuButtonType.custom => '', }; } diff --git a/packages/flutter/lib/src/gestures/tap_and_drag.dart b/packages/flutter/lib/src/gestures/tap_and_drag.dart index 7de97aa890..06b338ae6b 100644 --- a/packages/flutter/lib/src/gestures/tap_and_drag.dart +++ b/packages/flutter/lib/src/gestures/tap_and_drag.dart @@ -1470,8 +1470,7 @@ class TapAndPanGestureRecognizer extends BaseTapAndDragGestureRecognizer { 'This feature was deprecated after v3.9.0-19.0.pre.', ) /// {@macro flutter.gestures.selectionrecognizers.TapAndPanGestureRecognizer} -class TapAndDragGestureRecognizer - extends BaseTapAndDragGestureRecognizer { +class TapAndDragGestureRecognizer extends BaseTapAndDragGestureRecognizer { /// Create a gesture recognizer for interactions on a plane. @Deprecated( 'Use TapAndPanGestureRecognizer instead. ' diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 334761f1f1..89cd4ed1e4 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -1022,8 +1022,7 @@ class _AppBarState extends State { TargetPlatform.android || TargetPlatform.fuchsia || TargetPlatform.linux || - TargetPlatform.windows => - true, + TargetPlatform.windows => true, TargetPlatform.iOS || TargetPlatform.macOS => null, }, header: true, diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index 1504dca3c7..d8aef58e14 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -237,12 +237,12 @@ class ElevatedButton extends ButtonStyleButton { )) { (null, null) => null, (_, Color(a: 0.0)) => WidgetStatePropertyAll(overlayColor), - (_, final Color color) || (final Color color, _) => - WidgetStateProperty.fromMap({ - WidgetState.pressed: color.withOpacity(0.1), - WidgetState.hovered: color.withOpacity(0.08), - WidgetState.focused: color.withOpacity(0.1), - }), + (_, final Color color) || + (final Color color, _) => WidgetStateProperty.fromMap({ + WidgetState.pressed: color.withOpacity(0.1), + WidgetState.hovered: color.withOpacity(0.08), + WidgetState.focused: color.withOpacity(0.1), + }), }; WidgetStateProperty? elevationValue; diff --git a/packages/flutter/lib/src/material/filled_button.dart b/packages/flutter/lib/src/material/filled_button.dart index 32a4899cf5..be27cf852c 100644 --- a/packages/flutter/lib/src/material/filled_button.dart +++ b/packages/flutter/lib/src/material/filled_button.dart @@ -302,12 +302,12 @@ class FilledButton extends ButtonStyleButton { )) { (null, null) => null, (_, Color(a: 0.0)) => WidgetStatePropertyAll(overlayColor), - (_, final Color color) || (final Color color, _) => - WidgetStateProperty.fromMap({ - WidgetState.pressed: color.withOpacity(0.1), - WidgetState.hovered: color.withOpacity(0.08), - WidgetState.focused: color.withOpacity(0.1), - }), + (_, final Color color) || + (final Color color, _) => WidgetStateProperty.fromMap({ + WidgetState.pressed: color.withOpacity(0.1), + WidgetState.hovered: color.withOpacity(0.08), + WidgetState.focused: color.withOpacity(0.1), + }), }; return ButtonStyle( diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index cff2a2a277..ea38d8bf58 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -194,8 +194,7 @@ class _FlexibleSpaceBarState extends State { TargetPlatform.android || TargetPlatform.fuchsia || TargetPlatform.linux || - TargetPlatform.windows => - false, + TargetPlatform.windows => false, TargetPlatform.iOS || TargetPlatform.macOS => true, }; } diff --git a/packages/flutter/lib/src/material/outlined_button.dart b/packages/flutter/lib/src/material/outlined_button.dart index 1ca502ba2c..2647394201 100644 --- a/packages/flutter/lib/src/material/outlined_button.dart +++ b/packages/flutter/lib/src/material/outlined_button.dart @@ -231,12 +231,12 @@ class OutlinedButton extends ButtonStyleButton { )) { (null, null) => null, (_, Color(a: 0.0)) => WidgetStatePropertyAll(overlayColor), - (_, final Color color) || (final Color color, _) => - WidgetStateProperty.fromMap({ - WidgetState.pressed: color.withOpacity(0.1), - WidgetState.hovered: color.withOpacity(0.08), - WidgetState.focused: color.withOpacity(0.1), - }), + (_, final Color color) || + (final Color color, _) => WidgetStateProperty.fromMap({ + WidgetState.pressed: color.withOpacity(0.1), + WidgetState.hovered: color.withOpacity(0.08), + WidgetState.focused: color.withOpacity(0.1), + }), }; return ButtonStyle( diff --git a/packages/flutter/lib/src/material/page_transitions_theme.dart b/packages/flutter/lib/src/material/page_transitions_theme.dart index 5d50f12385..b0afd35688 100644 --- a/packages/flutter/lib/src/material/page_transitions_theme.dart +++ b/packages/flutter/lib/src/material/page_transitions_theme.dart @@ -1204,8 +1204,7 @@ class _PageTransitionsThemeTransitionsState extends State<_PageTransitionsThe TargetPlatform.fuchsia || TargetPlatform.windows || TargetPlatform.macOS || - TargetPlatform.linux => - const ZoomPageTransitionsBuilder(), + TargetPlatform.linux => const ZoomPageTransitionsBuilder(), }; return matchingBuilder.buildTransitions( widget.route, diff --git a/packages/flutter/lib/src/material/progress_indicator_theme.dart b/packages/flutter/lib/src/material/progress_indicator_theme.dart index 5e5f926148..71c709dac3 100644 --- a/packages/flutter/lib/src/material/progress_indicator_theme.dart +++ b/packages/flutter/lib/src/material/progress_indicator_theme.dart @@ -31,8 +31,7 @@ import 'theme.dart'; /// theme down its subtree. /// * [ThemeData.progressIndicatorTheme], which describes the defaults for /// any progress indicators as part of the application's [ThemeData]. -class ProgressIndicatorThemeData - with Diagnosticable { +class ProgressIndicatorThemeData with Diagnosticable { /// Creates the set of properties used to configure [ProgressIndicator] widgets. const ProgressIndicatorThemeData({ this.color, diff --git a/packages/flutter/lib/src/material/reorderable_list.dart b/packages/flutter/lib/src/material/reorderable_list.dart index fabfdcca67..49a62f6142 100644 --- a/packages/flutter/lib/src/material/reorderable_list.dart +++ b/packages/flutter/lib/src/material/reorderable_list.dart @@ -399,11 +399,8 @@ class _ReorderableListViewState extends State { final EdgeInsets startPadding, endPadding, listPadding; (startPadding, endPadding, listPadding) = switch (widget.scrollDirection) { - Axis.horizontal || Axis.vertical when (start ?? end) == null => ( - EdgeInsets.zero, - EdgeInsets.zero, - padding, - ), + Axis.horizontal || + Axis.vertical when (start ?? end) == null => (EdgeInsets.zero, EdgeInsets.zero, padding), Axis.horizontal => ( padding.copyWith(left: 0), padding.copyWith(right: 0), diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 8dd2ecf3f0..a1b797975a 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -1212,8 +1212,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { FloatingActionButtonLocation.endTop || FloatingActionButtonLocation.miniStartTop || FloatingActionButtonLocation.miniCenterTop || - FloatingActionButtonLocation.miniEndTop => - false, + FloatingActionButtonLocation.miniEndTop => false, FloatingActionButtonLocation.startDocked || FloatingActionButtonLocation.startFloat || FloatingActionButtonLocation.centerDocked || @@ -1226,8 +1225,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { FloatingActionButtonLocation.miniCenterDocked || FloatingActionButtonLocation.miniCenterFloat || FloatingActionButtonLocation.miniEndDocked || - FloatingActionButtonLocation.miniEndFloat => - true, + FloatingActionButtonLocation.miniEndFloat => true, FloatingActionButtonLocation() => true, }; if (floatingActionButtonRect.size != Size.zero && isSnackBarFloating && showAboveFab) { diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 8b2109cc96..34bf4965dd 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -1919,8 +1919,9 @@ class _TabBarState extends State { if (theme.useMaterial3) { final AlignmentGeometry effectiveAlignment = switch (effectiveTabAlignment) { TabAlignment.center => Alignment.center, - TabAlignment.start || TabAlignment.startOffset || TabAlignment.fill => - AlignmentDirectional.centerStart, + TabAlignment.start || + TabAlignment.startOffset || + TabAlignment.fill => AlignmentDirectional.centerStart, }; final Color dividerColor = diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 4c5303fa22..f863f91726 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -243,12 +243,12 @@ class TextButton extends ButtonStyleButton { )) { (null, null) => null, (_, Color(a: 0.0)) => WidgetStatePropertyAll(overlayColor), - (_, final Color color) || (final Color color, _) => - WidgetStateProperty.fromMap({ - WidgetState.pressed: color.withOpacity(0.1), - WidgetState.hovered: color.withOpacity(0.08), - WidgetState.focused: color.withOpacity(0.1), - }), + (_, final Color color) || + (final Color color, _) => WidgetStateProperty.fromMap({ + WidgetState.pressed: color.withOpacity(0.1), + WidgetState.hovered: color.withOpacity(0.08), + WidgetState.focused: color.withOpacity(0.1), + }), }; return ButtonStyle( diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 96ce8d4611..c73131a7f1 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -2948,8 +2948,8 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { final Orientation orientation = _orientation.value ?? MediaQuery.orientationOf(context); final HourFormat timeOfDayHour = hourFormat(of: timeOfDayFormat); final _HourDialType hourMode = switch (timeOfDayHour) { - HourFormat.HH || HourFormat.H when theme.useMaterial3 => - _HourDialType.twentyFourHourDoubleRing, + HourFormat.HH || + HourFormat.H when theme.useMaterial3 => _HourDialType.twentyFourHourDoubleRing, HourFormat.HH || HourFormat.H => _HourDialType.twentyFourHour, HourFormat.h => _HourDialType.twelveHour, }; diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 37671b51be..c83266ac60 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -771,10 +771,12 @@ class TooltipState extends State with SingleTickerProviderStateMixin { EdgeInsets _getDefaultPadding() { return switch (Theme.of(context).platform) { - TargetPlatform.macOS || TargetPlatform.linux || TargetPlatform.windows => - const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0), - TargetPlatform.android || TargetPlatform.fuchsia || TargetPlatform.iOS => - const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0), + TargetPlatform.macOS || + TargetPlatform.linux || + TargetPlatform.windows => const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0), + TargetPlatform.android || + TargetPlatform.fuchsia || + TargetPlatform.iOS => const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0), }; } diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index 6e756a6f59..8a5fb5bde2 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -396,7 +396,8 @@ class _FlutterLogoPainter extends BoxPainter { final double finalLeftTextPosition = // position of text in rest position (256.4 / 820.0) * rect.width - // 256.4 is the distance from the left edge to the left of the F when the whole logo is 820.0 wide - (32.0 / 350.0) * fontSize; // 32 is the distance from the text bounding box edge to the left edge of the F when the font size is 350 + (32.0 / 350.0) * + fontSize; // 32 is the distance from the text bounding box edge to the left edge of the F when the font size is 350 final double initialLeftTextPosition = // position of text when just starting the animation rect.width / 2.0 - _textBoundingRect.width * scale; final Offset textOffset = Offset( diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index 61264531c8..bcca79bfd8 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -139,8 +139,7 @@ class PlaceholderDimensions { ui.PlaceholderAlignment.bottom || ui.PlaceholderAlignment.middle || ui.PlaceholderAlignment.aboveBaseline || - ui.PlaceholderAlignment.belowBaseline => - 'PlaceholderDimensions($size, $alignment)', + ui.PlaceholderAlignment.belowBaseline => 'PlaceholderDimensions($size, $alignment)', ui.PlaceholderAlignment.baseline => 'PlaceholderDimensions($size, $alignment($baselineOffset from top))', }; @@ -222,8 +221,7 @@ class WordBoundary extends TextBoundary { 0x000B || // Form Feed 0x000C || // Vertical Feed 0x2028 || // Line Separator - 0x2029 => - true, // Paragraph Separator + 0x2029 => true, // Paragraph Separator _ => false, }; } @@ -381,8 +379,7 @@ class _TextLayout { 0x0009 => true, // horizontal tab 0x00A0 || // no-break space 0x2007 || // figure space - 0x202F => - false, // narrow no-break space + 0x202F => false, // narrow no-break space _ => _regExpSpaceSeparators.hasMatch(lastCodeUnit), }; diff --git a/packages/flutter/lib/src/rendering/binding.dart b/packages/flutter/lib/src/rendering/binding.dart index d5806a9df3..df810c00bf 100644 --- a/packages/flutter/lib/src/rendering/binding.dart +++ b/packages/flutter/lib/src/rendering/binding.dart @@ -285,8 +285,7 @@ mixin RendererBinding 'This feature was deprecated after v3.10.0-12.0.pre.', ) // TODO(goderbauer): When this deprecated property is removed also delete the _ReusableRenderView class. - late final RenderView - renderView = _ReusableRenderView(view: platformDispatcher.implicitView!); + late final RenderView renderView = _ReusableRenderView(view: platformDispatcher.implicitView!); /// Creates the [PipelineOwner] that serves as the root of the pipeline owner /// tree ([rootPipelineOwner]). diff --git a/packages/flutter/lib/src/rendering/flex.dart b/packages/flutter/lib/src/rendering/flex.dart index a53595f109..c176081c1d 100644 --- a/packages/flutter/lib/src/rendering/flex.dart +++ b/packages/flutter/lib/src/rendering/flex.dart @@ -829,8 +829,7 @@ class RenderFlex extends RenderBox CrossAxisAlignment.start || CrossAxisAlignment.center || CrossAxisAlignment.end || - CrossAxisAlignment.stretch => - false, + CrossAxisAlignment.stretch => false, }; } @@ -884,8 +883,7 @@ class RenderFlex extends RenderBox CrossAxisAlignment.start || CrossAxisAlignment.center || CrossAxisAlignment.end || - CrossAxisAlignment.baseline => - false, + CrossAxisAlignment.baseline => false, }; return switch (_direction) { Axis.horizontal => @@ -915,8 +913,7 @@ class RenderFlex extends RenderBox CrossAxisAlignment.start || CrossAxisAlignment.center || CrossAxisAlignment.end || - CrossAxisAlignment.baseline => - false, + CrossAxisAlignment.baseline => false, }; return switch (_direction) { Axis.horizontal => BoxConstraints( diff --git a/packages/flutter/lib/src/rendering/paragraph.dart b/packages/flutter/lib/src/rendering/paragraph.dart index b7da6d4725..45986b2b42 100644 --- a/packages/flutter/lib/src/rendering/paragraph.dart +++ b/packages/flutter/lib/src/rendering/paragraph.dart @@ -162,8 +162,7 @@ mixin RenderInlineChildrenContainerDefaults ui.PlaceholderAlignment.belowBaseline || ui.PlaceholderAlignment.bottom || ui.PlaceholderAlignment.middle || - ui.PlaceholderAlignment.top => - null, + ui.PlaceholderAlignment.top => null, ui.PlaceholderAlignment.baseline => getBaseline( child, childConstraints, diff --git a/packages/flutter/lib/src/rendering/table.dart b/packages/flutter/lib/src/rendering/table.dart index 8864e6fefa..8d3f891a4f 100644 --- a/packages/flutter/lib/src/rendering/table.dart +++ b/packages/flutter/lib/src/rendering/table.dart @@ -1063,8 +1063,7 @@ class RenderTable extends RenderBox { TableCellVerticalAlignment.middle || TableCellVerticalAlignment.bottom || TableCellVerticalAlignment.fill || - TableCellVerticalAlignment.intrinsicHeight => - null, + TableCellVerticalAlignment.intrinsicHeight => null, }; if (childBaseline != null && (baselineOffset == null || baselineOffset < childBaseline)) { baselineOffset = childBaseline; diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index 302df061c3..6a1f500edc 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -3961,8 +3961,7 @@ class EditableTextState extends State TargetPlatform.fuchsia || TargetPlatform.linux || TargetPlatform.macOS || - TargetPlatform.windows => - false, + TargetPlatform.windows => false, }; bool _isInternalScrollableNotification(BuildContext? notificationContext) { diff --git a/packages/flutter/lib/src/widgets/focus_traversal.dart b/packages/flutter/lib/src/widgets/focus_traversal.dart index 50f95d6289..20dd29dad7 100644 --- a/packages/flutter/lib/src/widgets/focus_traversal.dart +++ b/packages/flutter/lib/src/widgets/focus_traversal.dart @@ -915,8 +915,8 @@ mixin DirectionalFocusTraversalPolicyMixin on FocusTraversalPolicy { (FocusNode node) => node.rect != target && node.rect.center.dx <= target.left, TraversalDirection.right => (FocusNode node) => node.rect != target && node.rect.center.dx >= target.right, - TraversalDirection.up || TraversalDirection.down => - throw ArgumentError('Invalid direction $direction'), + TraversalDirection.up || + TraversalDirection.down => throw ArgumentError('Invalid direction $direction'), }).toList(); // Sort all nodes from left to right. mergeSort( @@ -941,8 +941,8 @@ mixin DirectionalFocusTraversalPolicyMixin on FocusTraversalPolicy { (FocusNode node) => node.rect != target && node.rect.center.dy <= target.top, TraversalDirection.down => (FocusNode node) => node.rect != target && node.rect.center.dy >= target.bottom, - TraversalDirection.left || TraversalDirection.right => - throw ArgumentError('Invalid direction $direction'), + TraversalDirection.left || + TraversalDirection.right => throw ArgumentError('Invalid direction $direction'), }).toList(); mergeSort( sorted, diff --git a/packages/flutter/lib/src/widgets/layout_builder.dart b/packages/flutter/lib/src/widgets/layout_builder.dart index ff3ad9c094..99f1204d60 100644 --- a/packages/flutter/lib/src/widgets/layout_builder.dart +++ b/packages/flutter/lib/src/widgets/layout_builder.dart @@ -104,8 +104,7 @@ class _LayoutBuilderElement extends RenderOb SchedulerPhase.idle || SchedulerPhase.postFrameCallbacks => true, SchedulerPhase.transientCallbacks || SchedulerPhase.midFrameMicrotasks || - SchedulerPhase.persistentCallbacks => - false, + SchedulerPhase.persistentCallbacks => false, }; if (!deferMarkNeedsLayout) { renderObject.markNeedsLayout(); diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index 2b95ed53ff..cc0706764d 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -1027,8 +1027,7 @@ class OverscrollIndicatorNotification extends Notification with ViewportNotifica /// indicator from showing. /// /// Defaults to true. - bool - accepted = true; + bool accepted = true; /// Call this method if the overscroll indicator should be prevented. void disallowIndicator() { diff --git a/packages/flutter/lib/src/widgets/selectable_region.dart b/packages/flutter/lib/src/widgets/selectable_region.dart index 4db8ab799e..7829d697c8 100644 --- a/packages/flutter/lib/src/widgets/selectable_region.dart +++ b/packages/flutter/lib/src/widgets/selectable_region.dart @@ -307,8 +307,7 @@ class SelectableRegion extends StatefulWidget { TargetPlatform.macOS || TargetPlatform.fuchsia || TargetPlatform.linux || - TargetPlatform.windows => - false, + TargetPlatform.windows => false, // TODO(bleroux): the share button should be shown on iOS but the share // functionality requires some changes on the engine side because, on iPad, // it needs an anchor for the popup. @@ -531,10 +530,8 @@ class SelectableRegionState extends State void _updateSelectionStatus() { final SelectionGeometry geometry = _selectionDelegate.value; final TextSelection selection = switch (geometry.status) { - SelectionStatus.uncollapsed || SelectionStatus.collapsed => const TextSelection( - baseOffset: 0, - extentOffset: 1, - ), + SelectionStatus.uncollapsed || + SelectionStatus.collapsed => const TextSelection(baseOffset: 0, extentOffset: 1), SelectionStatus.none => const TextSelection.collapsed(offset: 1), }; textEditingValue = TextEditingValue(text: '__', selection: selection); @@ -3065,8 +3062,8 @@ abstract class MultiSelectableSelectionContainerDelegate extends SelectionContai if (currentSelectionStartIndex == -1) { currentSelectionStartIndex = currentSelectionEndIndex = switch (event.direction) { - SelectionExtendDirection.previousLine || SelectionExtendDirection.backward => - selectables.length - 1, + SelectionExtendDirection.previousLine || + SelectionExtendDirection.backward => selectables.length - 1, SelectionExtendDirection.nextLine || SelectionExtendDirection.forward => 0, }; } diff --git a/packages/flutter/lib/src/widgets/text_selection.dart b/packages/flutter/lib/src/widgets/text_selection.dart index ddea8fb10d..dfd7b230d3 100644 --- a/packages/flutter/lib/src/widgets/text_selection.dart +++ b/packages/flutter/lib/src/widgets/text_selection.dart @@ -2310,8 +2310,8 @@ class TextSelectionGestureDetectorBuilder { case TargetPlatform.android: if (editableText.widget.stylusHandwritingEnabled) { final bool stylusEnabled = switch (kind) { - PointerDeviceKind.stylus || PointerDeviceKind.invertedStylus => - editableText.widget.stylusHandwritingEnabled, + PointerDeviceKind.stylus || + PointerDeviceKind.invertedStylus => editableText.widget.stylusHandwritingEnabled, _ => false, }; if (stylusEnabled) { diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index be16f47936..d8ce4a92a9 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -1293,8 +1293,8 @@ class _StaticTextRangeFinder extends FinderBase { @override String describeMatch(Plurality plurality) { return switch (plurality) { - Plurality.zero || Plurality.many => - 'non-overlapping TextRanges that match the Pattern "$pattern"', + Plurality.zero || + Plurality.many => 'non-overlapping TextRanges that match the Pattern "$pattern"', Plurality.one => 'non-overlapping TextRange that matches the Pattern "$pattern"', }; } diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index cf0ac1f56b..af46950557 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -236,8 +236,7 @@ class KernelSnapshot extends Target { TargetPlatform.android_arm || TargetPlatform.android_arm64 || TargetPlatform.android_x64 || - TargetPlatform.android_x86 => - 'android', + TargetPlatform.android_x86 => 'android', TargetPlatform.darwin => 'macos', TargetPlatform.ios => 'ios', TargetPlatform.linux_arm64 || TargetPlatform.linux_x64 => 'linux', diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index c6e75f43c7..7ee363f18d 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -314,8 +314,7 @@ class IOSDevice extends Device { /// to connect, wireless devices will have an interface of `usb`/`attached`. /// This may change after waiting for the device to connect in /// `waitForDeviceToConnect`. - DeviceConnectionInterface - connectionInterface; + DeviceConnectionInterface connectionInterface; @override bool isConnected; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart index 9e9ea50506..4ee588fbd4 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart @@ -128,10 +128,9 @@ Future> getInstallNamesDylib(File dylibFile) async { return { for (final List architectureSection in parseOtoolArchitectureSections(installNameResult.stdout as String).values) - // For each architecture, a separate install name is reported, which are - // not necessarily the same. - architectureSection - .single, + // For each architecture, a separate install name is reported, which are + // not necessarily the same. + architectureSection.single, }; } diff --git a/packages/flutter_tools/lib/src/reporting/unified_analytics.dart b/packages/flutter_tools/lib/src/reporting/unified_analytics.dart index 24e422d916..e8fa841966 100644 --- a/packages/flutter_tools/lib/src/reporting/unified_analytics.dart +++ b/packages/flutter_tools/lib/src/reporting/unified_analytics.dart @@ -34,8 +34,7 @@ Analytics getAnalytics({ if ( // Ignore local user branches. version.startsWith('[user-branch]') || // Many CI systems don't do a full git checkout. - version - .endsWith('/unknown') || + version.endsWith('/unknown') || // Ignore bots. runningOnBot || // Ignore when suppressed by FLUTTER_SUPPRESS_ANALYTICS. diff --git a/packages/flutter_tools/lib/src/reporting/usage.dart b/packages/flutter_tools/lib/src/reporting/usage.dart index 6e02d63c5c..397552a5b7 100644 --- a/packages/flutter_tools/lib/src/reporting/usage.dart +++ b/packages/flutter_tools/lib/src/reporting/usage.dart @@ -149,8 +149,7 @@ class _DefaultUsage implements Usage { ( // Ignore local user branches. version.startsWith('[user-branch]') || // Many CI systems don't do a full git checkout. - version - .endsWith('/unknown') || + version.endsWith('/unknown') || // Ignore bots. runningOnBot || // Ignore when suppressed by FLUTTER_SUPPRESS_ANALYTICS. diff --git a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart index c8ce142abb..9567e78d07 100644 --- a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart @@ -335,10 +335,8 @@ void main() { stringContainsInOrder([ 'package:bar/bar.dart', if (flutterTester) - // Tests run on host system, so the have the full path on the system. - projectUri - .resolve('build/native_assets/macos/libbar.dylib') - .toFilePath() + // Tests run on host system, so the have the full path on the system. + projectUri.resolve('build/native_assets/macos/libbar.dylib').toFilePath() else // Apps are a bundle with the dylibs on their dlopen path. 'bar.framework/bar', @@ -349,10 +347,8 @@ void main() { stringContainsInOrder([ 'package:buz/buz.dart', if (flutterTester) - // Tests run on host system, so the have the full path on the system. - projectUri - .resolve('build/native_assets/macos/libbuz.dylib') - .toFilePath() + // Tests run on host system, so the have the full path on the system. + projectUri.resolve('build/native_assets/macos/libbuz.dylib').toFilePath() else // Apps are a bundle with the dylibs on their dlopen path. 'buz.framework/buz', diff --git a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart index 091125003f..281fb43163 100644 --- a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart @@ -145,8 +145,8 @@ void main() { stringContainsInOrder([ 'package:bar/bar.dart', if (flutterTester) - // Tests run on host system, so the have the full path on the system. - projectUri + // Tests run on host system, so the have the full path on the system. + projectUri .resolve('build/native_assets/$expectedDirectory/bar.dll') .toFilePath() .replaceAll(r'\', r'\\') // Undo JSON string escaping. diff --git a/packages/flutter_tools/test/integration.shard/daemon_mode_test.dart b/packages/flutter_tools/test/integration.shard/daemon_mode_test.dart index b587154528..27d15fad2c 100644 --- a/packages/flutter_tools/test/integration.shard/daemon_mode_test.dart +++ b/packages/flutter_tools/test/integration.shard/daemon_mode_test.dart @@ -32,10 +32,12 @@ void main() { await project.setUpIn(tempDir); const ProcessManager processManager = LocalProcessManager(); - daemonProcess = await processManager.start( - [flutterBin, ...getLocalEngineArguments(), '--show-test-device', 'daemon'], - workingDirectory: tempDir.path, - ); + daemonProcess = await processManager.start([ + flutterBin, + ...getLocalEngineArguments(), + '--show-test-device', + 'daemon', + ], workingDirectory: tempDir.path); final StreamController stdout = StreamController.broadcast(); transformToLines(daemonProcess.stdout).listen((String line) => stdout.add(line));