diff --git a/packages/flutter/lib/src/cupertino/refresh.dart b/packages/flutter/lib/src/cupertino/refresh.dart index 1a22775a92..1a65ad48a2 100644 --- a/packages/flutter/lib/src/cupertino/refresh.dart +++ b/packages/flutter/lib/src/cupertino/refresh.dart @@ -353,7 +353,8 @@ class CupertinoSliverRefreshControl extends StatefulWidget { /// arrow before the refresh is triggered, a [CupertinoActivityIndicator] /// during the refresh and fades the [CupertinoActivityIndicator] away when /// the refresh is done. - static Widget buildSimpleRefreshIndicator(BuildContext context, + static Widget buildSimpleRefreshIndicator( + BuildContext context, RefreshIndicatorMode refreshState, double pulledExtent, double refreshTriggerPullDistance, diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 566e4b62d8..eb960380b6 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -730,7 +730,7 @@ class _CupertinoEdgeShadowDecoration extends Decoration { } @override - _CupertinoEdgeShadowPainter createBoxPainter([VoidCallback onChanged]) { + _CupertinoEdgeShadowPainter createBoxPainter([ VoidCallback onChanged ]) { return _CupertinoEdgeShadowPainter(this, onChanged); } diff --git a/packages/flutter/lib/src/cupertino/segmented_control.dart b/packages/flutter/lib/src/cupertino/segmented_control.dart index 720618e893..0438d44258 100644 --- a/packages/flutter/lib/src/cupertino/segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/segmented_control.dart @@ -703,7 +703,7 @@ class _RenderSegmentedControl extends RenderBox } @override - bool hitTestChildren(HitTestResult result, {@required Offset position}) { + bool hitTestChildren(HitTestResult result, { @required Offset position }) { assert(position != null); RenderBox child = lastChild; while (child != null) { diff --git a/packages/flutter/lib/src/material/button.dart b/packages/flutter/lib/src/material/button.dart index 9bfe0e6c37..049e24fecf 100644 --- a/packages/flutter/lib/src/material/button.dart +++ b/packages/flutter/lib/src/material/button.dart @@ -324,7 +324,7 @@ class _RenderInputPadding extends RenderShiftedBox { } @override - bool hitTest(HitTestResult result, {Offset position}) { + bool hitTest(HitTestResult result, { Offset position }) { return super.hitTest(result, position: position) || child.hitTest(result, position: child.size.center(Offset.zero)); } diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 5f476b6499..c7ffc9f67b 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -1682,7 +1682,7 @@ class _RenderChipRedirectingHitDetection extends RenderConstrainedBox { _RenderChipRedirectingHitDetection(BoxConstraints additionalConstraints) : super(additionalConstraints: additionalConstraints); @override - bool hitTest(HitTestResult result, {Offset position}) { + bool hitTest(HitTestResult result, { Offset position }) { if (!size.contains(position)) return false; // Only redirects hit detection which occurs above and below the render object. @@ -2200,7 +2200,7 @@ class _RenderChip extends RenderBox { } @override - bool hitTest(HitTestResult result, {Offset position}) { + bool hitTest(HitTestResult result, { Offset position }) { if (!size.contains(position)) return false; RenderBox hitTestChild; diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart index af7a97c3c3..fb766ca913 100644 --- a/packages/flutter/lib/src/material/floating_action_button_location.dart +++ b/packages/flutter/lib/src/material/floating_action_button_location.dart @@ -352,7 +352,7 @@ abstract class FloatingActionButtonAnimator { /// [progress] is the current progress of the transition animation. /// When [progress] is 0.0, the returned [Offset] should be equal to [begin]. /// when [progress] is 1.0, the returned [Offset] should be equal to [end]. - Offset getOffset({@required Offset begin, @required Offset end, @required double progress}); + Offset getOffset({ @required Offset begin, @required Offset end, @required double progress }); /// Animates the scale of the [FloatingActionButton]. /// @@ -371,7 +371,7 @@ abstract class FloatingActionButtonAnimator { /// ); /// } /// ``` - Animation getScaleAnimation({@required Animation parent}); + Animation getScaleAnimation({ @required Animation parent }); /// Animates the rotation of [Scaffold.floatingActionButton]. /// @@ -389,7 +389,7 @@ abstract class FloatingActionButtonAnimator { /// return Tween(begin: 0.0, end: 1.0).animate(parent); /// } /// ``` - Animation getRotationAnimation({@required Animation parent}); + Animation getRotationAnimation({ @required Animation parent }); /// Gets the progress value to restart a motion animation from when the animation is interrupted. /// @@ -413,7 +413,7 @@ class _ScalingFabMotionAnimator extends FloatingActionButtonAnimator { const _ScalingFabMotionAnimator(); @override - Offset getOffset({Offset begin, Offset end, double progress}) { + Offset getOffset({ Offset begin, Offset end, double progress }) { if (progress < 0.5) { return begin; } else { @@ -422,7 +422,7 @@ class _ScalingFabMotionAnimator extends FloatingActionButtonAnimator { } @override - Animation getScaleAnimation({Animation parent}) { + Animation getScaleAnimation({ Animation parent }) { // Animate the scale down from 1 to 0 in the first half of the animation // then from 0 back to 1 in the second half. const Curve curve = Interval(0.5, 1.0, curve: Curves.ease); @@ -444,7 +444,7 @@ class _ScalingFabMotionAnimator extends FloatingActionButtonAnimator { static final Animatable _thresholdCenterTween = CurveTween(curve: const Threshold(0.5)); @override - Animation getRotationAnimation({Animation parent}) { + Animation getRotationAnimation({ Animation parent }) { // This rotation will turn on the way in, but not on the way out. return _AnimationSwap( parent.drive(_rotationTween), diff --git a/packages/flutter/lib/src/material/input_border.dart b/packages/flutter/lib/src/material/input_border.dart index 2c772cfcf1..fbfa167f50 100644 --- a/packages/flutter/lib/src/material/input_border.dart +++ b/packages/flutter/lib/src/material/input_border.dart @@ -71,11 +71,13 @@ abstract class InputBorder extends ShapeBorder { /// [gapExtent] parameters define a floating label width interval, and /// [gapPercentage] defines the animation's progress (0.0 to 1.0). @override - void paint(Canvas canvas, Rect rect, { - double gapStart, - double gapExtent = 0.0, - double gapPercentage = 0.0, - TextDirection textDirection, + void paint( + Canvas canvas, + Rect rect, { + double gapStart, + double gapExtent = 0.0, + double gapPercentage = 0.0, + TextDirection textDirection, }); } @@ -106,11 +108,13 @@ class _NoInputBorder extends InputBorder { } @override - void paint(Canvas canvas, Rect rect, { - double gapStart, - double gapExtent = 0.0, - double gapPercentage = 0.0, - TextDirection textDirection, + void paint( + Canvas canvas, + Rect rect, { + double gapStart, + double gapExtent = 0.0, + double gapPercentage = 0.0, + TextDirection textDirection, }) { // Do not paint. } @@ -217,11 +221,13 @@ class UnderlineInputBorder extends InputBorder { /// The [borderSide] defines the line's color and weight. The `textDirection` /// `gap` and `textDirection` parameters are ignored. @override - void paint(Canvas canvas, Rect rect, { - double gapStart, - double gapExtent = 0.0, - double gapPercentage = 0.0, - TextDirection textDirection, + void paint( + Canvas canvas, + Rect rect, { + double gapStart, + double gapExtent = 0.0, + double gapPercentage = 0.0, + TextDirection textDirection, }) { if (borderRadius.bottomLeft != Radius.zero || borderRadius.bottomRight != Radius.zero) canvas.clipPath(getOuterPath(rect, textDirection: textDirection)); @@ -447,11 +453,13 @@ class OutlineInputBorder extends InputBorder { /// `gapStart - gapPadding` (assuming that the [textDirection] is [TextDirection.ltr]). /// The gap's width is `(gapPadding + gapExtent + gapPadding) * gapPercentage`. @override - void paint(Canvas canvas, Rect rect, { - double gapStart, - double gapExtent = 0.0, - double gapPercentage = 0.0, - TextDirection textDirection, + void paint( + Canvas canvas, + Rect rect, { + double gapStart, + double gapExtent = 0.0, + double gapPercentage = 0.0, + TextDirection textDirection, }) { assert(gapExtent != null); assert(gapPercentage >= 0.0 && gapPercentage <= 1.0); diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index 7e2248ba73..2550de41ac 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -95,7 +95,7 @@ abstract class MaterialLocalizations { /// there are, e.g. 'Tab 1 of 2' in United States English. /// /// `tabIndex` and `tabCount` must be greater than or equal to one. - String tabLabel({int tabIndex, int tabCount}); + String tabLabel({ int tabIndex, int tabCount }); /// Title for the [PaginatedDataTable]'s selected row count header. String selectedRowCountTitle(int selectedRowCount); @@ -599,7 +599,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { String get rowsPerPageTitle => 'Rows per page:'; @override - String tabLabel({int tabIndex, int tabCount}) { + String tabLabel({ int tabIndex, int tabCount }) { assert(tabIndex >= 1); assert(tabCount >= 1); return 'Tab $tabIndex of $tabCount'; diff --git a/packages/flutter/lib/src/material/page.dart b/packages/flutter/lib/src/material/page.dart index 1dc004e211..d76af283a2 100644 --- a/packages/flutter/lib/src/material/page.dart +++ b/packages/flutter/lib/src/material/page.dart @@ -79,8 +79,11 @@ class MaterialPageRoute extends PageRoute { } @override - Widget buildPage(BuildContext context, Animation animation, - Animation secondaryAnimation) { + Widget buildPage( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) { final Widget result = builder(context); assert(() { if (result == null) { diff --git a/packages/flutter/lib/src/material/reorderable_list.dart b/packages/flutter/lib/src/material/reorderable_list.dart index 81dc9c3023..3890f4f599 100644 --- a/packages/flutter/lib/src/material/reorderable_list.dart +++ b/packages/flutter/lib/src/material/reorderable_list.dart @@ -328,7 +328,7 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T // Wraps children in Row or Column, so that the children flow in // the widget's scrollDirection. - Widget _buildContainerForScrollDirection({List children}) { + Widget _buildContainerForScrollDirection({ List children }) { switch (widget.scrollDirection) { case Axis.horizontal: return Row(children: children); diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 1e0759dbb4..f9b8d598e2 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -1692,7 +1692,10 @@ class ScaffoldState extends State with TickerProviderStateMixin { super.dispose(); } - void _addIfNonNull(List children, Widget child, Object childId, { + void _addIfNonNull( + List children, + Widget child, + Object childId, { @required bool removeLeftPadding, @required bool removeTopPadding, @required bool removeRightPadding, diff --git a/packages/flutter/lib/src/material/search.dart b/packages/flutter/lib/src/material/search.dart index ec33ce36cf..52e26091b0 100644 --- a/packages/flutter/lib/src/material/search.dart +++ b/packages/flutter/lib/src/material/search.dart @@ -309,10 +309,10 @@ class _SearchPageRoute extends PageRoute { @override Widget buildPage( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) { + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) { return _SearchPage( delegate: delegate, animation: animation, diff --git a/packages/flutter/lib/src/material/tab_indicator.dart b/packages/flutter/lib/src/material/tab_indicator.dart index d0ca571526..1a7b6e866b 100644 --- a/packages/flutter/lib/src/material/tab_indicator.dart +++ b/packages/flutter/lib/src/material/tab_indicator.dart @@ -58,7 +58,7 @@ class UnderlineTabIndicator extends Decoration { } @override - _UnderlinePainter createBoxPainter([VoidCallback onChanged]) { + _UnderlinePainter createBoxPainter([ VoidCallback onChanged ]) { return _UnderlinePainter(this, onChanged); } } diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index 6619290aef..52238f9be0 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -25,17 +25,15 @@ export 'package:flutter/services.dart' show TextInputType, TextInputAction, Text /// Signature for the [TextField.buildCounter] callback. typedef InputCounterWidgetBuilder = Widget Function( /// The build context for the TextField - BuildContext context, - { - /// The length of the string currently in the input. - @required int currentLength, - /// The maximum string length that can be entered into the TextField. - @required int maxLength, - /// Whether or not the TextField is currently focused. Mainly provided for - /// the [liveRegion] parameter in the [Semantics] widget for accessibility. - @required bool isFocused, - } -); + BuildContext context, { + /// The length of the string currently in the input. + @required int currentLength, + /// The maximum string length that can be entered into the TextField. + @required int maxLength, + /// Whether or not the TextField is currently focused. Mainly provided for + /// the [liveRegion] parameter in the [Semantics] widget for accessibility. + @required bool isFocused, +}); /// A material design text field. /// diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 39d7c13ba0..8a2952dd5c 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -454,8 +454,10 @@ _TimePickerHeaderFormat _buildHeaderFormat(TimeOfDayFormat timeOfDayFormat, _Tim } // Convenience function for creating a time header format with up to two pieces. - _TimePickerHeaderFormat format(_TimePickerHeaderPiece piece1, - [ _TimePickerHeaderPiece piece2 ]) { + _TimePickerHeaderFormat format( + _TimePickerHeaderPiece piece1, [ + _TimePickerHeaderPiece piece2, + ]) { final List<_TimePickerHeaderPiece> pieces = <_TimePickerHeaderPiece>[]; switch (context.textDirection) { case TextDirection.ltr: @@ -480,8 +482,13 @@ _TimePickerHeaderFormat _buildHeaderFormat(TimeOfDayFormat timeOfDayFormat, _Tim } // Convenience function for creating a time header piece with up to three fragments. - _TimePickerHeaderPiece piece({ int pivotIndex = -1, double bottomMargin = 0.0, - _TimePickerHeaderFragment fragment1, _TimePickerHeaderFragment fragment2, _TimePickerHeaderFragment fragment3 }) { + _TimePickerHeaderPiece piece({ + int pivotIndex = -1, + double bottomMargin = 0.0, + _TimePickerHeaderFragment fragment1, + _TimePickerHeaderFragment fragment2, + _TimePickerHeaderFragment fragment3, + }) { final List<_TimePickerHeaderFragment> fragments = <_TimePickerHeaderFragment>[fragment1]; if (fragment2 != null) { fragments.add(fragment2); diff --git a/packages/flutter/lib/src/painting/borders.dart b/packages/flutter/lib/src/painting/borders.dart index 40d4f5476a..b944a44dfa 100644 --- a/packages/flutter/lib/src/painting/borders.dart +++ b/packages/flutter/lib/src/painting/borders.dart @@ -652,7 +652,9 @@ class _CompoundBorder extends ShapeBorder { /// * [Border], which uses this function to paint its border when the border is /// not uniform. /// * [BoxDecoration], which describes its border using the [Border] class. -void paintBorder(Canvas canvas, Rect rect, { +void paintBorder( + Canvas canvas, + Rect rect, { BorderSide top = BorderSide.none, BorderSide right = BorderSide.none, BorderSide bottom = BorderSide.none, diff --git a/packages/flutter/lib/src/painting/box_border.dart b/packages/flutter/lib/src/painting/box_border.dart index 1c6d38ab23..e367d7af2b 100644 --- a/packages/flutter/lib/src/painting/box_border.dart +++ b/packages/flutter/lib/src/painting/box_border.dart @@ -196,7 +196,9 @@ abstract class BoxBorder extends ShapeBorder { /// /// * [paintBorder], which is used if the border is not uniform. @override - void paint(Canvas canvas, Rect rect, { + void paint( + Canvas canvas, + Rect rect, { TextDirection textDirection, BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, @@ -466,7 +468,9 @@ class Border extends BoxBorder { /// /// * [paintBorder], which is used if the border is not uniform. @override - void paint(Canvas canvas, Rect rect, { + void paint( + Canvas canvas, + Rect rect, { TextDirection textDirection, BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, @@ -759,7 +763,9 @@ class BorderDirectional extends BoxBorder { /// /// * [paintBorder], which is used if the border is not uniform. @override - void paint(Canvas canvas, Rect rect, { + void paint( + Canvas canvas, + Rect rect, { TextDirection textDirection, BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, diff --git a/packages/flutter/lib/src/painting/box_decoration.dart b/packages/flutter/lib/src/painting/box_decoration.dart index 3137c33c21..9777628537 100644 --- a/packages/flutter/lib/src/painting/box_decoration.dart +++ b/packages/flutter/lib/src/painting/box_decoration.dart @@ -326,7 +326,7 @@ class BoxDecoration extends Decoration { } @override - _BoxDecorationPainter createBoxPainter([VoidCallback onChanged]) { + _BoxDecorationPainter createBoxPainter([ VoidCallback onChanged ]) { assert(onChanged != null || image == null); return _BoxDecorationPainter(this, onChanged); } diff --git a/packages/flutter/lib/src/painting/continuous_rectangle_border.dart b/packages/flutter/lib/src/painting/continuous_rectangle_border.dart index 53f6a8311a..0a314ec64f 100644 --- a/packages/flutter/lib/src/painting/continuous_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/continuous_rectangle_border.dart @@ -123,17 +123,17 @@ class ContinuousRectangleBorder extends ShapeBorder { } @override - Path getInnerPath(Rect rect, {TextDirection textDirection}) { + Path getInnerPath(Rect rect, { TextDirection textDirection }) { return _getPath(borderRadius.resolve(textDirection).toRRect(rect).deflate(side.width)); } @override - Path getOuterPath(Rect rect, {TextDirection textDirection}) { + Path getOuterPath(Rect rect, { TextDirection textDirection }) { return _getPath(borderRadius.resolve(textDirection).toRRect(rect)); } @override - void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) { + void paint(Canvas canvas, Rect rect, { TextDirection textDirection }) { if (rect.isEmpty) return; switch (side.style) { diff --git a/packages/flutter/lib/src/painting/decoration.dart b/packages/flutter/lib/src/painting/decoration.dart index 6321446540..0ea8743ee2 100644 --- a/packages/flutter/lib/src/painting/decoration.dart +++ b/packages/flutter/lib/src/painting/decoration.dart @@ -164,7 +164,7 @@ abstract class Decoration extends Diagnosticable { /// The `onChanged` argument configures [BoxPainter.onChanged]. It can be /// omitted if there is no chance that the painter will change (for example, /// if it is a [BoxDecoration] with definitely no [DecorationImage]). - BoxPainter createBoxPainter([VoidCallback onChanged]); + BoxPainter createBoxPainter([ VoidCallback onChanged ]); } /// A stateful class that can paint a particular [Decoration]. diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart index 9ff3269e48..4c16dcd30b 100644 --- a/packages/flutter/lib/src/painting/edge_insets.dart +++ b/packages/flutter/lib/src/painting/edge_insets.dart @@ -588,7 +588,7 @@ class EdgeInsets extends EdgeInsetsGeometry { double top, double right, double bottom, -}) { + }) { return EdgeInsets.only( left: left ?? this.left, top: top ?? this.top, diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index 2b7bddd2c8..8811f7004a 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -200,7 +200,7 @@ class FlutterLogoDecoration extends Decoration { bool hitTest(Size size, Offset position, { TextDirection textDirection }) => true; @override - BoxPainter createBoxPainter([VoidCallback onChanged]) { + BoxPainter createBoxPainter([ VoidCallback onChanged ]) { assert(debugAssertIsValid()); return _FlutterLogoPainter(this); } diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index 1a2845ce04..0b9cb081de 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -343,7 +343,7 @@ abstract class ImageProvider { /// } /// ``` /// {@end-tool} - Future evict({ImageCache cache, ImageConfiguration configuration = ImageConfiguration.empty}) async { + Future evict({ ImageCache cache, ImageConfiguration configuration = ImageConfiguration.empty }) async { cache ??= imageCache; final T key = await obtainKey(configuration); return cache.evict(key); diff --git a/packages/flutter/lib/src/painting/shape_decoration.dart b/packages/flutter/lib/src/painting/shape_decoration.dart index 863809998e..e0212230bb 100644 --- a/packages/flutter/lib/src/painting/shape_decoration.dart +++ b/packages/flutter/lib/src/painting/shape_decoration.dart @@ -275,7 +275,7 @@ class ShapeDecoration extends Decoration { } @override - _ShapeDecorationPainter createBoxPainter([VoidCallback onChanged]) { + _ShapeDecorationPainter createBoxPainter([ VoidCallback onChanged ]) { assert(onChanged != null || image == null); return _ShapeDecorationPainter(this, onChanged); } diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index 0d8da07288..d020b9aa79 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -226,7 +226,7 @@ class TextPainter { ui.Paragraph _layoutTemplate; - ui.ParagraphStyle _createParagraphStyle([TextDirection defaultTextDirection]) { + ui.ParagraphStyle _createParagraphStyle([ TextDirection defaultTextDirection ]) { // The defaultTextDirection argument is used for preferredLineHeight in case // textDirection hasn't yet been set. assert(textAlign != null); diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 7cfc700939..04e06d09c7 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -807,18 +807,18 @@ class TextStyle extends Diagnosticable { /// If the font size on this style isn't set, it will default to 14 logical /// pixels. ui.ParagraphStyle getParagraphStyle({ - TextAlign textAlign, - TextDirection textDirection, - double textScaleFactor = 1.0, - String ellipsis, - int maxLines, - Locale locale, - String fontFamily, - double fontSize, - FontWeight fontWeight, - FontStyle fontStyle, - double height, - StrutStyle strutStyle, + TextAlign textAlign, + TextDirection textDirection, + double textScaleFactor = 1.0, + String ellipsis, + int maxLines, + Locale locale, + String fontFamily, + double fontSize, + FontWeight fontWeight, + FontStyle fontStyle, + double height, + StrutStyle strutStyle, }) { assert(textScaleFactor != null); assert(maxLines == null || maxLines > 0); diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index e297305223..f6f9bcd40e 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -247,14 +247,14 @@ class BoxConstraints extends Constraints { /// Returns the width that both satisfies the constraints and is as close as /// possible to the given width. - double constrainWidth([double width = double.infinity]) { + double constrainWidth([ double width = double.infinity ]) { assert(debugAssertIsValid()); return width.clamp(minWidth, maxWidth); } /// Returns the height that both satisfies the constraints and is as close as /// possible to the given height. - double constrainHeight([double height = double.infinity]) { + double constrainHeight([ double height = double.infinity ]) { assert(debugAssertIsValid()); return height.clamp(minHeight, maxHeight); } diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index 08a8f9b1fc..3c7bc8ea8d 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -1246,7 +1246,7 @@ class RenderEditable extends RenderBox { /// If you have a [TextEditingController], it's generally easier to /// programmatically manipulate its `value` or `selection` directly. /// {@endtemplate} - void selectPosition({@required SelectionChangedCause cause}) { + void selectPosition({ @required SelectionChangedCause cause }) { assert(cause != null); _layoutText(constraints.maxWidth); assert(_lastTapDownPosition != null); @@ -1259,7 +1259,7 @@ class RenderEditable extends RenderBox { /// Select a word around the location of the last tap down. /// /// {@macro flutter.rendering.editable.select} - void selectWord({@required SelectionChangedCause cause}) { + void selectWord({ @required SelectionChangedCause cause }) { selectWordsInRange(from: _lastTapDownPosition, cause: cause); } @@ -1269,7 +1269,7 @@ class RenderEditable extends RenderBox { /// beginning and end of a word respectively. /// /// {@macro flutter.rendering.editable.select} - void selectWordsInRange({@required Offset from, Offset to, @required SelectionChangedCause cause}) { + void selectWordsInRange({ @required Offset from, Offset to, @required SelectionChangedCause cause }) { assert(cause != null); _layoutText(constraints.maxWidth); if (onSelectionChanged != null) { @@ -1291,7 +1291,7 @@ class RenderEditable extends RenderBox { /// Move the selection to the beginning or end of a word. /// /// {@macro flutter.rendering.editable.select} - void selectWordEdge({@required SelectionChangedCause cause}) { + void selectWordEdge({ @required SelectionChangedCause cause }) { assert(cause != null); _layoutText(constraints.maxWidth); assert(_lastTapDownPosition != null); diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index 4e06e80f97..f5e22df3fb 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -175,7 +175,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin { /// Return the engine layer for retained rendering. When there's no /// corresponding engine layer, null is returned. @protected - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]); + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]); void _addToSceneWithRetainedRendering(ui.SceneBuilder builder) { // There can't be a loop by adding a retained layer subtree whose @@ -276,7 +276,7 @@ class PictureLayer extends Layer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { builder.addPicture(layerOffset, picture, isComplexHint: isComplexHint, willChangeHint: willChangeHint); return null; // this does not return an engine layer yet. } @@ -344,7 +344,7 @@ class TextureLayer extends Layer { final bool freeze; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { final Rect shiftedRect = rect.shift(layerOffset); builder.addTexture( textureId, @@ -381,7 +381,7 @@ class PlatformViewLayer extends Layer { final int viewId; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { final Rect shiftedRect = rect.shift(layerOffset); builder.addPlatformView( viewId, @@ -456,7 +456,7 @@ class PerformanceOverlayLayer extends Layer { final bool checkerboardOffscreenLayers; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { assert(optionsMask != null); builder.addPerformanceOverlay(optionsMask, overlayRect.shift(layerOffset)); builder.setRasterizerTracingThreshold(rasterizerThreshold); @@ -617,7 +617,7 @@ class ContainerLayer extends Layer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { addChildrenToScene(builder, layerOffset); return null; // ContainerLayer does not have a corresponding engine layer } @@ -629,7 +629,7 @@ class ContainerLayer extends Layer { /// to apply effects to the scene using the [SceneBuilder] API, then insert /// their children using [addChildrenToScene], then reverse the aforementioned /// effects before returning from [addToScene]. - void addChildrenToScene(ui.SceneBuilder builder, [Offset childOffset = Offset.zero]) { + void addChildrenToScene(ui.SceneBuilder builder, [ Offset childOffset = Offset.zero ]) { Layer child = firstChild; while (child != null) { if (childOffset == Offset.zero) { @@ -750,7 +750,7 @@ class OffsetLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { // Skia has a fast path for concatenating scale/translation only matrices. // Hence pushing a translation-only transform layer should be fast. For // retained rendering, we don't want to push the offset down to each leaf @@ -784,7 +784,7 @@ class OffsetLayer extends ContainerLayer { /// /// * [RenderRepaintBoundary.toImage] for a similar API at the render object level. /// * [dart:ui.Scene.toImage] for more information about the image returned. - Future toImage(Rect bounds, {double pixelRatio = 1.0}) async { + Future toImage(Rect bounds, { double pixelRatio = 1.0 }) async { assert(bounds != null); assert(pixelRatio != null); final ui.SceneBuilder builder = ui.SceneBuilder(); @@ -864,7 +864,7 @@ class ClipRectLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { bool enabled = true; assert(() { enabled = !debugDisableClipLayers; @@ -936,7 +936,7 @@ class ClipRRectLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { bool enabled = true; assert(() { enabled = !debugDisableClipLayers; @@ -1008,7 +1008,7 @@ class ClipPathLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { bool enabled = true; assert(() { enabled = !debugDisableClipLayers; @@ -1060,7 +1060,7 @@ class TransformLayer extends OffsetLayer { bool _inverseDirty = true; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { _lastEffectiveTransform = transform; final Offset totalOffset = offset + layerOffset; if (totalOffset != Offset.zero) { @@ -1143,7 +1143,7 @@ class OpacityLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { bool enabled = true; assert(() { enabled = !debugDisableOpacityLayers; @@ -1219,7 +1219,7 @@ class ShaderMaskLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { builder.pushShaderMask(shader, maskRect.shift(layerOffset), blendMode); addChildrenToScene(builder, layerOffset); builder.pop(); @@ -1257,7 +1257,7 @@ class BackdropFilterLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { builder.pushBackdropFilter(filter); addChildrenToScene(builder, layerOffset); builder.pop(); @@ -1369,7 +1369,7 @@ class PhysicalModelLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { ui.EngineLayer engineLayer; bool enabled = true; assert(() { @@ -1484,7 +1484,7 @@ class LeaderLayer extends ContainerLayer { } @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { assert(offset != null); _lastOffset = offset + layerOffset; if (_lastOffset != Offset.zero) @@ -1702,7 +1702,7 @@ class FollowerLayer extends ContainerLayer { bool get alwaysNeedsAddToScene => true; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { assert(link != null); assert(showWhenUnlinked != null); if (link.leader == null && !showWhenUnlinked) { diff --git a/packages/flutter/lib/src/rendering/list_wheel_viewport.dart b/packages/flutter/lib/src/rendering/list_wheel_viewport.dart index 66f3631dc3..2386cf3a1d 100644 --- a/packages/flutter/lib/src/rendering/list_wheel_viewport.dart +++ b/packages/flutter/lib/src/rendering/list_wheel_viewport.dart @@ -42,7 +42,7 @@ abstract class ListWheelChildManager { /// nothing. /// /// It is possible to create children with negative indices. - void createChild(int index, {@required RenderBox after}); + void createChild(int index, { @required RenderBox after }); /// Removes the child element corresponding with the given RenderBox. void removeChild(RenderBox child); @@ -572,7 +572,7 @@ class RenderListWheelViewport /// Returns the scroll offset of the child with the given index. double indexToScrollOffset(int index) => index * itemExtent; - void _createChild(int index, {RenderBox after}) { + void _createChild(int index, { RenderBox after }) { invokeLayoutCallback((BoxConstraints constraints) { assert(constraints == this.constraints); childManager.createChild(index, after: after); @@ -804,12 +804,12 @@ class RenderListWheelViewport /// Paint child with the magnifier active - the child will be rendered /// differently if it intersects with the magnifier. void _paintChildWithMagnifier( - PaintingContext context, - Offset offset, - RenderBox child, - Matrix4 cylindricalTransform, - Offset offsetToCenter, - Offset untransformedPaintingCoordinates, + PaintingContext context, + Offset offset, + RenderBox child, + Matrix4 cylindricalTransform, + Offset offsetToCenter, + Offset untransformedPaintingCoordinates, ) { final double magnifierTopLinePosition = size.height / 2 - _itemExtent * _magnification / 2; @@ -884,11 +884,11 @@ class RenderListWheelViewport // / Paint the child cylindrically at given offset. void _paintChildCylindrically( - PaintingContext context, - Offset offset, - RenderBox child, - Matrix4 cylindricalTransform, - Offset offsetToCenter, + PaintingContext context, + Offset offset, + RenderBox child, + Matrix4 cylindricalTransform, + Offset offsetToCenter, ) { context.pushTransform( // Text with TransformLayers and no cullRects currently have an issue rendering @@ -952,7 +952,7 @@ class RenderListWheelViewport } @override - RevealedOffset getOffsetToReveal(RenderObject target, double alignment, {Rect rect}) { + RevealedOffset getOffsetToReveal(RenderObject target, double alignment, { Rect rect }) { // `target` is only fully revealed when in the selected/center position. Therefore, // this method always returns the offset that shows `target` in the center position, // which is the same offset for all `alignment` values. diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index a96ae36d18..a6520b1fdc 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -388,7 +388,7 @@ class PaintingContext extends ClipContext { /// * `painter` is a callback that will paint with the [clipRect] applied. This /// function calls the [painter] synchronously. /// * `clipBehavior` controls how the rectangle is clipped. - void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.hardEdge}) { + void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.hardEdge }) { final Rect offsetClipRect = clipRect.shift(offset); if (needsCompositing) { pushLayer(ClipRectLayer(clipRect: offsetClipRect, clipBehavior: clipBehavior), painter, offset, childPaintBounds: offsetClipRect); @@ -410,7 +410,7 @@ class PaintingContext extends ClipContext { /// * `painter` is a callback that will paint with the `clipRRect` applied. This /// function calls the `painter` synchronously. /// * `clipBehavior` controls how the path is clipped. - void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { + void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias }) { assert(clipBehavior != null); final Rect offsetBounds = bounds.shift(offset); final RRect offsetClipRRect = clipRRect.shift(offset); @@ -434,7 +434,7 @@ class PaintingContext extends ClipContext { /// * `painter` is a callback that will paint with the `clipPath` applied. This /// function calls the `painter` synchronously. /// * `clipBehavior` controls how the rounded rectangle is clipped. - void pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { + void pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias }) { assert(clipBehavior != null); final Rect offsetBounds = bounds.shift(offset); final Path offsetClipPath = clipPath.shift(offset); @@ -2537,9 +2537,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// to the tree. If new [SemanticsNode]s are instantiated in this method /// they must be disposed in [clearSemantics]. void assembleSemanticsNode( - SemanticsNode node, - SemanticsConfiguration config, - Iterable children, + SemanticsNode node, + SemanticsConfiguration config, + Iterable children, ) { assert(node == _semantics); node.updateWith(config: config, childrenInInversePaintOrder: children); @@ -3273,7 +3273,7 @@ class _RootSemanticsFragment extends _InterestingSemanticsFragment { }) : super(owner: owner, dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings); @override - Iterable compileChildren({Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment}) sync* { + Iterable compileChildren({ Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment }) sync* { assert(_tagsForChildren == null || _tagsForChildren.isEmpty); assert(parentSemanticsClipRect == null); assert(parentPaintClipRect == null); @@ -3363,7 +3363,7 @@ class _SwitchableSemanticsFragment extends _InterestingSemanticsFragment { final List<_InterestingSemanticsFragment> _children = <_InterestingSemanticsFragment>[]; @override - Iterable compileChildren({Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment}) sync* { + Iterable compileChildren({ Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment }) sync* { if (!_isExplicit) { owner._semantics = null; for (_InterestingSemanticsFragment fragment in _children) { @@ -3486,7 +3486,7 @@ class _AbortingSemanticsFragment extends _InterestingSemanticsFragment { } @override - Iterable compileChildren({Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment}) sync* { + Iterable compileChildren({ Rect parentSemanticsClipRect, Rect parentPaintClipRect, double elevationAdjustment }) sync* { yield owner._semantics; } diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 516d32b6c6..b9591d10ee 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -2120,14 +2120,14 @@ class RenderTransform extends RenderProxyBox { } /// Concatenates a translation by (x, y, z) into the transform. - void translate(double x, [double y = 0.0, double z = 0.0]) { + void translate(double x, [ double y = 0.0, double z = 0.0 ]) { _transform.translate(x, y, z); markNeedsPaint(); markNeedsSemanticsUpdate(); } /// Concatenates a scale into the transform. - void scale(double x, [double y, double z]) { + void scale(double x, [ double y, double z ]) { _transform.scale(x, y, z); markNeedsPaint(); markNeedsSemanticsUpdate(); @@ -2765,7 +2765,7 @@ class RenderRepaintBoundary extends RenderProxyBox { /// /// * [OffsetLayer.toImage] for a similar API at the layer level. /// * [dart:ui.Scene.toImage] for more information about the image returned. - Future toImage({double pixelRatio = 1.0}) { + Future toImage({ double pixelRatio = 1.0 }) { assert(!debugNeedsPaint); return layer.toImage(Offset.zero & size, pixelRatio: pixelRatio); } diff --git a/packages/flutter/lib/src/rendering/sliver_fill.dart b/packages/flutter/lib/src/rendering/sliver_fill.dart index 60bb0526ec..89ca49725a 100644 --- a/packages/flutter/lib/src/rendering/sliver_fill.dart +++ b/packages/flutter/lib/src/rendering/sliver_fill.dart @@ -75,7 +75,8 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor { } @override - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, diff --git a/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart b/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart index 48a71a82a9..0ced41ea1b 100644 --- a/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart +++ b/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart @@ -93,7 +93,8 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda /// * [computeMaxScrollOffset], which is similar but must provide a precise /// value. @protected - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, diff --git a/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart b/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart index 453e9b4527..f2de999c8c 100644 --- a/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart +++ b/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart @@ -65,7 +65,8 @@ abstract class RenderSliverBoxChildManager { /// Must return the total distance from the start of the child with the /// earliest possible index to the end of the child with the last possible /// index. - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, @@ -370,7 +371,8 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver /// during this layout pass. No child should be added during that call except /// for the one that is created and returned by `createChild`. @protected - RenderBox insertAndLayoutLeadingChild(BoxConstraints childConstraints, { + RenderBox insertAndLayoutLeadingChild( + BoxConstraints childConstraints, { bool parentUsesSize = false, }) { assert(_debugAssertChildListLocked()); @@ -397,7 +399,8 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver /// Children after the `after` child may be removed in the process. Only the /// new child may be added. @protected - RenderBox insertAndLayoutChild(BoxConstraints childConstraints, { + RenderBox insertAndLayoutChild( + BoxConstraints childConstraints, { @required RenderBox after, bool parentUsesSize = false, }) { diff --git a/packages/flutter/lib/src/rendering/table_border.dart b/packages/flutter/lib/src/rendering/table_border.dart index 5913025b0d..d193cf57f4 100644 --- a/packages/flutter/lib/src/rendering/table_border.dart +++ b/packages/flutter/lib/src/rendering/table_border.dart @@ -192,7 +192,9 @@ class TableBorder { /// /// The paint order is particularly notable in the case of /// partially-transparent borders. - void paint(Canvas canvas, Rect rect, { + void paint( + Canvas canvas, + Rect rect, { @required Iterable rows, @required Iterable columns, }) { diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 69c06a2c4f..67648731cb 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -68,7 +68,7 @@ abstract class RenderAbstractViewport extends RenderObject { /// See also: /// /// * [RevealedOffset], which describes the return value of this method. - RevealedOffset getOffsetToReveal(RenderObject target, double alignment, {Rect rect}); + RevealedOffset getOffsetToReveal(RenderObject target, double alignment, { Rect rect }); /// The default value for the cache extent of the viewport. /// @@ -585,7 +585,7 @@ abstract class RenderViewportBase animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }); @@ -188,7 +189,8 @@ abstract class ViewportOffset extends ChangeNotifier { /// [clamp] parameter is ignored by this stub implementation but subclasses /// like [ScrollPosition] handle it by adjusting [to] to prevent over or /// underscroll. - Future moveTo(double to, { + Future moveTo( + double to, { Duration duration, Curve curve, bool clamp, @@ -273,7 +275,8 @@ class _FixedViewportOffset extends ViewportOffset { } @override - Future animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }) async { } diff --git a/packages/flutter/lib/src/scheduler/binding.dart b/packages/flutter/lib/src/scheduler/binding.dart index 9a2679b813..773b790643 100644 --- a/packages/flutter/lib/src/scheduler/binding.dart +++ b/packages/flutter/lib/src/scheduler/binding.dart @@ -296,7 +296,9 @@ mixin SchedulerBinding on BindingBase, ServicesBinding { /// [Priority.animation] won't run (at least, not with the /// [defaultSchedulingStrategy]; this can be configured using /// [schedulingStrategy]). - Future scheduleTask(TaskCallback task, Priority priority, { + Future scheduleTask( + TaskCallback task, + Priority priority, { String debugLabel, Flow flow, }) { diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index a5857828e0..ee8478ad9f 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -2500,7 +2500,7 @@ class SemanticsOwner extends ChangeNotifier { /// /// If the given `action` requires arguments they need to be passed in via /// the `args` parameter. - void performAction(int id, SemanticsAction action, [dynamic args]) { + void performAction(int id, SemanticsAction action, [ dynamic args ]) { assert(action != null); final _SemanticsActionHandler handler = _getSemanticsActionHandlerForId(id, action); if (handler != null) { @@ -2550,7 +2550,7 @@ class SemanticsOwner extends ChangeNotifier { /// /// If the given `action` requires arguments they need to be passed in via /// the `args` parameter. - void performActionAt(Offset position, SemanticsAction action, [dynamic args]) { + void performActionAt(Offset position, SemanticsAction action, [ dynamic args ]) { assert(action != null); final SemanticsNode node = rootSemanticsNode; if (node == null) diff --git a/packages/flutter/lib/src/services/message_codec.dart b/packages/flutter/lib/src/services/message_codec.dart index efe96b85f7..42bddffb54 100644 --- a/packages/flutter/lib/src/services/message_codec.dart +++ b/packages/flutter/lib/src/services/message_codec.dart @@ -81,7 +81,7 @@ abstract class MethodCodec { /// /// The specified error [code], human-readable error [message], and error /// [details] correspond to the fields of [PlatformException]. - ByteData encodeErrorEnvelope({@required String code, String message, dynamic details}); + ByteData encodeErrorEnvelope({ @required String code, String message, dynamic details }); } diff --git a/packages/flutter/lib/src/services/message_codecs.dart b/packages/flutter/lib/src/services/message_codecs.dart index 64e74c4984..8a658a44a0 100644 --- a/packages/flutter/lib/src/services/message_codecs.dart +++ b/packages/flutter/lib/src/services/message_codecs.dart @@ -160,7 +160,7 @@ class JSONMethodCodec implements MethodCodec { } @override - ByteData encodeErrorEnvelope({@required String code, String message, dynamic details}) { + ByteData encodeErrorEnvelope({ @required String code, String message, dynamic details }) { assert(code != null); return const JSONMessageCodec().encodeMessage([code, message, details]); } @@ -540,7 +540,7 @@ class StandardMethodCodec implements MethodCodec { } @override - ByteData encodeErrorEnvelope({@required String code, String message, dynamic details}) { + ByteData encodeErrorEnvelope({ @required String code, String message, dynamic details }) { final WriteBuffer buffer = WriteBuffer(); buffer.putUint8(1); messageCodec.writeValue(buffer, code); diff --git a/packages/flutter/lib/src/services/platform_channel.dart b/packages/flutter/lib/src/services/platform_channel.dart index bf80a47576..d5037bf6a9 100644 --- a/packages/flutter/lib/src/services/platform_channel.dart +++ b/packages/flutter/lib/src/services/platform_channel.dart @@ -290,7 +290,7 @@ class MethodChannel { /// * /// for how to access method call arguments on Android. @optionalTypeArgs - Future invokeMethod(String method, [dynamic arguments]) async { + Future invokeMethod(String method, [ dynamic arguments ]) async { assert(method != null); final ByteData result = await BinaryMessages.send( name, @@ -312,7 +312,7 @@ class MethodChannel { /// See also: /// /// * [invokeMethod], which this call delegates to. - Future> invokeListMethod(String method, [dynamic arguments]) async { + Future> invokeListMethod(String method, [ dynamic arguments ]) async { final List result = await invokeMethod>(method, arguments); return result.cast(); } @@ -326,7 +326,7 @@ class MethodChannel { /// See also: /// /// * [invokeMethod], which this call delegates to. - Future> invokeMapMethod(String method, [dynamic arguments]) async { + Future> invokeMapMethod(String method, [ dynamic arguments ]) async { final Map result = await invokeMethod>(method, arguments); return result.cast(); } @@ -405,7 +405,7 @@ class OptionalMethodChannel extends MethodChannel { : super(name, codec); @override - Future invokeMethod(String method, [dynamic arguments]) async { + Future invokeMethod(String method, [ dynamic arguments ]) async { try { final T result = await super.invokeMethod(method, arguments); return result; @@ -415,13 +415,13 @@ class OptionalMethodChannel extends MethodChannel { } @override - Future> invokeListMethod(String method, [dynamic arguments]) async { + Future> invokeListMethod(String method, [ dynamic arguments ]) async { final List result = await invokeMethod>(method, arguments); return result.cast(); } @override - Future> invokeMapMethod(String method, [dynamic arguments]) async { + Future> invokeMapMethod(String method, [ dynamic arguments ]) async { final Map result = await invokeMethod>(method, arguments); return result.cast(); } @@ -470,7 +470,7 @@ class EventChannel { /// through the [FlutterError] facility. Stream activation happens only when /// stream listener count changes from 0 to 1. Stream deactivation happens /// only when stream listener count changes from 1 to 0. - Stream receiveBroadcastStream([dynamic arguments]) { + Stream receiveBroadcastStream([ dynamic arguments ]) { final MethodChannel methodChannel = MethodChannel(name, codec); StreamController controller; controller = StreamController.broadcast(onListen: () async { diff --git a/packages/flutter/lib/src/services/platform_messages.dart b/packages/flutter/lib/src/services/platform_messages.dart index b1f7f8836b..5e83b911b8 100644 --- a/packages/flutter/lib/src/services/platform_messages.dart +++ b/packages/flutter/lib/src/services/platform_messages.dart @@ -65,7 +65,10 @@ class BinaryMessages { /// /// To register a handler for a given message channel, see [setMessageHandler]. static Future handlePlatformMessage( - String channel, ByteData data, ui.PlatformMessageResponseCallback callback) async { + String channel, + ByteData data, + ui.PlatformMessageResponseCallback callback, + ) async { ByteData response; try { final _MessageHandler handler = _handlers[channel]; diff --git a/packages/flutter/lib/src/services/raw_keyboard.dart b/packages/flutter/lib/src/services/raw_keyboard.dart index af3b5d5895..68740b1b0e 100644 --- a/packages/flutter/lib/src/services/raw_keyboard.dart +++ b/packages/flutter/lib/src/services/raw_keyboard.dart @@ -121,7 +121,7 @@ abstract class RawKeyEventData { /// side of the keyboard. Defaults to checking for the key being down on /// either side of the keyboard. If there is only one instance of the key on /// the keyboard, then [side] is ignored. - bool isModifierPressed(ModifierKey key, {KeyboardSide side = KeyboardSide.any}); + bool isModifierPressed(ModifierKey key, { KeyboardSide side = KeyboardSide.any }); /// Returns a [KeyboardSide] enum value that describes which side or sides of /// the given keyboard modifier key were pressed at the time of this event. diff --git a/packages/flutter/lib/src/services/raw_keyboard_android.dart b/packages/flutter/lib/src/services/raw_keyboard_android.dart index aed752b21c..2927501b26 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_android.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_android.dart @@ -170,7 +170,7 @@ class RawKeyEventDataAndroid extends RawKeyEventData { } @override - bool isModifierPressed(ModifierKey key, {KeyboardSide side = KeyboardSide.any}) { + bool isModifierPressed(ModifierKey key, { KeyboardSide side = KeyboardSide.any }) { assert(side != null); switch (key) { case ModifierKey.controlModifier: diff --git a/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart b/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart index 1f7498b306..2b23eb9888 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart @@ -111,7 +111,7 @@ class RawKeyEventDataFuchsia extends RawKeyEventData { } @override - bool isModifierPressed(ModifierKey key, {KeyboardSide side = KeyboardSide.any}) { + bool isModifierPressed(ModifierKey key, { KeyboardSide side = KeyboardSide.any }) { assert(side != null); switch (key) { case ModifierKey.controlModifier: diff --git a/packages/flutter/lib/src/services/text_formatter.dart b/packages/flutter/lib/src/services/text_formatter.dart index cb9e4e1a74..5d5392dbe0 100644 --- a/packages/flutter/lib/src/services/text_formatter.dart +++ b/packages/flutter/lib/src/services/text_formatter.dart @@ -54,8 +54,8 @@ abstract class TextInputFormatter { /// Function signature expected for creating custom [TextInputFormatter] /// shorthands via [TextInputFormatter.withFunction]; typedef TextInputFormatFunction = TextEditingValue Function( - TextEditingValue oldValue, - TextEditingValue newValue, + TextEditingValue oldValue, + TextEditingValue newValue, ); /// Wiring for [TextInputFormatter.withFunction]. diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index 45c1fbe47c..ea21fa86f0 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -321,7 +321,7 @@ class _AnimatedSwitcherState extends State with TickerProvider } } - void _addEntryForNewChild({@required bool animate}) { + void _addEntryForNewChild({ @required bool animate }) { assert(animate || _currentEntry == null); if (_currentEntry != null) { assert(animate); diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index bbe9944569..4674ab4670 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -839,7 +839,7 @@ class RenderObjectToWidgetAdapter extends RenderObjectWi /// the given element will have an update scheduled to switch to this widget. /// /// Used by [runApp] to bootstrap applications. - RenderObjectToWidgetElement attachToRenderTree(BuildOwner owner, [RenderObjectToWidgetElement element]) { + RenderObjectToWidgetElement attachToRenderTree(BuildOwner owner, [ RenderObjectToWidgetElement element ]) { if (element == null) { owner.lockState(() { element = createElement(); diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart index 6112042988..5059e3b3a9 100644 --- a/packages/flutter/lib/src/widgets/drag_target.dart +++ b/packages/flutter/lib/src/widgets/drag_target.dart @@ -678,7 +678,7 @@ class _DragAvatar extends Drag { _enteredTargets.clear(); } - void finishDrag(_DragEndKind endKind, [Velocity velocity]) { + void finishDrag(_DragEndKind endKind, [ Velocity velocity ]) { bool wasAccepted = false; if (endKind == _DragEndKind.dropped && _activeTarget != null) { _activeTarget.didDrop(this); diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index e388b30a79..f3aa9bee86 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -2223,7 +2223,7 @@ class BuildOwner { /// [debugPrintBuildScope] to true. This is useful when debugging problems /// involving widgets not getting marked dirty, or getting marked dirty too /// often. - void buildScope(Element context, [VoidCallback callback]) { + void buildScope(Element context, [ VoidCallback callback ]) { if (callback == null && _dirtyElements.isEmpty) return; assert(context != null); @@ -3689,7 +3689,7 @@ typedef TransitionBuilder = Widget Function(BuildContext context, Widget child); /// See also: /// /// * [WidgetBuilder], which is similar but only takes a [BuildContext]. -typedef ControlsWidgetBuilder = Widget Function(BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}); +typedef ControlsWidgetBuilder = Widget Function(BuildContext context, { VoidCallback onStepContinue, VoidCallback onStepCancel }); /// An [Element] that composes other [Element]s. /// diff --git a/packages/flutter/lib/src/widgets/icon_theme_data.dart b/packages/flutter/lib/src/widgets/icon_theme_data.dart index 61247ec777..7a123f0800 100644 --- a/packages/flutter/lib/src/widgets/icon_theme_data.dart +++ b/packages/flutter/lib/src/widgets/icon_theme_data.dart @@ -32,7 +32,7 @@ class IconThemeData extends Diagnosticable { /// Creates a copy of this icon theme but with the given fields replaced with /// the new values. - IconThemeData copyWith({Color color, double opacity, double size}) { + IconThemeData copyWith({ Color color, double opacity, double size }) { return IconThemeData( color: color ?? this.color, opacity: opacity ?? this.opacity, diff --git a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart index 2385cc81ed..c71246f352 100644 --- a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart @@ -254,7 +254,8 @@ class FixedExtentScrollController extends ScrollController { /// The returned [Future] resolves when the animation completes. /// /// The `duration` and `curve` arguments must not be null. - Future animateToItem(int itemIndex, { + Future animateToItem( + int itemIndex, { @required Duration duration, @required Curve curve, }) async { diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index a6b84577da..6a86bdbb11 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -1438,9 +1438,9 @@ class Navigator extends StatefulWidget { /// instances of [Navigator]. static NavigatorState of( BuildContext context, { - bool rootNavigator = false, - bool nullOk = false, - }) { + bool rootNavigator = false, + bool nullOk = false, + }) { final NavigatorState navigator = rootNavigator ? context.rootAncestorStateOfType(const TypeMatcher()) : context.ancestorStateOfType(const TypeMatcher()); diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index 839cbe4b8e..4dc7cdcd2b 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -713,7 +713,8 @@ class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldCont _outerPosition.updateCanDrag(maxInnerExtent); } - Future animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }) async { @@ -1057,7 +1058,8 @@ class _NestedScrollPosition extends ScrollPosition implements ScrollActivityDele )); } - ScrollActivity createBallisticScrollActivity(Simulation simulation, { + ScrollActivity createBallisticScrollActivity( + Simulation simulation, { @required _NestedBallisticScrollActivityMode mode, _NestedScrollMetrics metrics, }) { @@ -1079,7 +1081,8 @@ class _NestedScrollPosition extends ScrollPosition implements ScrollActivityDele } @override - Future animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }) { diff --git a/packages/flutter/lib/src/widgets/page_view.dart b/packages/flutter/lib/src/widgets/page_view.dart index d4509b1b0c..9f8256dbfc 100644 --- a/packages/flutter/lib/src/widgets/page_view.dart +++ b/packages/flutter/lib/src/widgets/page_view.dart @@ -112,7 +112,8 @@ class PageController extends ScrollController { /// The returned [Future] resolves when the animation completes. /// /// The `duration` and `curve` arguments must not be null. - Future animateToPage(int page, { + Future animateToPage( + int page, { @required Duration duration, @required Curve curve, }) { diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index cf00273a30..2ab046f481 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -883,10 +883,10 @@ abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute animation, - Animation secondaryAnimation, - Widget child, + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, ) { return child; } diff --git a/packages/flutter/lib/src/widgets/scroll_controller.dart b/packages/flutter/lib/src/widgets/scroll_controller.dart index 8b1ca31971..59c67248b6 100644 --- a/packages/flutter/lib/src/widgets/scroll_controller.dart +++ b/packages/flutter/lib/src/widgets/scroll_controller.dart @@ -142,7 +142,8 @@ class ScrollController extends ChangeNotifier { /// /// The duration must not be zero. To jump to a particular value without an /// animation, use [jumpTo]. - Future animateTo(double offset, { + Future animateTo( + double offset, { @required Duration duration, @required Curve curve, }) { diff --git a/packages/flutter/lib/src/widgets/scroll_position.dart b/packages/flutter/lib/src/widgets/scroll_position.dart index 0b294f6ef3..bf6661ccfb 100644 --- a/packages/flutter/lib/src/widgets/scroll_position.dart +++ b/packages/flutter/lib/src/widgets/scroll_position.dart @@ -488,7 +488,8 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// Animates the position such that the given object is as visible as possible /// by just scrolling this position. - Future ensureVisible(RenderObject object, { + Future ensureVisible( + RenderObject object, { double alignment = 0.0, Duration duration = Duration.zero, Curve curve = Curves.ease, @@ -545,7 +546,8 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// /// The animation is typically handled by an [DrivenScrollActivity]. @override - Future animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }); @@ -570,7 +572,8 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// /// If [animateTo] is called then [curve] defaults to [Curves.ease]. @override - Future moveTo(double to, { + Future moveTo( + double to, { Duration duration, Curve curve, bool clamp = true, diff --git a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart index 68c36b7009..6c39b2b9cf 100644 --- a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart +++ b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart @@ -170,7 +170,8 @@ class ScrollPositionWithSingleContext extends ScrollPosition implements ScrollAc } @override - Future animateTo(double to, { + Future animateTo( + double to, { @required Duration duration, @required Curve curve, }) { diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index f0f723dcc0..eeabba0c1a 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -231,7 +231,8 @@ class Scrollable extends StatefulWidget { /// Scrolls the scrollables that enclose the given context so as to make the /// given context visible. - static Future ensureVisible(BuildContext context, { + static Future ensureVisible( + BuildContext context, { double alignment = 0.0, Duration duration = Duration.zero, Curve curve = Curves.ease, diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart index 4f9419ffe1..65b59bda3e 100644 --- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart @@ -564,7 +564,7 @@ class _RenderSingleChildViewport extends RenderBox with RenderObjectWithChildMix } @override - RevealedOffset getOffsetToReveal(RenderObject target, double alignment, {Rect rect}) { + RevealedOffset getOffsetToReveal(RenderObject target, double alignment, { Rect rect }) { rect ??= target.paintBounds; if (target is! RenderBox) return RevealedOffset(offset: offset.pixels, rect: rect); diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index 4f51d41818..8bbe840c2b 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -1081,7 +1081,8 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render } @override - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, diff --git a/packages/flutter/lib/src/widgets/text_selection.dart b/packages/flutter/lib/src/widgets/text_selection.dart index 0351213261..40c39c7c9b 100644 --- a/packages/flutter/lib/src/widgets/text_selection.dart +++ b/packages/flutter/lib/src/widgets/text_selection.dart @@ -348,7 +348,7 @@ class TextSelectionOverlay { _markNeedsBuild(); } - void _markNeedsBuild([Duration duration]) { + void _markNeedsBuild([ Duration duration ]) { if (_handles != null) { _handles[0].markNeedsBuild(); _handles[1].markNeedsBuild(); diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index ffe9b3a966..01b7bc6d09 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -55,7 +55,7 @@ class _ProxyLayer extends Layer { final Layer _layer; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { return _layer.addToScene(builder, layerOffset); } @@ -79,19 +79,19 @@ class _MulticastCanvas implements Canvas { final Canvas _screenshot; @override - void clipPath(Path path, {bool doAntiAlias = true}) { + void clipPath(Path path, { bool doAntiAlias = true }) { _main.clipPath(path, doAntiAlias: doAntiAlias); _screenshot.clipPath(path, doAntiAlias: doAntiAlias); } @override - void clipRRect(RRect rrect, {bool doAntiAlias = true}) { + void clipRRect(RRect rrect, { bool doAntiAlias = true }) { _main.clipRRect(rrect, doAntiAlias: doAntiAlias); _screenshot.clipRRect(rrect, doAntiAlias: doAntiAlias); } @override - void clipRect(Rect rect, {ui.ClipOp clipOp = ui.ClipOp.intersect, bool doAntiAlias = true}) { + void clipRect(Rect rect, { ui.ClipOp clipOp = ui.ClipOp.intersect, bool doAntiAlias = true }) { _main.clipRect(rect, clipOp: clipOp, doAntiAlias: doAntiAlias); _screenshot.clipRect(rect, clipOp: clipOp, doAntiAlias: doAntiAlias); } @@ -256,7 +256,7 @@ class _MulticastCanvas implements Canvas { } @override - void scale(double sx, [double sy]) { + void scale(double sx, [ double sy ]) { _main.scale(sx, sy); _screenshot.scale(sx, sy); } @@ -313,7 +313,7 @@ Rect _calculateSubtreeBounds(RenderObject object) { /// screenshots render to the scene in the local coordinate system of the layer. class _ScreenshotContainerLayer extends OffsetLayer { @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { addChildrenToScene(builder, layerOffset); return null; // this does not have an engine layer. } @@ -630,7 +630,8 @@ class _DiagnosticsPathNode { final int childIndex; } -List<_DiagnosticsPathNode> _followDiagnosticableChain(List chain, { +List<_DiagnosticsPathNode> _followDiagnosticableChain( + List chain, { String name, DiagnosticsTreeStyle style, }) { @@ -968,8 +969,7 @@ mixin WidgetInspectorService { /// * /// * [BindingBase.initServiceExtensions], which explains when service /// extensions can be used. - void initServiceExtensions( - _RegisterServiceExtensionCallback registerServiceExtensionCallback) { + void initServiceExtensions(_RegisterServiceExtensionCallback registerServiceExtensionCallback) { _registerServiceExtensionCallback = registerServiceExtensionCallback; assert(!_debugServiceExtensionsRegistered); assert(() { _debugServiceExtensionsRegistered = true; return true; }()); @@ -1220,7 +1220,7 @@ mixin WidgetInspectorService { /// Returns whether the application has rendered its first frame and it is /// appropriate to display the Widget tree in the inspector. @protected - bool isWidgetTreeReady([String groupName]) { + bool isWidgetTreeReady([ String groupName ]) { return WidgetsBinding.instance != null && WidgetsBinding.instance.debugDidSendFirstFrameEvent; } @@ -1231,7 +1231,7 @@ mixin WidgetInspectorService { /// API surface of the methods in this class called from the Flutter IntelliJ /// Plugin. @protected - Object toObject(String id, [String groupName]) { + Object toObject(String id, [ String groupName ]) { if (id == null) return null; @@ -1252,7 +1252,7 @@ mixin WidgetInspectorService { /// The `groupName` parameter is not required by is added to regularize the /// API surface of methods called from the Flutter IntelliJ Plugin. @protected - Object toObjectForSourceLocation(String id, [String groupName]) { + Object toObjectForSourceLocation(String id, [ String groupName ]) { final Object object = toObject(id); if (object is Element) { return object.widget; @@ -1298,7 +1298,7 @@ mixin WidgetInspectorService { /// The `groupName` parameter is not required by is added to regularize the /// API surface of methods called from the Flutter IntelliJ Plugin. @protected - bool setSelectionById(String id, [String groupName]) { + bool setSelectionById(String id, [ String groupName ]) { return setSelection(toObject(id), groupName); } @@ -1310,7 +1310,7 @@ mixin WidgetInspectorService { /// The `groupName` parameter is not needed but is specified to regularize the /// API surface of methods called from the Flutter IntelliJ Plugin. @protected - bool setSelection(Object object, [String groupName]) { + bool setSelection(Object object, [ String groupName ]) { if (object is Element || object is RenderObject) { if (object is Element) { if (object == selection.currentElement) { @@ -1376,7 +1376,7 @@ mixin WidgetInspectorService { }; } - List _getRawElementParentChain(Element element, {int numLocalParents}) { + List _getRawElementParentChain(Element element, { int numLocalParents }) { List elements = element?.debugGetDiagnosticChain(); if (numLocalParents != null) { for (int i = 0; i < elements.length; i += 1) { @@ -1392,13 +1392,13 @@ mixin WidgetInspectorService { return elements?.reversed?.toList(); } - List<_DiagnosticsPathNode> _getElementParentChain(Element element, String groupName, {int numLocalParents}) { + List<_DiagnosticsPathNode> _getElementParentChain(Element element, String groupName, { int numLocalParents }) { return _followDiagnosticableChain( _getRawElementParentChain(element, numLocalParents: numLocalParents), ) ?? const <_DiagnosticsPathNode>[]; } - List<_DiagnosticsPathNode> _getRenderObjectParentChain(RenderObject renderObject, String groupName, {int maxparents}) { + List<_DiagnosticsPathNode> _getRenderObjectParentChain(RenderObject renderObject, String groupName, { int maxparents }) { final List chain = []; while (renderObject != null) { chain.add(renderObject); @@ -2583,7 +2583,7 @@ class _InspectorOverlayLayer extends Layer { double _textPainterMaxWidth; @override - ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) { + ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { if (!selection.active) return null; diff --git a/packages/flutter/test/cupertino/date_picker_test.dart b/packages/flutter/test/cupertino/date_picker_test.dart index 652b09d62c..e43337c7a3 100644 --- a/packages/flutter/test/cupertino/date_picker_test.dart +++ b/packages/flutter/test/cupertino/date_picker_test.dart @@ -811,7 +811,7 @@ void main() { }); } -Widget _buildPicker({FixedExtentScrollController controller, ValueChanged onSelectedItemChanged}) { +Widget _buildPicker({ FixedExtentScrollController controller, ValueChanged onSelectedItemChanged }) { return Directionality( textDirection: TextDirection.ltr, child: CupertinoPicker( diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 52dcd34f84..8050b9758f 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -991,7 +991,7 @@ RenderBox findScrollableActionsSectionRenderBox(WidgetTester tester) { return actionsSection; } -Widget createAppWithButtonThatLaunchesDialog({WidgetBuilder dialogBuilder}) { +Widget createAppWithButtonThatLaunchesDialog({ WidgetBuilder dialogBuilder }) { return MaterialApp( home: Material( child: Center( diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart index fff138f6dc..590ad579f3 100644 --- a/packages/flutter/test/cupertino/refresh_test.dart +++ b/packages/flutter/test/cupertino/refresh_test.dart @@ -21,12 +21,13 @@ void main() { /// These two Functions are required to avoid tearing off of the MockHelper object, /// which is not supported when using Dart 2 runtime semantics. - final Function builder = (BuildContext context, RefreshIndicatorMode refreshState, - double pulledExtent, - double refreshTriggerPullDistance, - double refreshIndicatorExtent) => - mockHelper.builder(context, refreshState, pulledExtent, refreshTriggerPullDistance, - refreshIndicatorExtent); + final Function builder = ( + BuildContext context, + RefreshIndicatorMode refreshState, + double pulledExtent, + double refreshTriggerPullDistance, + double refreshIndicatorExtent, + ) => mockHelper.builder(context, refreshState, pulledExtent, refreshTriggerPullDistance, refreshIndicatorExtent); final Function onRefresh = () => mockHelper.refreshTask(); diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index 9355a56950..78827adea5 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -41,7 +41,7 @@ StatefulBuilder setupSimpleSegmentedControl() { ); } -Widget boilerplate({Widget child}) { +Widget boilerplate({ Widget child }) { return Directionality( textDirection: TextDirection.ltr, child: Center(child: child), diff --git a/packages/flutter/test/foundation/capture_output.dart b/packages/flutter/test/foundation/capture_output.dart index de4f514d3a..8bd3bef489 100644 --- a/packages/flutter/test/foundation/capture_output.dart +++ b/packages/flutter/test/foundation/capture_output.dart @@ -9,12 +9,14 @@ List captureOutput(VoidCallback fn) { final List log = []; runZoned(fn, zoneSpecification: ZoneSpecification( - print: (Zone self, - ZoneDelegate parent, - Zone zone, - String line) { - log.add(line); - }, + print: ( + Zone self, + ZoneDelegate parent, + Zone zone, + String line, + ) { + log.add(line); + }, )); return log; diff --git a/packages/flutter/test/foundation/debug_test.dart b/packages/flutter/test/foundation/debug_test.dart index faddcce839..c8a31dc1b6 100644 --- a/packages/flutter/test/foundation/debug_test.dart +++ b/packages/flutter/test/foundation/debug_test.dart @@ -14,7 +14,7 @@ void main() { debugInstrumentationEnabled = true; printBuffer = StringBuffer(); originalDebugPrintCallback = debugPrint; - debugPrint = (String message, {int wrapWidth}) { + debugPrint = (String message, { int wrapWidth }) { printBuffer.writeln(message); }; }); diff --git a/packages/flutter/test/foundation/diagnostics_test.dart b/packages/flutter/test/foundation/diagnostics_test.dart index e49b0c5cae..44d2c3684f 100644 --- a/packages/flutter/test/foundation/diagnostics_test.dart +++ b/packages/flutter/test/foundation/diagnostics_test.dart @@ -180,10 +180,12 @@ void validatePropertyJsonSerializationHelper(final Map json, Dia void main() { test('TreeDiagnosticsMixin control test', () async { - void goldenStyleTest(String description, - {DiagnosticsTreeStyle style, - DiagnosticsTreeStyle lastChildStyle, - String golden = ''}) { + void goldenStyleTest( + String description, { + DiagnosticsTreeStyle style, + DiagnosticsTreeStyle lastChildStyle, + String golden = '', + }) { final TestTree tree = TestTree(children: [ TestTree(name: 'node A', style: style), TestTree( @@ -315,7 +317,8 @@ void main() { }); test('TreeDiagnosticsMixin tree with properties test', () async { - void goldenStyleTest(String description, { + void goldenStyleTest( + String description, { DiagnosticsTreeStyle style, DiagnosticsTreeStyle lastChildStyle, @required String golden, diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index f0bdf11d37..07f220e1ec 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -554,7 +554,7 @@ void main() { testWidgets('Avatar drawer works as expected on RawChip', (WidgetTester tester) async { final GlobalKey labelKey = GlobalKey(); - Future pushChip({Widget avatar}) async { + Future pushChip({ Widget avatar }) async { return tester.pumpWidget( _wrapForChip( child: Wrap( @@ -668,7 +668,7 @@ void main() { final UniqueKey labelKey = UniqueKey(); final UniqueKey deleteButtonKey = UniqueKey(); bool wasDeleted = false; - Future pushChip({bool deletable = false}) async { + Future pushChip({ bool deletable = false }) async { return tester.pumpWidget( _wrapForChip( child: Wrap( @@ -783,7 +783,7 @@ void main() { testWidgets('Selection with avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); - Future pushChip({Widget avatar, bool selectable = false}) async { + Future pushChip({ Widget avatar, bool selectable = false }) async { return tester.pumpWidget( _wrapForChip( child: Wrap( @@ -866,7 +866,7 @@ void main() { testWidgets('Selection without avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); - Future pushChip({bool selectable = false}) async { + Future pushChip({ bool selectable = false }) async { return tester.pumpWidget( _wrapForChip( child: Wrap( @@ -942,7 +942,7 @@ void main() { testWidgets('Activation works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); - Future pushChip({Widget avatar, bool selectable = false}) async { + Future pushChip({ Widget avatar, bool selectable = false }) async { return tester.pumpWidget( _wrapForChip( child: Wrap( diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index 1bf4f3fe93..28adf61013 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -11,7 +11,7 @@ import 'package:matcher/matcher.dart'; import '../widgets/semantics_tester.dart'; -MaterialApp _appWithAlertDialog(WidgetTester tester, AlertDialog dialog, {ThemeData theme}) { +MaterialApp _appWithAlertDialog(WidgetTester tester, AlertDialog dialog, { ThemeData theme }) { return MaterialApp( theme: theme, home: Material( diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index c0214c9788..bddbe9e6aa 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -MaterialApp _appWithAlertDialog(WidgetTester tester, AlertDialog dialog, {ThemeData theme}) { +MaterialApp _appWithAlertDialog(WidgetTester tester, AlertDialog dialog, { ThemeData theme }) { return MaterialApp( theme: theme, home: Material( diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 1e631cd794..bdd074faf8 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -855,7 +855,7 @@ void main() { testWidgets('disabledHint displays on empty items or onChanged', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - Widget build({List items, ValueChanged onChanged}) => buildFrame( + Widget build({ List items, ValueChanged onChanged }) => buildFrame( items: items, onChanged: onChanged, buttonKey: buttonKey, value: null, diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 2496f1b042..282f0befca 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -20,8 +20,10 @@ class NotifyMaterial extends StatelessWidget { } } -Widget buildMaterial( - {double elevation = 0.0, Color shadowColor = const Color(0xFF00FF00)}) { +Widget buildMaterial({ + double elevation = 0.0, + Color shadowColor = const Color(0xFF00FF00), +}) { return Center( child: SizedBox( height: 100.0, diff --git a/packages/flutter/test/material/outline_button_test.dart b/packages/flutter/test/material/outline_button_test.dart index e15d6f7206..75debbf354 100644 --- a/packages/flutter/test/material/outline_button_test.dart +++ b/packages/flutter/test/material/outline_button_test.dart @@ -70,7 +70,7 @@ void main() { const Color disabledBorderColor = Color(0xFFFF00FF); const double borderWidth = 4.0; - Widget buildFrame({VoidCallback onPressed}) { + Widget buildFrame({ VoidCallback onPressed }) { return Directionality( textDirection: TextDirection.ltr, child: Theme( diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index 1e76682ef0..646bec16c2 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -30,7 +30,7 @@ void main() { ); } - Widget build({Widget header, Axis scrollDirection = Axis.vertical, TextDirection textDirection = TextDirection.ltr}) { + Widget build({ Widget header, Axis scrollDirection = Axis.vertical, TextDirection textDirection = TextDirection.ltr }) { return MaterialApp( home: Directionality( textDirection: textDirection, diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index 9f2454be34..afaefbb31e 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -482,7 +482,7 @@ void main() { }); group('contributes semantics', () { - TestSemantics buildExpected({String routeName}) { + TestSemantics buildExpected({ String routeName }) { return TestSemantics.root( children: [ TestSemantics( diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index 49cd304e4b..19f4d0bdec 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -1256,7 +1256,7 @@ void main() { ); SliderThemeData theme = baseTheme.sliderTheme; double value = 0.45; - Widget buildApp({SliderThemeData sliderTheme, int divisions, bool enabled = true}) { + Widget buildApp({ SliderThemeData sliderTheme, int divisions, bool enabled = true }) { final ValueChanged onChanged = enabled ? (double d) => value = d : null; return Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 74c93da779..edae4e3917 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -284,7 +284,7 @@ void main() { primarySwatch: Colors.blue, ); final SliderThemeData sliderTheme = theme.sliderTheme.copyWith(thumbColor: Colors.red.shade500, showValueIndicator: ShowValueIndicator.always); - Widget buildApp(String value, {double sliderValue = 0.5, double textScale = 1.0}) { + Widget buildApp(String value, { double sliderValue = 0.5, double textScale = 1.0 }) { return Directionality( textDirection: TextDirection.ltr, child: MediaQuery( diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index 38e403e6cc..1a719bf3eb 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -659,7 +659,7 @@ void main() { }); testWidgets('SnackBar handles updates to accessibleNavigation', (WidgetTester tester) async { - Future boilerplate({bool accessibleNavigation}) { + Future boilerplate({ bool accessibleNavigation }) { return tester.pumpWidget(MaterialApp( home: MediaQuery( data: MediaQueryData(accessibleNavigation: accessibleNavigation), diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index 81e9ca7fc6..16629b4b2e 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -380,7 +380,7 @@ void main() { } final ControlsWidgetBuilder builder = - (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) { + (BuildContext context, { VoidCallback onStepContinue, VoidCallback onStepCancel }) { return Container( margin: const EdgeInsets.only(top: 16.0), child: ConstrainedBox( diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 02063e0060..83a7f4e478 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -66,12 +66,12 @@ class AlwaysKeepAliveState extends State } Widget buildFrame({ - Key tabBarKey, - List tabs, - String value, - bool isScrollable = false, - Color indicatorColor, - }) { + Key tabBarKey, + List tabs, + String value, + bool isScrollable = false, + Color indicatorColor, +}) { return boilerplate( child: DefaultTabController( initialIndex: tabs.indexOf(value), diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 3821f0eac0..9f49c7a2de 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -2050,7 +2050,7 @@ void main() { home: Material( child: Center( child: TextField( - buildCounter: (BuildContext context, {int currentLength, int maxLength, bool isFocused}) { + buildCounter: (BuildContext context, { int currentLength, int maxLength, bool isFocused }) { return Text('${currentLength.toString()} of ${maxLength.toString()}'); }, maxLength: 10, diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index 190486b133..d6871bd503 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -196,7 +196,7 @@ void main() { home: Material( child: Center( child: TextFormField( - buildCounter: (BuildContext context, {int currentLength, int maxLength, bool isFocused}) { + buildCounter: (BuildContext context, { int currentLength, int maxLength, bool isFocused }) { return Text('${currentLength.toString()} of ${maxLength.toString()}'); }, maxLength: 10, diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index 7d58fab468..739edc24e8 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -686,11 +686,11 @@ class _TextStyleProxy implements TextStyle { @override List get shadows => _delegate.shadows; @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.debug}) => + String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) => super.toString(); @override - DiagnosticsNode toDiagnosticsNode({String name, DiagnosticsTreeStyle style}) { + DiagnosticsNode toDiagnosticsNode({ String name, DiagnosticsTreeStyle style }) { throw UnimplementedError(); } @@ -700,7 +700,7 @@ class _TextStyleProxy implements TextStyle { } @override - TextStyle apply({Color color, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String fontFamily, List fontFamilyFallback, double fontSizeFactor = 1.0, double fontSizeDelta = 0.0, int fontWeightDelta = 0, double letterSpacingFactor = 1.0, double letterSpacingDelta = 0.0, double wordSpacingFactor = 1.0, double wordSpacingDelta = 0.0, double heightFactor = 1.0, double heightDelta = 0.0}) { + TextStyle apply({ Color color, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String fontFamily, List fontFamilyFallback, double fontSizeFactor = 1.0, double fontSizeDelta = 0.0, int fontWeightDelta = 0, double letterSpacingFactor = 1.0, double letterSpacingDelta = 0.0, double wordSpacingFactor = 1.0, double wordSpacingDelta = 0.0, double heightFactor = 1.0, double heightDelta = 0.0 }) { throw UnimplementedError(); } @@ -710,22 +710,22 @@ class _TextStyleProxy implements TextStyle { } @override - TextStyle copyWith({Color color, String fontFamily, List fontFamilyFallback, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double letterSpacing, double wordSpacing, TextBaseline textBaseline, double height, Locale locale, ui.Paint foreground, ui.Paint background, List shadows, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String debugLabel}) { + TextStyle copyWith({ Color color, String fontFamily, List fontFamilyFallback, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double letterSpacing, double wordSpacing, TextBaseline textBaseline, double height, Locale locale, ui.Paint foreground, ui.Paint background, List shadows, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String debugLabel }) { throw UnimplementedError(); } @override - void debugFillProperties(DiagnosticPropertiesBuilder properties, {String prefix = ''}) { + void debugFillProperties(DiagnosticPropertiesBuilder properties, { String prefix = '' }) { throw UnimplementedError(); } @override - ui.ParagraphStyle getParagraphStyle({TextAlign textAlign, TextDirection textDirection, double textScaleFactor = 1.0, String ellipsis, int maxLines, Locale locale, String fontFamily, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double height, StrutStyle strutStyle}) { + ui.ParagraphStyle getParagraphStyle({ TextAlign textAlign, TextDirection textDirection, double textScaleFactor = 1.0, String ellipsis, int maxLines, Locale locale, String fontFamily, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double height, StrutStyle strutStyle }) { throw UnimplementedError(); } @override - ui.TextStyle getTextStyle({double textScaleFactor = 1.0}) { + ui.TextStyle getTextStyle({ double textScaleFactor = 1.0 }) { throw UnimplementedError(); } diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 520884e2d5..55a9cea949 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -223,8 +223,11 @@ void _tests() { const List labels12To11TwoDigit = ['12', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11']; const List labels00To23 = ['00', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']; - Future mediaQueryBoilerplate(WidgetTester tester, bool alwaysUse24HourFormat, - { TimeOfDay initialTime = const TimeOfDay(hour: 7, minute: 0) }) async { + Future mediaQueryBoilerplate( + WidgetTester tester, + bool alwaysUse24HourFormat, { + TimeOfDay initialTime = const TimeOfDay(hour: 7, minute: 0), + }) async { await tester.pumpWidget( Localizations( locale: const Locale('en', 'US'), diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 58b6b7490b..c563272d02 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -12,7 +12,8 @@ const Key avatarA = Key('A'); const Key avatarC = Key('C'); const Key avatarD = Key('D'); -Future pumpTestWidget(WidgetTester tester, { +Future pumpTestWidget( + WidgetTester tester, { bool withName = true, bool withEmail = true, bool withOnDetailsPressedHandler = true, diff --git a/packages/flutter/test/painting/decoration_test.dart b/packages/flutter/test/painting/decoration_test.dart index 7a7b0a3f78..75833580d4 100644 --- a/packages/flutter/test/painting/decoration_test.dart +++ b/packages/flutter/test/painting/decoration_test.dart @@ -85,7 +85,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } @@ -150,7 +150,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/7289. // A reference test would be better. test('BoxDecoration backgroundImage clip', () { - void testDecoration({ BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, bool expectClip}) { + void testDecoration({ BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, bool expectClip }) { assert(shape != null); FakeAsync().run((FakeAsync async) { final DelayedImageProvider imageProvider = DelayedImageProvider(); diff --git a/packages/flutter/test/painting/image_resolution_test.dart b/packages/flutter/test/painting/image_resolution_test.dart index 75a62c7f6c..606e473ca1 100644 --- a/packages/flutter/test/painting/image_resolution_test.dart +++ b/packages/flutter/test/painting/image_resolution_test.dart @@ -167,14 +167,16 @@ void main() { }); }); - group( - 'Regression - When assets available are 1.0 and 3.0 check devices with a range of scales', () { + group('Regression - When assets available are 1.0 and 3.0 check devices with a range of scales', () { const String mainAssetPath = 'assets/normalFolder/normalFile.png'; const String variantPath = 'assets/normalFolder/3.0x/normalFile.png'; - void _buildBundleAndTestVariantLogic(double deviceRatio, double chosenAssetRatio, - String expectedAssetPath) { + void _buildBundleAndTestVariantLogic( + double deviceRatio, + double chosenAssetRatio, + String expectedAssetPath, + ) { final Map> assetBundleMap = >{}; diff --git a/packages/flutter/test/painting/image_stream_test.dart b/packages/flutter/test/painting/image_stream_test.dart index e78843a9bd..35531f90bc 100644 --- a/packages/flutter/test/painting/image_stream_test.dart +++ b/packages/flutter/test/painting/image_stream_test.dart @@ -40,7 +40,7 @@ class FakeImage implements Image { void dispose() {} @override - Future toByteData({ImageByteFormat format = ImageByteFormat.rawRgba}) async { + Future toByteData({ ImageByteFormat format = ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } diff --git a/packages/flutter/test/painting/mocks_for_image_cache.dart b/packages/flutter/test/painting/mocks_for_image_cache.dart index e0353d3c26..db24a3ee29 100644 --- a/packages/flutter/test/painting/mocks_for_image_cache.dart +++ b/packages/flutter/test/painting/mocks_for_image_cache.dart @@ -77,7 +77,7 @@ class TestImage implements ui.Image { void dispose() {} @override - Future toByteData({ImageByteFormat format = ImageByteFormat.rawRgba}) { + Future toByteData({ ImageByteFormat format = ImageByteFormat.rawRgba }) { throw UnimplementedError(); } } diff --git a/packages/flutter/test/painting/paint_image_test.dart b/packages/flutter/test/painting/paint_image_test.dart index 545186792a..ae38741b91 100644 --- a/packages/flutter/test/painting/paint_image_test.dart +++ b/packages/flutter/test/painting/paint_image_test.dart @@ -23,7 +23,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } diff --git a/packages/flutter/test/painting/shape_decoration_test.dart b/packages/flutter/test/painting/shape_decoration_test.dart index 13c0a5d52c..784c290f57 100644 --- a/packages/flutter/test/painting/shape_decoration_test.dart +++ b/packages/flutter/test/painting/shape_decoration_test.dart @@ -125,7 +125,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } diff --git a/packages/flutter/test/rendering/image_test.dart b/packages/flutter/test/rendering/image_test.dart index c365c6e407..7248240fbc 100644 --- a/packages/flutter/test/rendering/image_test.dart +++ b/packages/flutter/test/rendering/image_test.dart @@ -19,7 +19,7 @@ class SquareImage implements ui.Image { int get height => 10; @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } @@ -38,7 +38,7 @@ class WideImage implements ui.Image { int get height => 10; @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } @@ -57,7 +57,7 @@ class TallImage implements ui.Image { int get height => 20; @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } diff --git a/packages/flutter/test/rendering/mock_canvas.dart b/packages/flutter/test/rendering/mock_canvas.dart index d51378010a..8cbac038f2 100644 --- a/packages/flutter/test/rendering/mock_canvas.dart +++ b/packages/flutter/test/rendering/mock_canvas.dart @@ -164,7 +164,7 @@ abstract class PaintPattern { /// /// Any calls made between the last matched call (if any) and the /// [Canvas.clipPath] call are ignored. - void clipPath({Matcher pathMatcher}); + void clipPath({ Matcher pathMatcher }); /// Indicates that a rectangle is expected next. /// @@ -571,8 +571,7 @@ class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher } @override - bool _evaluatePredicates(Iterable calls, - StringBuffer description) { + bool _evaluatePredicates(Iterable calls, StringBuffer description) { int count = 0; for(RecordedInvocation call in calls) { if (call.invocation.isMethod && call.invocation.memberName == _methodName) { @@ -710,7 +709,7 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp } @override - void clipPath({Matcher pathMatcher}) { + void clipPath({ Matcher pathMatcher }) { _predicates.add(_FunctionPaintPredicate(#clipPath, [pathMatcher])); } diff --git a/packages/flutter/test/rendering/proxy_box_test.dart b/packages/flutter/test/rendering/proxy_box_test.dart index 8e62c45afd..fe900a2b6c 100644 --- a/packages/flutter/test/rendering/proxy_box_test.dart +++ b/packages/flutter/test/rendering/proxy_box_test.dart @@ -277,7 +277,7 @@ void main() { class _FakeTickerProvider implements TickerProvider { @override - Ticker createTicker(TickerCallback onTick, [bool disableAnimations = false]) { + Ticker createTicker(TickerCallback onTick, [ bool disableAnimations = false ]) { return _FakeTicker(); } } @@ -308,7 +308,7 @@ class _FakeTicker implements Ticker { void dispose() {} @override - void scheduleTick({bool rescheduling = false}) {} + void scheduleTick({ bool rescheduling = false }) {} @override TickerFuture start() { @@ -316,11 +316,11 @@ class _FakeTicker implements Ticker { } @override - void stop({bool canceled = false}) {} + void stop({ bool canceled = false }) {} @override void unscheduleTick() {} @override - String toString({bool debugIncludeStack = false}) => super.toString(); + String toString({ bool debugIncludeStack = false }) => super.toString(); } diff --git a/packages/flutter/test/rendering/recording_canvas.dart b/packages/flutter/test/rendering/recording_canvas.dart index da33a6d76e..5011d0c69a 100644 --- a/packages/flutter/test/rendering/recording_canvas.dart +++ b/packages/flutter/test/rendering/recording_canvas.dart @@ -103,18 +103,18 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex } @override - void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.hardEdge}) { + void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.hardEdge }) { clipRectAndPaint(clipRect.shift(offset), clipBehavior, clipRect.shift(offset), () => painter(this, offset)); } @override - void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { + void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias }) { assert(clipBehavior != null); clipRRectAndPaint(clipRRect.shift(offset), clipBehavior, bounds.shift(offset), () => painter(this, offset)); } @override - void pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { + void pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias }) { clipPathAndPaint(clipPath.shift(offset), clipBehavior, bounds.shift(offset), () => painter(this, offset)); } @@ -134,7 +134,7 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex } @override - void pushLayer(Layer childLayer, PaintingContextCallback painter, Offset offset, {Rect childPaintBounds}) { + void pushLayer(Layer childLayer, PaintingContextCallback painter, Offset offset, { Rect childPaintBounds }) { painter(this, offset); } diff --git a/packages/flutter/test/rendering/rendering_tester.dart b/packages/flutter/test/rendering/rendering_tester.dart index c2924fadce..bcaf4a6ab6 100644 --- a/packages/flutter/test/rendering/rendering_tester.dart +++ b/packages/flutter/test/rendering/rendering_tester.dart @@ -55,7 +55,8 @@ TestRenderingFlutterBinding get renderer { /// /// The EnginePhase must not be [EnginePhase.build], since the rendering layer /// has no build phase. -void layout(RenderBox box, { +void layout( + RenderBox box, { BoxConstraints constraints, Alignment alignment = Alignment.center, EnginePhase phase = EnginePhase.layout, diff --git a/packages/flutter/test/rendering/sliver_cache_test.dart b/packages/flutter/test/rendering/sliver_cache_test.dart index 0bdef3c79e..70617d6eb5 100644 --- a/packages/flutter/test/rendering/sliver_cache_test.dart +++ b/packages/flutter/test/rendering/sliver_cache_test.dart @@ -878,14 +878,14 @@ void main() { }); } -void expectSliverConstraints({RenderSliver sliver, double cacheOrigin, double remainingPaintExtent, double remainingCacheExtent, double scrollOffset}) { +void expectSliverConstraints({ RenderSliver sliver, double cacheOrigin, double remainingPaintExtent, double remainingCacheExtent, double scrollOffset }) { expect(sliver.constraints.cacheOrigin, cacheOrigin, reason: 'cacheOrigin'); expect(sliver.constraints.remainingPaintExtent, remainingPaintExtent, reason: 'remainingPaintExtent'); expect(sliver.constraints.remainingCacheExtent, remainingCacheExtent, reason: 'remainingCacheExtent'); expect(sliver.constraints.scrollOffset, scrollOffset, reason: 'scrollOffset'); } -void expectSliverGeometry({RenderSliver sliver, double paintExtent, double cacheExtent, bool visible}) { +void expectSliverGeometry({ RenderSliver sliver, double paintExtent, double cacheExtent, bool visible }) { expect(sliver.geometry.paintExtent, paintExtent, reason: 'paintExtent'); expect(sliver.geometry.cacheExtent, cacheExtent, reason: 'cacheExtent'); expect(sliver.geometry.visible, visible, reason: 'visible'); @@ -946,7 +946,8 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager { } @override - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, diff --git a/packages/flutter/test/rendering/slivers_block_test.dart b/packages/flutter/test/rendering/slivers_block_test.dart index 2ce915401d..95c69001dd 100644 --- a/packages/flutter/test/rendering/slivers_block_test.dart +++ b/packages/flutter/test/rendering/slivers_block_test.dart @@ -42,7 +42,8 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager { } @override - double estimateMaxScrollOffset(SliverConstraints constraints, { + double estimateMaxScrollOffset( + SliverConstraints constraints, { int firstIndex, int lastIndex, double leadingScrollOffset, diff --git a/packages/flutter/test/rendering/viewport_test.dart b/packages/flutter/test/rendering/viewport_test.dart index b51a6751dd..36fe089a82 100644 --- a/packages/flutter/test/rendering/viewport_test.dart +++ b/packages/flutter/test/rendering/viewport_test.dart @@ -517,7 +517,7 @@ void main() { group('Nested viewports (same orientation) showOnScreen', () { List children; - Future buildNestedScroller({WidgetTester tester, ScrollController inner, ScrollController outer}) { + Future buildNestedScroller({ WidgetTester tester, ScrollController inner, ScrollController outer }) { return tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/animated_cross_fade_test.dart b/packages/flutter/test/widgets/animated_cross_fade_test.dart index 280fd908b3..1500ae0390 100644 --- a/packages/flutter/test/widgets/animated_cross_fade_test.dart +++ b/packages/flutter/test/widgets/animated_cross_fade_test.dart @@ -263,7 +263,7 @@ void main() { expect(box2.localToGlobal(Offset.zero), const Offset(325.0, 175.0)); }); - Widget crossFadeWithWatcher({bool towardsSecond = false}) { + Widget crossFadeWithWatcher({ bool towardsSecond = false }) { return Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( diff --git a/packages/flutter/test/widgets/animated_size_test.dart b/packages/flutter/test/widgets/animated_size_test.dart index 4a0253037c..7d508fe3bb 100644 --- a/packages/flutter/test/widgets/animated_size_test.dart +++ b/packages/flutter/test/widgets/animated_size_test.dart @@ -142,7 +142,7 @@ void main() { await tester.pump(Duration(milliseconds: millis)); } - void verify({double size, RenderAnimatedSizeState state}) { + void verify({ double size, RenderAnimatedSizeState state }) { assert(size != null || state != null); final RenderAnimatedSize box = tester.renderObject(find.byType(AnimatedSize)); if (size != null) { diff --git a/packages/flutter/test/widgets/clamp_overscrolls_test.dart b/packages/flutter/test/widgets/clamp_overscrolls_test.dart index 2d97aa3a62..a1c2c05a4e 100644 --- a/packages/flutter/test/widgets/clamp_overscrolls_test.dart +++ b/packages/flutter/test/widgets/clamp_overscrolls_test.dart @@ -11,7 +11,7 @@ import 'package:flutter/widgets.dart'; // The top of the bottom widget is at 550 (the top of the top widget // is at 0). The top of the bottom widget is 500 when it has been // scrolled completely into view. -Widget buildFrame(ScrollPhysics physics, {ScrollController scrollController}) { +Widget buildFrame(ScrollPhysics physics, { ScrollController scrollController }) { return SingleChildScrollView( key: UniqueKey(), physics: physics, diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index e0cfeaf1f5..2f730635bf 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -700,7 +700,7 @@ class _DiffTester { /// /// - checks that initial and final configurations are in the desired states. /// - checks that keyed nodes have stable IDs. - Future diff({List from, List to}) async { + Future diff({ List from, List to }) async { final SemanticsTester semanticsTester = SemanticsTester(tester); TestSemantics createExpectations(List labels) { diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart index d5523419b9..cc1feb62ac 100644 --- a/packages/flutter/test/widgets/dismissible_test.dart +++ b/packages/flutter/test/widgets/dismissible_test.dart @@ -137,7 +137,9 @@ Future flingElementFromZero(WidgetTester tester, Finder finder, { @require await flingElement(tester, finder, gestureDirection: gestureDirection, initialOffsetFactor: -1.0); } -Future dismissItem(WidgetTester tester, int item, { +Future dismissItem( + WidgetTester tester, + int item, { @required AxisDirection gestureDirection, DismissMethod mechanism = dismissElement, }) async { @@ -154,7 +156,9 @@ Future dismissItem(WidgetTester tester, int item, { await tester.pump(); // rebuild after the callback removes the entry } -Future checkFlingItemBeforeMovementEnd(WidgetTester tester, int item, { +Future checkFlingItemBeforeMovementEnd( + WidgetTester tester, + int item, { @required AxisDirection gestureDirection, DismissMethod mechanism = rollbackElement }) async { @@ -168,7 +172,9 @@ Future checkFlingItemBeforeMovementEnd(WidgetTester tester, int item, { await tester.pump(const Duration(milliseconds: 100)); } -Future checkFlingItemAfterMovement(WidgetTester tester, int item, { +Future checkFlingItemAfterMovement( + WidgetTester tester, + int item, { @required AxisDirection gestureDirection, DismissMethod mechanism = rollbackElement }) async { diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index ef8e964919..859205032a 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -2089,7 +2089,7 @@ void main() { } -Future _testLongPressDraggableHapticFeedback({WidgetTester tester, bool hapticFeedbackOnStart, int expectedHapticFeedbackCount}) async { +Future _testLongPressDraggableHapticFeedback({ WidgetTester tester, bool hapticFeedbackOnStart, int expectedHapticFeedbackCount }) async { bool onDragStartedCalled = false; int hapticFeedbackCalls = 0; @@ -2131,7 +2131,7 @@ Future _testLongPressDraggableHapticFeedback({WidgetTester tester, bool ha expect(hapticFeedbackCalls, expectedHapticFeedbackCount); } -Future _testChildAnchorFeedbackPosition({WidgetTester tester, double top = 0.0, double left = 0.0}) async { +Future _testChildAnchorFeedbackPosition({ WidgetTester tester, double top = 0.0, double left = 0.0 }) async { final List accepted = []; int dragStartedCount = 0; diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 73841fb117..2772703efa 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -1634,8 +1634,7 @@ void main() { }); group('a11y copy/cut/paste', () { - Future _buildApp( - MockTextSelectionControls controls, WidgetTester tester) { + Future _buildApp(MockTextSelectionControls controls, WidgetTester tester) { return tester.pumpWidget(MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, diff --git a/packages/flutter/test/widgets/image_headers_test.dart b/packages/flutter/test/widgets/image_headers_test.dart index c7f8de1325..e7b70e4ccf 100644 --- a/packages/flutter/test/widgets/image_headers_test.dart +++ b/packages/flutter/test/widgets/image_headers_test.dart @@ -35,7 +35,7 @@ void main() { when(response.listen(any)).thenAnswer((Invocation invocation) { final void Function(List) onData = invocation.positionalArguments[0]; final void Function() onDone = invocation.namedArguments[#onDone]; - final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError]; + final void Function(Object, [ StackTrace ]) onError = invocation.namedArguments[#onError]; final bool cancelOnError = invocation.namedArguments[#cancelOnError]; return Stream>.fromIterable(>[kTransparentImage]).listen(onData, onDone: onDone, onError: onError, cancelOnError: cancelOnError); }); diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index 123cf79606..b342585da8 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -26,7 +26,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } @@ -117,7 +117,7 @@ class TestAssetImage extends AssetImage { } } -Widget buildImageAtRatio(String image, Key key, double ratio, bool inferSize, [AssetBundle bundle]) { +Widget buildImageAtRatio(String image, Key key, double ratio, bool inferSize, [ AssetBundle bundle ]) { const double windowSize = 500.0; // 500 logical pixels const double imageSize = 200.0; // 200 logical pixels diff --git a/packages/flutter/test/widgets/image_rtl_test.dart b/packages/flutter/test/widgets/image_rtl_test.dart index 511c7428d2..f338f18a77 100644 --- a/packages/flutter/test/widgets/image_rtl_test.dart +++ b/packages/flutter/test/widgets/image_rtl_test.dart @@ -37,7 +37,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } } diff --git a/packages/flutter/test/widgets/image_test.dart b/packages/flutter/test/widgets/image_test.dart index 6ffc035c75..943c9b1e25 100644 --- a/packages/flutter/test/widgets/image_test.dart +++ b/packages/flutter/test/widgets/image_test.dart @@ -926,7 +926,7 @@ class TestImage implements ui.Image { void dispose() { } @override - Future toByteData({ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba}) async { + Future toByteData({ ui.ImageByteFormat format = ui.ImageByteFormat.rawRgba }) async { throw UnsupportedError('Cannot encode test image'); } diff --git a/packages/flutter/test/widgets/list_view_builder_test.dart b/packages/flutter/test/widgets/list_view_builder_test.dart index fc1907f37c..d50e3e2371 100644 --- a/packages/flutter/test/widgets/list_view_builder_test.dart +++ b/packages/flutter/test/widgets/list_view_builder_test.dart @@ -306,7 +306,7 @@ void main() { }); } -void check({List visible = const [], List hidden = const []}) { +void check({ List visible = const [], List hidden = const [] }) { for (int i in visible) { expect(find.text('$i'), findsOneWidget); } diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index d6b5a188e1..5c1c420daf 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -27,7 +27,7 @@ class Alive extends StatefulWidget { AliveState createState() => AliveState(); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.debug}) => '$index $alive'; + String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) => '$index $alive'; } class AliveState extends State with AutomaticKeepAliveClientMixin { @@ -176,7 +176,7 @@ void main() { }); testWidgets('ListView large scroll jump and keepAlive first child not keepAlive', (WidgetTester tester) async { - Future checkAndScroll([String zero = '0:false']) async { + Future checkAndScroll([ String zero = '0:false' ]) async { expect(find.text(zero), findsOneWidget); expect(find.text('1:false'), findsOneWidget); expect(find.text('2:false'), findsOneWidget); diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index 354126d9a7..5d40073c92 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -23,7 +23,7 @@ class _CustomPhysics extends ClampingScrollPhysics { } } -Widget buildTest({ ScrollController controller, String title ='TTTTTTTT' }) { +Widget buildTest({ ScrollController controller, String title = 'TTTTTTTT' }) { return Localizations( locale: const Locale('en', 'US'), delegates: const >[ diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index 4c858ad3b7..59574deeda 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -332,7 +332,7 @@ void main() { final List log = []; final PageController controller = PageController(viewportFraction: 0.9); - Widget build(PageController controller, {Size size}) { + Widget build(PageController controller, { Size size }) { final Widget pageView = Directionality( textDirection: TextDirection.ltr, child: PageView( diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index d017f68792..ba64212695 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -418,8 +418,7 @@ void main() { ); }); - testWidgets('Android view touch events are in virtual display\'s coordinate system', ( - WidgetTester tester) async { + testWidgets('Android view touch events are in virtual display\'s coordinate system', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -755,8 +754,7 @@ void main() { ); }); - testWidgets('RenderAndroidView reconstructed with same gestureRecognizers', ( - WidgetTester tester) async { + testWidgets('RenderAndroidView reconstructed with same gestureRecognizers', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); diff --git a/packages/flutter/test/widgets/semantics_10_test.dart b/packages/flutter/test/widgets/semantics_10_test.dart index 31457e2a19..afed3c62a5 100644 --- a/packages/flutter/test/widgets/semantics_10_test.dart +++ b/packages/flutter/test/widgets/semantics_10_test.dart @@ -34,7 +34,7 @@ void main() { }); } -Widget buildTestWidgets({bool excludeSemantics, String label, bool isSemanticsBoundary}) { +Widget buildTestWidgets({ bool excludeSemantics, String label, bool isSemanticsBoundary }) { return Directionality( textDirection: TextDirection.ltr, child: Semantics( diff --git a/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart b/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart index 92d07368ca..1dfbebf848 100644 --- a/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart +++ b/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart @@ -81,7 +81,7 @@ void main() { final Key paddingWidget = GlobalKey(); -Widget _buildTestWidget({bool extraPadding, String text, ScrollController controller}) { +Widget _buildTestWidget({ bool extraPadding, String text, ScrollController controller }) { return MaterialApp( home: Scaffold( body: Column( diff --git a/packages/flutter/test/widgets/semantics_tester.dart b/packages/flutter/test/widgets/semantics_tester.dart index 8b2b48f134..09185ca228 100644 --- a/packages/flutter/test/widgets/semantics_tester.dart +++ b/packages/flutter/test/widgets/semantics_tester.dart @@ -250,14 +250,12 @@ class TestSemantics { bool _matches( SemanticsNode node, - Map matchState, - { - bool ignoreRect = false, - bool ignoreTransform = false, - bool ignoreId = false, - DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.inverseHitTest, - } - ) { + Map matchState, { + bool ignoreRect = false, + bool ignoreTransform = false, + bool ignoreId = false, + DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.inverseHitTest, + }) { bool fail(String message) { matchState[TestSemantics] = '$message'; return false; @@ -343,7 +341,7 @@ class TestSemantics { } @override - String toString([int indentAmount = 0]) { + String toString([ int indentAmount = 0 ]) { final String indent = ' ' * indentAmount; final StringBuffer buf = StringBuffer(); buf.writeln('$indent$runtimeType('); @@ -688,7 +686,8 @@ class _HasSemantics extends Matcher { } /// Asserts that a [SemanticsTester] has a semantics tree that exactly matches the given semantics. -Matcher hasSemantics(TestSemantics semantics, { +Matcher hasSemantics( + TestSemantics semantics, { bool ignoreRect = false, bool ignoreTransform = false, bool ignoreId = false, diff --git a/packages/flutter/test/widgets/single_child_scroll_view_test.dart b/packages/flutter/test/widgets/single_child_scroll_view_test.dart index 816644e1a6..f28cfb8d09 100644 --- a/packages/flutter/test/widgets/single_child_scroll_view_test.dart +++ b/packages/flutter/test/widgets/single_child_scroll_view_test.dart @@ -706,7 +706,7 @@ void main() { group('Nested SingleChildScrollView (same orientation) showOnScreen', () { List children; - Future buildNestedScroller({WidgetTester tester, ScrollController inner, ScrollController outer}) { + Future buildNestedScroller({ WidgetTester tester, ScrollController inner, ScrollController outer }) { return tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter_driver/lib/src/driver/driver.dart b/packages/flutter_driver/lib/src/driver/driver.dart index 96edc27211..528ecd7731 100644 --- a/packages/flutter_driver/lib/src/driver/driver.dart +++ b/packages/flutter_driver/lib/src/driver/driver.dart @@ -427,27 +427,27 @@ class FlutterDriver { } /// Checks the status of the Flutter Driver extension. - Future checkHealth({Duration timeout}) async { + Future checkHealth({ Duration timeout }) async { return Health.fromJson(await _sendCommand(GetHealth(timeout: timeout))); } /// Returns a dump of the render tree. - Future getRenderTree({Duration timeout}) async { + Future getRenderTree({ Duration timeout }) async { return RenderTree.fromJson(await _sendCommand(GetRenderTree(timeout: timeout))); } /// Taps at the center of the widget located by [finder]. - Future tap(SerializableFinder finder, {Duration timeout}) async { + Future tap(SerializableFinder finder, { Duration timeout }) async { await _sendCommand(Tap(finder, timeout: timeout)); } /// Waits until [finder] locates the target. - Future waitFor(SerializableFinder finder, {Duration timeout}) async { + Future waitFor(SerializableFinder finder, { Duration timeout }) async { await _sendCommand(WaitFor(finder, timeout: timeout)); } /// Waits until [finder] can no longer locate the target. - Future waitForAbsent(SerializableFinder finder, {Duration timeout}) async { + Future waitForAbsent(SerializableFinder finder, { Duration timeout }) async { await _sendCommand(WaitForAbsent(finder, timeout: timeout)); } @@ -455,7 +455,7 @@ class FlutterDriver { /// /// Use this method when you need to wait for the moment when the application /// becomes "stable", for example, prior to taking a [screenshot]. - Future waitUntilNoTransientCallbacks({Duration timeout}) async { + Future waitUntilNoTransientCallbacks({ Duration timeout }) async { await _sendCommand(WaitUntilNoTransientCallbacks(timeout: timeout)); } @@ -509,7 +509,9 @@ class FlutterDriver { /// /// The [timeout] value should be long enough to accommodate as many scrolls /// as needed to bring an item into view. The default is to not time out. - Future scrollUntilVisible(SerializableFinder scrollable, SerializableFinder item, { + Future scrollUntilVisible( + SerializableFinder scrollable, + SerializableFinder item, { double alignment = 0.0, double dxScroll = 0.0, double dyScroll = 0.0, diff --git a/packages/flutter_driver/lib/src/driver/timeline_summary.dart b/packages/flutter_driver/lib/src/driver/timeline_summary.dart index 9a3d30d3d2..95060fb65e 100644 --- a/packages/flutter_driver/lib/src/driver/timeline_summary.dart +++ b/packages/flutter_driver/lib/src/driver/timeline_summary.dart @@ -49,7 +49,7 @@ class TimelineSummary { /// The number of frames that missed the [kBuildBudget] and therefore are /// in the danger of missing frames. - int computeMissedFrameBuildBudgetCount([Duration frameBuildBudget = kBuildBudget]) => _extractFrameDurations() + int computeMissedFrameBuildBudgetCount([ Duration frameBuildBudget = kBuildBudget ]) => _extractFrameDurations() .where((Duration duration) => duration > kBuildBudget) .length; @@ -76,7 +76,7 @@ class TimelineSummary { /// The number of frames that missed the [kBuildBudget] on the GPU and /// therefore are in the danger of missing frames. - int computeMissedFrameRasterizerBudgetCount([Duration frameBuildBudget = kBuildBudget]) => _extractGpuRasterizerDrawEvents() + int computeMissedFrameRasterizerBudgetCount([ Duration frameBuildBudget = kBuildBudget ]) => _extractGpuRasterizerDrawEvents() .where((TimedEvent event) => event.duration > kBuildBudget) .length; diff --git a/packages/flutter_driver/lib/src/extension/extension.dart b/packages/flutter_driver/lib/src/extension/extension.dart index 01857be895..7008f39973 100644 --- a/packages/flutter_driver/lib/src/extension/extension.dart +++ b/packages/flutter_driver/lib/src/extension/extension.dart @@ -194,7 +194,7 @@ class FlutterDriverExtension { } } - Map _makeResponse(dynamic response, {bool isError = false}) { + Map _makeResponse(dynamic response, { bool isError = false }) { return { 'isError': isError, 'response': response, @@ -208,7 +208,7 @@ class FlutterDriverExtension { } // Waits until at the end of a frame the provided [condition] is [true]. - Future _waitUntilFrame(bool condition(), [Completer completer]) { + Future _waitUntilFrame(bool condition(), [ Completer completer ]) { completer ??= Completer(); if (!condition()) { SchedulerBinding.instance.addPostFrameCallback((Duration timestamp) { diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart index 6bf130236d..c5e23caaa0 100644 --- a/packages/flutter_driver/test/flutter_driver_test.dart +++ b/packages/flutter_driver/test/flutter_driver_test.dart @@ -427,7 +427,9 @@ void main() { } Future> makeMockResponse( - Map response, {bool isError = false}) { + Map response, { + bool isError = false, +}) { return Future>.value({ 'isError': isError, 'response': response diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index 33beb311fc..53690d0497 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart @@ -248,7 +248,7 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations { String get tabLabelRaw; @override - String tabLabel({int tabIndex, int tabCount}) { + String tabLabel({ int tabIndex, int tabCount }) { assert(tabIndex >= 1); assert(tabCount >= 1); final String template = tabLabelRaw; diff --git a/packages/flutter_localizations/test/time_picker_test.dart b/packages/flutter_localizations/test/time_picker_test.dart index 56b733f95b..c7c8207ca9 100644 --- a/packages/flutter_localizations/test/time_picker_test.dart +++ b/packages/flutter_localizations/test/time_picker_test.dart @@ -40,8 +40,11 @@ class _TimePickerLauncher extends StatelessWidget { } } -Future startPicker(WidgetTester tester, ValueChanged onChanged, - { Locale locale = const Locale('en', 'US') }) async { +Future startPicker( + WidgetTester tester, + ValueChanged onChanged, { + Locale locale = const Locale('en', 'US'), +}) async { await tester.pumpWidget(_TimePickerLauncher(onChanged: onChanged, locale: locale,)); await tester.tap(find.text('X')); await tester.pumpAndSettle(const Duration(seconds: 1)); diff --git a/packages/flutter_test/lib/src/all_elements.dart b/packages/flutter_test/lib/src/all_elements.dart index 019648f41b..b308a153a8 100644 --- a/packages/flutter_test/lib/src/all_elements.dart +++ b/packages/flutter_test/lib/src/all_elements.dart @@ -16,7 +16,8 @@ import 'package:flutter/widgets.dart'; /// The same applies to any iterable obtained indirectly through this /// one, for example the results of calling `where` on this iterable /// are also cached. -Iterable collectAllElementsFrom(Element rootElement, { +Iterable collectAllElementsFrom( + Element rootElement, { @required bool skipOffstage, }) { return CachingIterable(_DepthFirstChildIterator(rootElement, skipOffstage)); diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index a7261b9153..05fc840d42 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -308,7 +308,9 @@ abstract class TestWidgetsFlutterBinding extends BindingBase Offset localToGlobal(Offset point) => point; @override - void dispatchEvent(PointerEvent event, HitTestResult hitTestResult, { + void dispatchEvent( + PointerEvent event, + HitTestResult hitTestResult, { TestBindingEventSource source = TestBindingEventSource.device }) { assert(source == TestBindingEventSource.test); @@ -441,7 +443,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase // The LiveTestWidgetsFlutterBinding overrides this to report the exception to the console. } - Future _runTest(Future testBody(), VoidCallback invariantTester, String description, { + Future _runTest( + Future testBody(), + VoidCallback invariantTester, + String description, { Future timeout, }) { assert(description != null); @@ -874,7 +879,9 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { } @override - Future runTest(Future testBody(), VoidCallback invariantTester, { + Future runTest( + Future testBody(), + VoidCallback invariantTester, { String description = '', Duration timeout = const Duration(seconds: 2), }) { @@ -1183,7 +1190,9 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { HitTestDispatcher deviceEventDispatcher; @override - void dispatchEvent(PointerEvent event, HitTestResult hitTestResult, { + void dispatchEvent( + PointerEvent event, + HitTestResult hitTestResult, { TestBindingEventSource source = TestBindingEventSource.device }) { switch (source) { @@ -1524,7 +1533,7 @@ class _MockHttpClient implements HttpClient { set badCertificateCallback(bool Function(X509Certificate cert, String host, int port) callback) {} @override - void close({bool force = false}) {} + void close({ bool force = false }) {} @override Future delete(String host, int port, String path) { @@ -1612,7 +1621,7 @@ class _MockHttpRequest extends HttpClientRequest { void add(List data) {} @override - void addError(Object error, [StackTrace stackTrace]) {} + void addError(Object error, [ StackTrace stackTrace ]) {} @override Future addStream(Stream> stream) { @@ -1648,13 +1657,13 @@ class _MockHttpRequest extends HttpClientRequest { void write(Object obj) {} @override - void writeAll(Iterable objects, [String separator = '']) {} + void writeAll(Iterable objects, [ String separator = '' ]) {} @override void writeCharCode(int charCode) {} @override - void writeln([Object obj = '']) {} + void writeln([ Object obj = '' ]) {} } /// A mocked [HttpClientResponse] which is empty and has a [statusCode] of 400. @@ -1683,7 +1692,7 @@ class _MockHttpResponse extends Stream> implements HttpClientResponse bool get isRedirect => false; @override - StreamSubscription> listen(void Function(List event) onData, {Function onError, void Function() onDone, bool cancelOnError}) { + StreamSubscription> listen(void Function(List event) onData, { Function onError, void Function() onDone, bool cancelOnError }) { return const Stream>.empty().listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); } @@ -1694,7 +1703,7 @@ class _MockHttpResponse extends Stream> implements HttpClientResponse String get reasonPhrase => null; @override - Future redirect([String method, Uri url, bool followLoops]) { + Future redirect([ String method, Uri url, bool followLoops ]) { return Future.error(UnsupportedError('Mocked response')); } diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index a2fda53ded..1b2339bf02 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -269,7 +269,7 @@ class CommonFinders { /// /// If the [matchRoot] argument is true then the widget(s) specified by [of] /// will be matched along with the ancestors. - Finder ancestor({ Finder of, Finder matching, bool matchRoot = false}) { + Finder ancestor({ Finder of, Finder matching, bool matchRoot = false }) { return _AncestorFinder(of, matching, matchRoot: matchRoot); } } diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index b5b0f6463f..5e557fc555 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -243,7 +243,7 @@ Matcher equalsIgnoringHashCodes(String value) { /// method [name] and [arguments]. /// /// Arguments checking implements deep equality for [List] and [Map] types. -Matcher isMethodCall(String name, {@required dynamic arguments}) { +Matcher isMethodCall(String name, { @required dynamic arguments }) { return _IsMethodCall(name, arguments); } @@ -256,7 +256,7 @@ Matcher isMethodCall(String name, {@required dynamic arguments}) { /// When using this matcher you typically want to use a rectangle larger than /// the area you expect to paint in for [areaToCompare] to catch errors where /// the path draws outside the expected area. -Matcher coversSameAreaAs(Path expectedPath, {@required Rect areaToCompare, int sampleSize = 20}) +Matcher coversSameAreaAs(Path expectedPath, { @required Rect areaToCompare, int sampleSize = 20 }) => _CoversSameAreaAs(expectedPath, areaToCompare: areaToCompare, sampleSize: sampleSize); /// Asserts that a [Finder], [Future], or [ui.Image] matches the @@ -1148,14 +1148,14 @@ const Matcher hasNoImmediateClip = _MatchAnythingExceptClip(); /// Asserts that a [Finder] locates a single object whose root RenderObject /// is a [RenderClipRRect] with no clipper set, and border radius equals to /// [borderRadius], or an equivalent [RenderClipPath]. -Matcher clipsWithBoundingRRect({@required BorderRadius borderRadius}) { +Matcher clipsWithBoundingRRect({ @required BorderRadius borderRadius }) { return _ClipsWithBoundingRRect(borderRadius: borderRadius); } /// Asserts that a [Finder] locates a single object whose root RenderObject /// is a [RenderClipPath] with a [ShapeBorderClipper] that clips to /// [shape]. -Matcher clipsWithShapeBorder({@required ShapeBorder shape}) { +Matcher clipsWithShapeBorder({ @required ShapeBorder shape }) { return _ClipsWithShapeBorder(shape: shape); } @@ -1213,10 +1213,10 @@ abstract class _FailWithDescriptionMatcher extends Matcher { @override Description describeMismatch( - dynamic item, - Description mismatchDescription, - Map matchState, - bool verbose + dynamic item, + Description mismatchDescription, + Map matchState, + bool verbose ) { return mismatchDescription.add(matchState['failure']); } @@ -1852,11 +1852,11 @@ class _MatchesSemanticsData extends Matcher { @override Description describeMismatch( - dynamic item, - Description mismatchDescription, - Map matchState, - bool verbose - ) { + dynamic item, + Description mismatchDescription, + Map matchState, + bool verbose + ) { return mismatchDescription.add(matchState['failure']); } } diff --git a/packages/flutter_test/lib/src/test_compat.dart b/packages/flutter_test/lib/src/test_compat.dart index 2c9b091f6b..e2e83fcc69 100644 --- a/packages/flutter_test/lib/src/test_compat.dart +++ b/packages/flutter_test/lib/src/test_compat.dart @@ -75,7 +75,7 @@ Future _runGroup(Suite suiteConfig, Group group, List parents, _Rep } } -Future _runLiveTest(Suite suiteConfig, LiveTest liveTest, _Reporter reporter, {bool countSuccess = true}) async { +Future _runLiveTest(Suite suiteConfig, LiveTest liveTest, _Reporter reporter, { bool countSuccess = true }) async { reporter._onTestStarted(liveTest); // Schedule a microtask to ensure that [onTestStarted] fires before the // first [LiveTest.onStateChange] event. @@ -157,14 +157,16 @@ Future _runSkippedTest(Suite suiteConfig, Test test, List parents, /// avoid this flag if possible and instead use the test runner flag `-n` to /// filter tests by name. @isTest -void test(Object description, Function body, { +void test( + Object description, + Function body, { String testOn, Timeout timeout, dynamic skip, dynamic tags, Map onPlatform, int retry, - }) { +}) { _declarer.test( description.toString(), body, testOn: testOn, @@ -423,7 +425,7 @@ class _Reporter { /// [message] goes after the progress report. If [color] is passed, it's used /// as the color for [message]. If [suffix] is passed, it's added to the end /// of [message]. - void _progressLine(String message, {String color, String suffix}) { + void _progressLine(String message, { String color, String suffix }) { // Print nothing if nothing has changed since the last progress line. if (passed.length == _lastProgressPassed && skipped.length == _lastProgressSkipped && @@ -495,12 +497,12 @@ class _Reporter { } } -String _indent(String string, {int size, String first}) { +String _indent(String string, { int size, String first }) { size ??= first == null ? 2 : first.length; return _prefixLines(string, ' ' * size, first: first); } -String _prefixLines(String text, String prefix, {String first, String last, String single}) { +String _prefixLines(String text, String prefix, { String first, String last, String single }) { first ??= prefix; last ??= prefix; single ??= first ?? last ?? prefix; diff --git a/packages/flutter_test/lib/src/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart index 49a2ab22d8..b930b108e7 100644 --- a/packages/flutter_test/lib/src/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -66,7 +66,9 @@ typedef WidgetTesterCallback = Future Function(WidgetTester widgetTester); /// }); /// ``` @isTest -void testWidgets(String description, WidgetTesterCallback callback, { +void testWidgets( + String description, + WidgetTesterCallback callback, { bool skip = false, test_package.Timeout timeout }) { @@ -158,7 +160,9 @@ Future benchmarkWidgets(WidgetTesterCallback callback) { /// See also: /// /// * [expectLater] for use with asynchronous matchers. -void expect(dynamic actual, dynamic matcher, { +void expect( + dynamic actual, + dynamic matcher, { String reason, dynamic skip, // true or a String }) { @@ -175,7 +179,9 @@ void expect(dynamic actual, dynamic matcher, { /// /// Generally, it is better to use [expect], which does include checks to ensure /// that asynchronous APIs are not being called. -void expectSync(dynamic actual, dynamic matcher, { +void expectSync( + dynamic actual, + dynamic matcher, { String reason, }) { test_package.expect(actual, matcher, reason: reason); @@ -189,7 +195,9 @@ void expectSync(dynamic actual, dynamic matcher, { /// If the matcher fails asynchronously, that failure is piped to the returned /// future where it can be handled by user code. If it is not handled by user /// code, the test will fail. -Future expectLater(dynamic actual, dynamic matcher, { +Future expectLater( + dynamic actual, + dynamic matcher, { String reason, dynamic skip, // true or a String }) { @@ -240,7 +248,8 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker /// /// See also [LiveTestWidgetsFlutterBindingFramePolicy], which affects how /// this method works when the test is run with `flutter run`. - Future pumpWidget(Widget widget, [ + Future pumpWidget( + Widget widget, [ Duration duration, EnginePhase phase = EnginePhase.sendSemanticsUpdate, ]) { @@ -323,10 +332,10 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker /// Alternatively, one can check that the return value from this function /// matches the expected number of pumps. Future pumpAndSettle([ - Duration duration = const Duration(milliseconds: 100), - EnginePhase phase = EnginePhase.sendSemanticsUpdate, - Duration timeout = const Duration(minutes: 10), - ]) { + Duration duration = const Duration(milliseconds: 100), + EnginePhase phase = EnginePhase.sendSemanticsUpdate, + Duration timeout = const Duration(minutes: 10), + ]) { assert(duration != null); assert(duration > Duration.zero); assert(timeout != null); diff --git a/packages/flutter_test/test/goldens_test.dart b/packages/flutter_test/test/goldens_test.dart index 0c084ad99c..5d036428c6 100644 --- a/packages/flutter_test/test/goldens_test.dart +++ b/packages/flutter_test/test/goldens_test.dart @@ -82,7 +82,7 @@ void main() { }); group('compare', () { - Future doComparison([String golden = 'golden.png']) { + Future doComparison([ String golden = 'golden.png' ]) { final Uri uri = fs.file(fix(golden)).uri; return comparator.compare( Uint8List.fromList(_kExpectedBytes), diff --git a/packages/flutter_tools/lib/runner.dart b/packages/flutter_tools/lib/runner.dart index fdcca4b5d4..621cf6382a 100644 --- a/packages/flutter_tools/lib/runner.dart +++ b/packages/flutter_tools/lib/runner.dart @@ -68,13 +68,13 @@ Future run( } Future _handleToolError( - dynamic error, - StackTrace stackTrace, - bool verbose, - List args, - bool reportCrashes, - String getFlutterVersion(), - ) async { + dynamic error, + StackTrace stackTrace, + bool verbose, + List args, + bool reportCrashes, + String getFlutterVersion(), +) async { if (error is UsageException) { printError('${error.message}\n'); printError("Run 'flutter -h' (or 'flutter -h') for available flutter commands and options."); diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 88214bd24b..73aa44b6bb 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -490,7 +490,7 @@ class AndroidDevice extends Device { } @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { // The Android log reader isn't app-specific. _logReader ??= _AdbLogReader(this); return _logReader; @@ -576,7 +576,8 @@ final RegExp _kDeviceRegex = RegExp(r'^(\S+)\s+(\S+)(.*)'); /// of devices and possible device issue diagnostics. Either argument can be null, /// in which case information for that parameter won't be populated. @visibleForTesting -void parseADBDeviceOutput(String text, { +void parseADBDeviceOutput( + String text, { List devices, List diagnostics }) { @@ -849,7 +850,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder { } @override - Future forward(int devicePort, {int hostPort}) async { + Future forward(int devicePort, { int hostPort }) async { hostPort ??= 0; final RunResult process = await runCheckedAsync(device.adbCommandForDevice( ['forward', 'tcp:$hostPort', 'tcp:$devicePort'] diff --git a/packages/flutter_tools/lib/src/android/android_sdk.dart b/packages/flutter_tools/lib/src/android/android_sdk.dart index f97cc5b953..0bb5823b3c 100644 --- a/packages/flutter_tools/lib/src/android/android_sdk.dart +++ b/packages/flutter_tools/lib/src/android/android_sdk.dart @@ -46,7 +46,7 @@ const int minimumAndroidSdkVersion = 25; /// This should be used over accessing androidSdk.adbPath directly because it /// will work for those users who have Android Platform Tools installed but /// not the full SDK. -String getAdbPath([AndroidSdk existingSdk]) { +String getAdbPath([ AndroidSdk existingSdk ]) { if (existingSdk?.adbPath != null) return existingSdk.adbPath; @@ -63,7 +63,7 @@ String getAdbPath([AndroidSdk existingSdk]) { /// This should be used over accessing androidSdk.emulatorPath directly because it /// will work for those users who have Android Tools installed but /// not the full SDK. -String getEmulatorPath([AndroidSdk existingSdk]) { +String getEmulatorPath([ AndroidSdk existingSdk ]) { return existingSdk?.emulatorPath ?? AndroidSdk.locateAndroidSdk()?.emulatorPath; } @@ -100,7 +100,7 @@ String getAvdPath() { /// This should be used over accessing androidSdk.avdManagerPath directly because it /// will work for those users who have Android Tools installed but /// not the full SDK. -String getAvdManagerPath([AndroidSdk existingSdk]) { +String getAvdManagerPath([ AndroidSdk existingSdk ]) { return existingSdk?.avdManagerPath ?? AndroidSdk.locateAndroidSdk()?.avdManagerPath; } diff --git a/packages/flutter_tools/lib/src/android/android_studio.dart b/packages/flutter_tools/lib/src/android/android_studio.dart index a94b200704..58c7ca0756 100644 --- a/packages/flutter_tools/lib/src/android/android_studio.dart +++ b/packages/flutter_tools/lib/src/android/android_studio.dart @@ -219,7 +219,7 @@ class AndroidStudio implements Comparable { static List _allLinuxOrWindows() { final List studios = []; - bool _hasStudioAt(String path, {Version newerThan}) { + bool _hasStudioAt(String path, { Version newerThan }) { return studios.any((AndroidStudio studio) { if (studio.directory != path) return false; diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index fbde2ed5f0..ae2b9fbf8e 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart @@ -353,11 +353,12 @@ Future _buildGradleProjectV1(FlutterProject project, String gradle) async } Future _buildGradleProjectV2( - FlutterProject flutterProject, - String gradle, - BuildInfo buildInfo, - String target, - bool isBuildingBundle) async { + FlutterProject flutterProject, + String gradle, + BuildInfo buildInfo, + String target, + bool isBuildingBundle, +) async { final GradleProject project = await _gradleProject(); String assembleTask; diff --git a/packages/flutter_tools/lib/src/application_package.dart b/packages/flutter_tools/lib/src/application_package.dart index 989ca6fb76..e274519f3c 100644 --- a/packages/flutter_tools/lib/src/application_package.dart +++ b/packages/flutter_tools/lib/src/application_package.dart @@ -26,8 +26,9 @@ class ApplicationPackageFactory { static ApplicationPackageFactory get instance => context[ApplicationPackageFactory]; Future getPackageForPlatform( - TargetPlatform platform, - {File applicationBinary}) async { + TargetPlatform platform, { + File applicationBinary, + }) async { switch (platform) { case TargetPlatform.android_arm: case TargetPlatform.android_arm64: diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 9bf928009b..fad22286bc 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -30,7 +30,7 @@ enum Artifact { kernelWorkerSnapshot, } -String _artifactToFileName(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { +String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { switch (artifact) { case Artifact.genSnapshot: return 'gen_snapshot'; @@ -101,18 +101,18 @@ abstract class Artifacts { } // Returns the requested [artifact] for the [platform] and [mode] combination. - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]); + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]); // Returns which set of engine artifacts is currently used for the [platform] // and [mode] combination. - String getEngineType(TargetPlatform platform, [BuildMode mode]); + String getEngineType(TargetPlatform platform, [ BuildMode mode ]); } /// Manages the engine artifacts downloaded to the local cache. class CachedArtifacts extends Artifacts { @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { platform ??= _currentHostPlatform; switch (platform) { case TargetPlatform.android_arm: @@ -135,7 +135,7 @@ class CachedArtifacts extends Artifacts { } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) { + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) { return fs.path.basename(_getEngineArtifactsPath(platform, mode)); } @@ -207,7 +207,7 @@ class CachedArtifacts extends Artifacts { } } - String _getEngineArtifactsPath(TargetPlatform platform, [BuildMode mode]) { + String _getEngineArtifactsPath(TargetPlatform platform, [ BuildMode mode ]) { final String engineDir = cache.getArtifactDirectory('engine').path; final String platformName = getNameForTargetPlatform(platform); switch (platform) { @@ -252,7 +252,7 @@ class LocalEngineArtifacts extends Artifacts { String _hostEngineOutPath; @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { switch (artifact) { case Artifact.snapshotDart: return fs.path.join(_engineSrcPath, 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); @@ -287,7 +287,7 @@ class LocalEngineArtifacts extends Artifacts { } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) { + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) { return fs.path.basename(engineOutPath); } @@ -340,7 +340,7 @@ class OverrideArtifacts implements Artifacts { final File flutterPatchedSdk; @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { if (artifact == Artifact.frontendServerSnapshotForEngineDartSdk && frontendServer != null) { return frontendServer.path; } @@ -357,5 +357,5 @@ class OverrideArtifacts implements Artifacts { } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) => parent.getEngineType(platform, mode); + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) => parent.getEngineType(platform, mode); } diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index d97d81b79a..574e92d0ac 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -36,7 +36,7 @@ abstract class AssetBundle { bool wasBuiltOnce(); - bool needsBuild({String manifestPath = _ManifestAssetBundle.defaultManifestPath}); + bool needsBuild({ String manifestPath = _ManifestAssetBundle.defaultManifestPath }); /// Returns 0 for success; non-zero for failure. Future build({ @@ -75,7 +75,7 @@ class _ManifestAssetBundle implements AssetBundle { bool wasBuiltOnce() => _lastBuildTimestamp != null; @override - bool needsBuild({String manifestPath = defaultManifestPath}) { + bool needsBuild({ String manifestPath = defaultManifestPath }) { if (_lastBuildTimestamp == null) return true; @@ -303,9 +303,9 @@ final String _licenseSeparator = '\n' + ('-' * 80) + '\n'; /// Returns a DevFSContent representing the license file. Future _obtainLicenses( PackageMap packageMap, - String assetBase, - { bool reportPackages } -) async { + String assetBase, { + bool reportPackages, +}) async { // Read the LICENSE file from each package in the .packages file, splitting // each one into each component license (so that we can de-dupe if possible). // @@ -564,7 +564,8 @@ Map<_Asset, List<_Asset>> _parseAssets( return result; } -void _parseAssetsFromFolder(PackageMap packageMap, +void _parseAssetsFromFolder( + PackageMap packageMap, FlutterManifest flutterManifest, String assetBase, _AssetDirectoryCache cache, @@ -595,7 +596,8 @@ void _parseAssetsFromFolder(PackageMap packageMap, } } -void _parseAssetFromFile(PackageMap packageMap, +void _parseAssetFromFile( + PackageMap packageMap, FlutterManifest flutterManifest, String assetBase, _AssetDirectoryCache cache, diff --git a/packages/flutter_tools/lib/src/base/file_system.dart b/packages/flutter_tools/lib/src/base/file_system.dart index 3123e3502e..5bb23ab1d0 100644 --- a/packages/flutter_tools/lib/src/base/file_system.dart +++ b/packages/flutter_tools/lib/src/base/file_system.dart @@ -68,7 +68,7 @@ void ensureDirectoryExists(String filePath) { /// specified for each source/destination file pair. /// /// Creates `destDir` if needed. -void copyDirectorySync(Directory srcDir, Directory destDir, [void onFileCopied(File srcFile, File destFile)]) { +void copyDirectorySync(Directory srcDir, Directory destDir, [ void onFileCopied(File srcFile, File destFile) ]) { if (!srcDir.existsSync()) throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy'); @@ -151,7 +151,7 @@ String escapePath(String path) => platform.isWindows ? path.replaceAll('\\', '\\ /// Returns true, if [entity] does not exist. /// /// Returns false, if [entity] exists, but [referenceFile] does not. -bool isOlderThanReference({@required FileSystemEntity entity, @required File referenceFile}) { +bool isOlderThanReference({ @required FileSystemEntity entity, @required File referenceFile }) { if (!entity.existsSync()) return true; return referenceFile.existsSync() diff --git a/packages/flutter_tools/lib/src/base/io.dart b/packages/flutter_tools/lib/src/base/io.dart index a3de883629..862f43b943 100644 --- a/packages/flutter_tools/lib/src/base/io.dart +++ b/packages/flutter_tools/lib/src/base/io.dart @@ -95,7 +95,7 @@ ExitFunction get exit => _exitFunction; /// Sets the [exit] function to a function that throws an exception rather /// than exiting the process; this is intended for testing purposes. @visibleForTesting -void setExitFunctionForTests([ExitFunction exitFunction]) { +void setExitFunctionForTests([ ExitFunction exitFunction ]) { _exitFunction = exitFunction ?? (int exitCode) { throw ProcessExit(exitCode, immediate: true); }; diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index f0585de3c6..dc8fca3407 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart @@ -389,7 +389,7 @@ class VerboseLogger extends Logger { )..start(); } - void _emit(_LogType type, String message, [StackTrace stackTrace]) { + void _emit(_LogType type, String message, [ StackTrace stackTrace ]) { if (message.trim().isEmpty) return; diff --git a/packages/flutter_tools/lib/src/base/net.dart b/packages/flutter_tools/lib/src/base/net.dart index 5196fc796a..742bd8b00c 100644 --- a/packages/flutter_tools/lib/src/base/net.dart +++ b/packages/flutter_tools/lib/src/base/net.dart @@ -33,7 +33,7 @@ Future> fetchUrl(Uri url) async { Future doesRemoteFileExist(Uri url) async => (await _attempt(url, onlyHeaders: true)) != null; -Future> _attempt(Uri url, {bool onlyHeaders = false}) async { +Future> _attempt(Uri url, { bool onlyHeaders = false }) async { printTrace('Downloading: $url'); HttpClient httpClient; if (context[HttpClientFactory] != null) { diff --git a/packages/flutter_tools/lib/src/base/os.dart b/packages/flutter_tools/lib/src/base/os.dart index 54f5964146..4cb0e5c2e0 100644 --- a/packages/flutter_tools/lib/src/base/os.dart +++ b/packages/flutter_tools/lib/src/base/os.dart @@ -68,7 +68,7 @@ abstract class OperatingSystemUtils { return osNames.containsKey(osName) ? osNames[osName] : osName; } - List _which(String execName, {bool all = false}); + List _which(String execName, { bool all = false }); /// Returns the separator between items in the PATH environment variable. String get pathVarSeparator; @@ -83,7 +83,7 @@ class _PosixUtils extends OperatingSystemUtils { } @override - List _which(String execName, {bool all = false}) { + List _which(String execName, { bool all = false }) { final List command = ['which']; if (all) command.add('-a'); @@ -159,7 +159,7 @@ class _WindowsUtils extends OperatingSystemUtils { } @override - List _which(String execName, {bool all = false}) { + List _which(String execName, { bool all = false }) { // `where` always returns all matches, not just the first one. final ProcessResult result = processManager.runSync(['where', execName]); if (result.exitCode != 0) @@ -264,7 +264,7 @@ class _WindowsUtils extends OperatingSystemUtils { /// directory or the current working directory if none specified. /// Return null if the project root could not be found /// or if the project root is the flutter repository root. -String findProjectRoot([String directory]) { +String findProjectRoot([ String directory ]) { const String kProjectRootSentinel = 'pubspec.yaml'; directory ??= fs.currentDirectory.path; while (true) { diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart index 0e18d38821..fff1252646 100644 --- a/packages/flutter_tools/lib/src/base/process.dart +++ b/packages/flutter_tools/lib/src/base/process.dart @@ -94,7 +94,7 @@ Future runShutdownHooks() async { printTrace('Shutdown hooks complete'); } -Map _environment(bool allowReentrantFlutter, [Map environment]) { +Map _environment(bool allowReentrantFlutter, [ Map environment ]) { if (allowReentrantFlutter) { if (environment == null) environment = { 'FLUTTER_ALREADY_LOCKED': 'true' }; @@ -107,7 +107,8 @@ Map _environment(bool allowReentrantFlutter, [Map runCommand(List cmd, { +Future runCommand( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map environment @@ -128,7 +129,8 @@ Future runCommand(List cmd, { /// If [filter] is non-null, all lines that do not match it are removed. If /// [mapFunction] is present, all lines that match [filter] are also forwarded /// to [mapFunction] for further processing. -Future runCommandAndStreamOutput(List cmd, { +Future runCommandAndStreamOutput( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false, String prefix = '', @@ -187,7 +189,8 @@ Future runCommandAndStreamOutput(List cmd, { /// Runs the [command] interactively, connecting the stdin/stdout/stderr /// streams of this process to those of the child process. Completes with /// the exit code of the child process. -Future runInteractively(List command, { +Future runInteractively( + List command, { String workingDirectory, bool allowReentrantFlutter = false, Map environment @@ -219,7 +222,8 @@ Future runDetached(List cmd) { return proc; } -Future runAsync(List cmd, { +Future runAsync( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map environment @@ -235,7 +239,8 @@ Future runAsync(List cmd, { return runResults; } -Future runCheckedAsync(List cmd, { +Future runCheckedAsync( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map environment @@ -274,7 +279,8 @@ Future exitsHappyAsync(List cli) async { /// Run cmd and return stdout. /// /// Throws an error if cmd exits with a non-zero value. -String runCheckedSync(List cmd, { +String runCheckedSync( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false, bool hideStdout = false, @@ -292,7 +298,8 @@ String runCheckedSync(List cmd, { } /// Run cmd and return stdout. -String runSync(List cmd, { +String runSync( + List cmd, { String workingDirectory, bool allowReentrantFlutter = false }) { @@ -312,7 +319,8 @@ void _traceCommand(List args, { String workingDirectory }) { } } -String _runWithLoggingSync(List cmd, { +String _runWithLoggingSync( + List cmd, { bool checked = false, bool noisyErrors = false, bool throwStandardErrorOnError = false, diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index 2062631711..a309293e0e 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart @@ -79,7 +79,7 @@ String camelCase(String str) { final RegExp _upperRegex = RegExp(r'[A-Z]'); /// Convert `fooBar` to `foo_bar`. -String snakeCase(String str, [String sep = '_']) { +String snakeCase(String str, [ String sep = '_' ]) { return str.replaceAllMapped(_upperRegex, (Match m) => '${m.start == 0 ? '' : sep}${m[0].toLowerCase()}'); } @@ -343,7 +343,7 @@ const int kMinColumnWidth = 10; /// /// The [indent] and [hangingIndent] must be smaller than [columnWidth] when /// added together. -String wrapText(String text, {int columnWidth, int hangingIndent, int indent, bool shouldWrap}) { +String wrapText(String text, { int columnWidth, int hangingIndent, int indent, bool shouldWrap }) { if (text == null || text.isEmpty) { return ''; } @@ -431,7 +431,7 @@ class _AnsiRun { /// If [outputPreferences.wrapText] is false, then the text will be returned /// simply split at the newlines, but not wrapped. If [shouldWrap] is specified, /// then it overrides the [outputPreferences.wrapText] setting. -List _wrapTextAsLines(String text, {int start = 0, int columnWidth, bool shouldWrap}) { +List _wrapTextAsLines(String text, { int start = 0, int columnWidth, bool shouldWrap }) { if (text == null || text.isEmpty) { return ['']; } @@ -491,7 +491,7 @@ List _wrapTextAsLines(String text, {int start = 0, int columnWidth, bool return result; } - String joinRun(List<_AnsiRun> list, int start, [int end]) { + String joinRun(List<_AnsiRun> list, int start, [ int end ]) { return list.sublist(start, end).map((_AnsiRun run) => run.original).join().trim(); } diff --git a/packages/flutter_tools/lib/src/bundle.dart b/packages/flutter_tools/lib/src/bundle.dart index 2d810a8f55..ac3d2197cd 100644 --- a/packages/flutter_tools/lib/src/bundle.dart +++ b/packages/flutter_tools/lib/src/bundle.dart @@ -22,7 +22,7 @@ const String defaultAssetBasePath = '.'; const String defaultManifestPath = 'pubspec.yaml'; String get defaultDepfilePath => fs.path.join(getBuildDirectory(), 'snapshot_blob.bin.d'); -String getDefaultApplicationKernelPath({@required bool trackWidgetCreation}) { +String getDefaultApplicationKernelPath({ @required bool trackWidgetCreation }) { return getKernelPathForTransformerOptions( fs.path.join(getBuildDirectory(), 'app.dill'), trackWidgetCreation: trackWidgetCreation, @@ -222,7 +222,9 @@ Future assemble({ } Future writeBundle( - Directory bundleDir, Map assetEntries) async { + Directory bundleDir, + Map assetEntries, +) async { if (bundleDir.existsSync()) bundleDir.deleteSync(recursive: true); bundleDir.createSync(recursive: true); diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index fe5089ecb8..e1c1641501 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -524,8 +524,10 @@ class FlutterEngine extends CachedArtifact { } } - Future areRemoteArtifactsAvailable({String engineVersion, - bool includeAllPlatforms = true}) async { + Future areRemoteArtifactsAvailable({ + String engineVersion, + bool includeAllPlatforms = true, + }) async { final bool includeAllPlatformsState = cache.includeAllPlatforms; cache.includeAllPlatforms = includeAllPlatforms; diff --git a/packages/flutter_tools/lib/src/commands/attach.dart b/packages/flutter_tools/lib/src/commands/attach.dart index 81cfd2b20a..6f4dc417b4 100644 --- a/packages/flutter_tools/lib/src/commands/attach.dart +++ b/packages/flutter_tools/lib/src/commands/attach.dart @@ -275,18 +275,19 @@ class AttachCommand extends FlutterCommand { } class HotRunnerFactory { - HotRunner build(List devices, { - String target, - DebuggingOptions debuggingOptions, - bool usesTerminalUI = true, - bool benchmarkMode = false, - File applicationBinary, - bool hostIsIde = false, - String projectRootPath, - String packagesFilePath, - String dillOutputPath, - bool stayResident = true, - bool ipv6 = false, + HotRunner build( + List devices, { + String target, + DebuggingOptions debuggingOptions, + bool usesTerminalUI = true, + bool benchmarkMode = false, + File applicationBinary, + bool hostIsIde = false, + String projectRootPath, + String packagesFilePath, + String dillOutputPath, + bool stayResident = true, + bool ipv6 = false, }) => HotRunner( devices, target: target, diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index 2a13c4c398..53fdd7bc7c 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart @@ -395,7 +395,7 @@ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit return null; } - Future _generateModule(Directory directory, Map templateContext, {bool overwrite = false}) async { + Future _generateModule(Directory directory, Map templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -414,7 +414,7 @@ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit return generatedCount; } - Future _generatePackage(Directory directory, Map templateContext, {bool overwrite = false}) async { + Future _generatePackage(Directory directory, Map templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -431,7 +431,7 @@ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit return generatedCount; } - Future _generatePlugin(Directory directory, Map templateContext, {bool overwrite = false}) async { + Future _generatePlugin(Directory directory, Map templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -463,7 +463,7 @@ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit return generatedCount; } - Future _generateApp(Directory directory, Map templateContext, {bool overwrite = false}) async { + Future _generateApp(Directory directory, Map templateContext, { bool overwrite = false }) async { int generatedCount = 0; generatedCount += _renderTemplate('app', directory, templateContext, overwrite: overwrite); final FlutterProject project = await FlutterProject.fromDirectory(directory); @@ -536,7 +536,7 @@ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit }; } - int _renderTemplate(String templateName, Directory directory, Map context, {bool overwrite = false}) { + int _renderTemplate(String templateName, Directory directory, Map context, { bool overwrite = false }) { final Template template = Template.fromName(templateName); return template.render(directory, context, overwriteExisting: overwrite); } diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index a632028147..3e522a829e 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -161,7 +161,7 @@ class Daemon { void _send(Map map) => sendCommand(map); - void shutdown({dynamic error}) { + void shutdown({ dynamic error }) { _commandSubscription?.cancel(); for (Domain domain in _domainMap.values) domain.dispose(); @@ -210,7 +210,7 @@ abstract class Domain { }); } - void sendEvent(String name, [dynamic args]) { + void sendEvent(String name, [ dynamic args ]) { final Map map = { 'event': name }; if (args != null) map['params'] = _toJsonable(args); @@ -333,8 +333,12 @@ class AppDomain extends Domain { final List _apps = []; Future startApp( - Device device, String projectDirectory, String target, String route, - DebuggingOptions options, bool enableHotReload, { + Device device, + String projectDirectory, + String target, + String route, + DebuggingOptions options, + bool enableHotReload, { File applicationBinary, @required bool trackWidgetCreation, String projectRootPath, @@ -405,13 +409,14 @@ class AppDomain extends Domain { } Future launch( - ResidentRunner runner, - _RunOrAttach runOrAttach, - Device device, - String projectDirectory, - bool enableHotReload, - Directory cwd, - LaunchMode launchMode) async { + ResidentRunner runner, + _RunOrAttach runOrAttach, + Device device, + String projectDirectory, + bool enableHotReload, + Directory cwd, + LaunchMode launchMode, + ) async { final AppInstance app = AppInstance(_getNewAppId(), runner: runner, logToStdout: daemon.logToStdout); _apps.add(app); @@ -562,7 +567,7 @@ class AppDomain extends Domain { return _apps.firstWhere((AppInstance app) => app.id == id, orElse: () => null); } - void _sendAppEvent(AppInstance app, String name, [Map args]) { + void _sendAppEvent(AppInstance app, String name, [ Map args ]) { final Map eventArgs = { 'appId': app.id }; if (args != null) eventArgs.addAll(args); @@ -620,7 +625,7 @@ class DeviceDomain extends Domain { /// Return a list of the current devices, with each device represented as a map /// of properties (id, name, platform, ...). - Future>> getDevices([Map args]) async { + Future>> getDevices([ Map args ]) async { final List> devicesInfo = >[]; for (PollingDeviceDiscovery discoverer in _discoverers) { @@ -761,27 +766,27 @@ class NotifyingLogger extends Logger { @override void printError( - String message, { - StackTrace stackTrace, - bool emphasis = false, - TerminalColor color, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + StackTrace stackTrace, + bool emphasis = false, + TerminalColor color, + int indent, + int hangingIndent, + bool wrap, + }) { _messageController.add(LogMessage('error', message, stackTrace)); } @override void printStatus( - String message, { - bool emphasis = false, - TerminalColor color, - bool newline = true, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + bool emphasis = false, + TerminalColor color, + bool newline = true, + int indent, + int hangingIndent, + bool wrap, + }) { _messageController.add(LogMessage('status', message)); } @@ -851,7 +856,7 @@ class EmulatorDomain extends Domain { EmulatorManager emulators = EmulatorManager(); - Future>> getEmulators([Map args]) async { + Future>> getEmulators([ Map args ]) async { final List list = await emulators.getAllAvailableEmulators(); return list.map>(_emulatorToMap).toList(); } @@ -898,14 +903,14 @@ class _AppRunLogger extends Logger { @override void printError( - String message, { - StackTrace stackTrace, - bool emphasis, - TerminalColor color, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + StackTrace stackTrace, + bool emphasis, + TerminalColor color, + int indent, + int hangingIndent, + bool wrap, + }) { if (parent != null) { parent.printError( message, @@ -933,14 +938,14 @@ class _AppRunLogger extends Logger { @override void printStatus( - String message, { - bool emphasis = false, - TerminalColor color, - bool newline = true, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + bool emphasis = false, + TerminalColor color, + bool newline = true, + int indent, + int hangingIndent, + bool wrap, + }) { if (parent != null) { parent.printStatus( message, diff --git a/packages/flutter_tools/lib/src/commands/emulators.dart b/packages/flutter_tools/lib/src/commands/emulators.dart index 4821519e10..471a26de8a 100644 --- a/packages/flutter_tools/lib/src/commands/emulators.dart +++ b/packages/flutter_tools/lib/src/commands/emulators.dart @@ -83,7 +83,7 @@ class EmulatorsCommand extends FlutterCommand { } } - Future _createEmulator({String name}) async { + Future _createEmulator({ String name }) async { final CreateEmulatorResult createResult = await emulatorManager.createEmulator(name: name); @@ -118,8 +118,10 @@ class EmulatorsCommand extends FlutterCommand { _printAdditionalInfo(showCreateInstruction: true, showRunInstruction: true); } - void _printAdditionalInfo({ bool showRunInstruction = false, - bool showCreateInstruction = false }) { + void _printAdditionalInfo({ + bool showRunInstruction = false, + bool showCreateInstruction = false, + }) { printStatus(''); if (showRunInstruction) { printStatus( diff --git a/packages/flutter_tools/lib/src/commands/ide_config.dart b/packages/flutter_tools/lib/src/commands/ide_config.dart index f153b3be56..e9777794c2 100644 --- a/packages/flutter_tools/lib/src/commands/ide_config.dart +++ b/packages/flutter_tools/lib/src/commands/ide_config.dart @@ -266,7 +266,7 @@ class IdeConfigCommand extends FlutterCommand { /// Return null if the flutter root directory is a valid destination. Return a /// validation message if we should disallow the directory. -String _validateFlutterDir(String dirPath, {String flutterRoot}) { +String _validateFlutterDir(String dirPath, { String flutterRoot }) { final FileSystemEntityType type = fs.typeSync(dirPath); if (type != FileSystemEntityType.notFound) { diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 5f7c5d8738..cfd678a4c7 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -1187,7 +1187,8 @@ class PubDependencyTree { /// The transitive closure of all the dependencies for the given package, /// excluding any listen in `seen`. - Iterable getTransitiveDependenciesFor(String package, { + Iterable getTransitiveDependenciesFor( + String package, { @required Set seen, @required Set exclude, }) sync* { diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 8fa4ed74aa..4b69371e8e 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -22,7 +22,7 @@ import 'globals.dart'; KernelCompiler get kernelCompiler => context[KernelCompiler]; -typedef CompilerMessageConsumer = void Function(String message, {bool emphasis, TerminalColor color}); +typedef CompilerMessageConsumer = void Function(String message, { bool emphasis, TerminalColor color }); /// The target model describes the set of core libraries that are availible within /// the SDK. @@ -101,7 +101,7 @@ class StdoutHandler { // This is needed to get ready to process next compilation result output, // with its own boundary key and new completer. - void reset({bool suppressCompilerMessages = false}) { + void reset({ bool suppressCompilerMessages = false }) { boundaryKey = null; compilerMessageReceived = false; compilerOutput = Completer(); @@ -397,8 +397,12 @@ class ResidentCompiler { /// point that is used for recompilation. /// Binary file name is returned if compilation was successful, otherwise /// null is returned. - Future recompile(String mainPath, List invalidatedFiles, - {@required String outputPath, String packagesFilePath}) async { + Future recompile( + String mainPath, + List invalidatedFiles, { + @required String outputPath, + String packagesFilePath, + }) async { assert (outputPath != null); if (!_controller.hasListener) { _controller.stream.listen(_handleCompilationRequest); @@ -466,8 +470,11 @@ class ResidentCompiler { } } - Future _compile(String scriptUri, String outputPath, - String packagesFilePath) async { + Future _compile( + String scriptUri, + String outputPath, + String packagesFilePath, + ) async { final String frontendServer = artifacts.getArtifactPath( Artifact.frontendServerSnapshotForEngineDartSdk ); @@ -535,8 +542,14 @@ class ResidentCompiler { return _stdoutHandler.compilerOutput.future; } - Future compileExpression(String expression, List definitions, - List typeDefinitions, String libraryUri, String klass, bool isStatic) { + Future compileExpression( + String expression, + List definitions, + List typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) { if (!_controller.hasListener) { _controller.stream.listen(_handleCompilationRequest); } @@ -549,8 +562,7 @@ class ResidentCompiler { return completer.future; } - Future _compileExpression( - _CompileExpressionRequest request) async { + Future _compileExpression(_CompileExpressionRequest request) async { _stdoutHandler.reset(suppressCompilerMessages: true); // 'compile-expression' should be invoked after compiler has been started, diff --git a/packages/flutter_tools/lib/src/convert.dart b/packages/flutter_tools/lib/src/convert.dart index 83c8d7d55a..2aedb813cd 100644 --- a/packages/flutter_tools/lib/src/convert.dart +++ b/packages/flutter_tools/lib/src/convert.dart @@ -33,7 +33,7 @@ class Utf8Decoder extends cnv.Utf8Decoder { final bool reportErrors; @override - String convert(List codeUnits, [int start = 0, int end]) { + String convert(List codeUnits, [ int start = 0, int end ]) { final String result = super.convert(codeUnits, start, end); // Finding a unicode replacement character indicates that the input // was malformed. diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index ce61edace4..4de54f84a8 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -135,7 +135,8 @@ typedef MessageFilter = String Function(String message); /// /// [context] provides extra information to package server requests to /// understand usage. -Future pub(List arguments, { +Future pub( + List arguments, { @required PubContext context, String directory, MessageFilter filter, @@ -173,7 +174,8 @@ Future pub(List arguments, { /// Runs pub in 'interactive' mode, directly piping the stdin stream of this /// process to that of pub, and the stdout/stderr stream of pub to the corresponding /// streams of this process. -Future pubInteractively(List arguments, { +Future pubInteractively( + List arguments, { String directory, }) async { Cache.releaseLockEarly(); diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 95fc213349..66b473a5fc 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -634,11 +634,12 @@ class DevFS { return false; } - bool _shouldSkip(FileSystemEntity file, - String relativePath, - Uri directoryUriOnDevice, { - bool ignoreDotFiles = true, - }) { + bool _shouldSkip( + FileSystemEntity file, + String relativePath, + Uri directoryUriOnDevice, { + bool ignoreDotFiles = true, + }) { if (file is Directory) { // Skip non-files. return true; @@ -653,8 +654,7 @@ class DevFS { return false; } - Uri _directoryUriOnDevice(Uri directoryUriOnDevice, - Directory directory) { + Uri _directoryUriOnDevice(Uri directoryUriOnDevice, Directory directory) { if (directoryUriOnDevice == null) { final String relativeRootPath = fs.path.relative(directory.path, from: rootDirectory.path); if (relativeRootPath == '.') { @@ -668,10 +668,12 @@ class DevFS { /// Scan all files from the [fileFilter] that are contained in [directory] and /// pass various filters (e.g. ignoreDotFiles). - Future _scanFilteredDirectory(Set fileFilter, - Directory directory, - {Uri directoryUriOnDevice, - bool ignoreDotFiles = true}) async { + Future _scanFilteredDirectory( + Set fileFilter, + Directory directory, { + Uri directoryUriOnDevice, + bool ignoreDotFiles = true, + }) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); try { @@ -700,11 +702,13 @@ class DevFS { } /// Scan all files in [directory] that pass various filters (e.g. ignoreDotFiles). - Future _scanDirectory(Directory directory, - {Uri directoryUriOnDevice, - bool recursive = false, - bool ignoreDotFiles = true, - Set fileFilter}) async { + Future _scanDirectory( + Directory directory, { + Uri directoryUriOnDevice, + bool recursive = false, + bool ignoreDotFiles = true, + Set fileFilter, + }) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); if ((fileFilter != null) && fileFilter.isNotEmpty) { // When the fileFilter isn't empty, we can skip crawling the directory diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index dc2a84452b..65c46cad6f 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -247,7 +247,7 @@ abstract class Device { /// Get a log reader for this device. /// If [app] is specified, this will return a log reader specific to that /// application. Otherwise, a global log reader will be returned. - DeviceLogReader getLogReader({ApplicationPackage app}); + DeviceLogReader getLogReader({ ApplicationPackage app }); /// Get the port forwarder for this device. DevicePortForwarder get portForwarder; @@ -425,7 +425,7 @@ abstract class DevicePortForwarder { /// Forward [hostPort] on the host to [devicePort] on the device. /// If [hostPort] is null or zero, will auto select a host port. /// Returns a Future that completes with the host port. - Future forward(int devicePort, {int hostPort}); + Future forward(int devicePort, { int hostPort }); /// Stops forwarding [forwardedPort]. Future unforward(ForwardedPort forwardedPort); @@ -471,7 +471,7 @@ class NoOpDevicePortForwarder implements DevicePortForwarder { const NoOpDevicePortForwarder(); @override - Future forward(int devicePort, {int hostPort}) async => devicePort; + Future forward(int devicePort, { int hostPort }) async => devicePort; @override List get forwardedPorts => []; diff --git a/packages/flutter_tools/lib/src/emulator.dart b/packages/flutter_tools/lib/src/emulator.dart index 51d0706d74..3672d44ff6 100644 --- a/packages/flutter_tools/lib/src/emulator.dart +++ b/packages/flutter_tools/lib/src/emulator.dart @@ -61,7 +61,7 @@ class EmulatorManager { } /// Return the list of all available emulators. - Future createEmulator({String name}) async { + Future createEmulator({ String name }) async { if (name == null || name == '') { const String autoName = 'flutter_emulator'; // Don't use getEmulatorsMatching here, as it will only return one diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart index e874d6b061..bb27e0c682 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart @@ -92,7 +92,7 @@ class _FuchsiaLogSink implements EventSink { } @override - void addError(Object error, [StackTrace stackTrace]) { + void addError(Object error, [ StackTrace stackTrace ]) { _outputSink.addError(error, stackTrace); } @@ -205,7 +205,7 @@ class FuchsiaDevice extends Device { Future get sdkNameAndVersion async => 'Fuchsia'; @override - DeviceLogReader getLogReader({ApplicationPackage app}) => _logReader ??= _FuchsiaLogReader(this, app); + DeviceLogReader getLogReader({ ApplicationPackage app }) => _logReader ??= _FuchsiaLogReader(this, app); _FuchsiaLogReader _logReader; @override @@ -397,7 +397,7 @@ class _FuchsiaPortForwarder extends DevicePortForwarder { final Map _processes = {}; @override - Future forward(int devicePort, {int hostPort}) async { + Future forward(int devicePort, { int hostPort }) async { hostPort ??= await _findPort(); // Note: the provided command works around a bug in -N, see US-515 // for more explanation. diff --git a/packages/flutter_tools/lib/src/intellij/intellij.dart b/packages/flutter_tools/lib/src/intellij/intellij.dart index 7bed197efe..4976613e35 100644 --- a/packages/flutter_tools/lib/src/intellij/intellij.dart +++ b/packages/flutter_tools/lib/src/intellij/intellij.dart @@ -17,8 +17,11 @@ class IntelliJPlugins { static final Version kMinFlutterPluginVersion = Version(16, 0, 0); void validatePackage( - List messages, List packageNames, String title, - {Version minVersion}) { + List messages, + List packageNames, + String title, { + Version minVersion, + }) { for (String packageName in packageNames) { if (!_hasPackage(packageName)) { continue; diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 43efdf3dcc..c4e092eaee 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -374,7 +374,7 @@ class IOSDevice extends Device { Future get sdkNameAndVersion async => 'iOS $_sdkVersion'; @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { _logReaders ??= {}; return _logReaders.putIfAbsent(app, () => _IOSDeviceLogReader(this, app)); } @@ -551,7 +551,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { static const Duration _kiProxyPortForwardTimeout = Duration(seconds: 1); @override - Future forward(int devicePort, {int hostPort}) async { + Future forward(int devicePort, { int hostPort }) async { final bool autoselect = hostPort == null || hostPort == 0; if (autoselect) hostPort = 1024; diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 90c2d674a2..525a1da86b 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -139,7 +139,7 @@ class SimControl { return result; } - Future launch(String deviceId, String appIdentifier, [List launchArgs]) { + Future launch(String deviceId, String appIdentifier, [ List launchArgs ]) { final List args = [_xcrunPath, 'simctl', 'launch', deviceId, appIdentifier]; if (launchArgs != null) args.addAll(launchArgs); @@ -434,7 +434,7 @@ class IOSSimulator extends Device { } @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { assert(app is IOSApp); _logReaders ??= {}; return _logReaders.putIfAbsent(app, () => _IOSSimulatorLogReader(this, app)); @@ -700,7 +700,7 @@ class _IOSSimulatorDevicePortForwarder extends DevicePortForwarder { } @override - Future forward(int devicePort, {int hostPort}) async { + Future forward(int devicePort, { int hostPort }) async { if (hostPort == null || hostPort == 0) { hostPort = devicePort; } diff --git a/packages/flutter_tools/lib/src/linux/linux_device.dart b/packages/flutter_tools/lib/src/linux/linux_device.dart index 18637d10da..c9c991acb3 100644 --- a/packages/flutter_tools/lib/src/linux/linux_device.dart +++ b/packages/flutter_tools/lib/src/linux/linux_device.dart @@ -17,7 +17,7 @@ class LinuxDevice extends Device { void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('linux'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('linux'); @override Future installApp(ApplicationPackage app) { @@ -50,7 +50,8 @@ class LinuxDevice extends Device { Future get sdkNameAndVersion async => os.name; @override - Future startApp(ApplicationPackage package, { + Future startApp( + ApplicationPackage package, { String mainPath, String route, DebuggingOptions debuggingOptions, diff --git a/packages/flutter_tools/lib/src/macos/macos_device.dart b/packages/flutter_tools/lib/src/macos/macos_device.dart index 7ba605b7ab..ac4c7bfdf5 100644 --- a/packages/flutter_tools/lib/src/macos/macos_device.dart +++ b/packages/flutter_tools/lib/src/macos/macos_device.dart @@ -23,7 +23,7 @@ class MacOSDevice extends Device { void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('macos'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('macos'); // Since the host and target devices are the same, no work needs to be done // to install the application. @@ -56,7 +56,8 @@ class MacOSDevice extends Device { Future get sdkNameAndVersion async => os.name; @override - Future startApp(covariant MacOSApp package, { + Future startApp( + covariant MacOSApp package, { String mainPath, String route, DebuggingOptions debuggingOptions, diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 576240d153..8db4102a09 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -141,7 +141,8 @@ class FlutterDevice { await Future.wait(futures).timeout(const Duration(seconds: 2), onTimeout: () { }); } - Future setupDevFS(String fsName, + Future setupDevFS( + String fsName, Directory rootDirectory, { String packagesFilePath }) { @@ -472,7 +473,7 @@ abstract class ResidentRunner { String get projectRootPath => _projectRootPath; String _mainPath; String get mainPath => _mainPath; - String getReloadPath({bool fullRestart}) => mainPath + (fullRestart ? '' : '.incremental') + '.dill'; + String getReloadPath({ bool fullRestart }) => mainPath + (fullRestart ? '' : '.incremental') + '.dill'; AssetBundle _assetBundle; AssetBundle get assetBundle => _assetBundle; @@ -980,7 +981,7 @@ class OperationResult { /// Given the value of the --target option, return the path of the Dart file /// where the app's main function should be. -String findMainDartFile([String target]) { +String findMainDartFile([ String target ]) { target ??= ''; final String targetPath = fs.path.absolute(target); if (fs.isDirectorySync(targetPath)) diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index 116768ae68..cae7e4f8b2 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -141,8 +141,11 @@ class HotRunner extends ResidentRunner { return true; } - Future _reloadSourcesService(String isolateId, - { bool force = false, bool pause = false }) async { + Future _reloadSourcesService( + String isolateId, { + bool force = false, + bool pause = false, + }) async { // TODO(cbernaschina): check that isolateId is the id of the UI isolate. final OperationResult result = await restart(pauseAfterRestart: pause); if (!result.isOk) { @@ -164,10 +167,15 @@ class HotRunner extends ResidentRunner { } } - Future _compileExpressionService(String isolateId, String expression, - List definitions, List typeDefinitions, - String libraryUri, String klass, bool isStatic, - ) async { + Future _compileExpressionService( + String isolateId, + String expression, + List definitions, + List typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) async { for (FlutterDevice device in flutterDevices) { if (device.generator != null) { final CompilerOutput compilerOutput = @@ -433,10 +441,12 @@ class HotRunner extends ResidentRunner { await Future.wait(futures); } - Future _launchInView(FlutterDevice device, - Uri entryUri, - Uri packagesUri, - Uri assetsDirectoryUri) { + Future _launchInView( + FlutterDevice device, + Uri entryUri, + Uri packagesUri, + Uri assetsDirectoryUri, + ) { final List> futures = >[]; for (FlutterView view in device.views) futures.add(view.runFromSource(entryUri, packagesUri, assetsDirectoryUri)); @@ -538,8 +548,10 @@ class HotRunner extends ResidentRunner { /// Returns [true] if the reload was successful. /// Prints errors if [printErrors] is [true]. - static bool validateReloadReport(Map reloadReport, - { bool printErrors = true }) { + static bool validateReloadReport( + Map reloadReport, { + bool printErrors = true, + }) { if (reloadReport == null) { if (printErrors) printError('Hot reload did not receive reload report.'); diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index f3c903dcb0..fc93ba6abe 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -139,7 +139,7 @@ abstract class FlutterCommand extends Command { /// /// [hide] indicates whether or not to hide these options when the user asks /// for help. - void usesFilesystemOptions({@required bool hide}) { + void usesFilesystemOptions({ @required bool hide }) { argParser ..addOption('output-dill', hide: hide, @@ -216,7 +216,7 @@ abstract class FlutterCommand extends Command { valueHelp: 'x.y.z'); } - void usesIsolateFilterOption({@required bool hide}) { + void usesIsolateFilterOption({ @required bool hide }) { argParser.addOption('isolate-filter', defaultsTo: null, hide: hide, @@ -224,7 +224,7 @@ abstract class FlutterCommand extends Command { 'Normally there\'s only one, but when adding Flutter to a pre-existing app it\'s possible to create multiple.'); } - void addBuildModeFlags({bool defaultToRelease = true, bool verboseHelp = false}) { + void addBuildModeFlags({ bool defaultToRelease = true, bool verboseHelp = false }) { defaultBuildMode = defaultToRelease ? BuildMode.release : BuildMode.debug; argParser.addFlag('debug', @@ -242,7 +242,7 @@ abstract class FlutterCommand extends Command { help: 'Enable dynamic code. Only allowed with --release or --profile.'); } - void addDynamicModeFlags({bool verboseHelp = false}) { + void addDynamicModeFlags({ bool verboseHelp = false }) { argParser.addOption('compilation-trace-file', defaultsTo: 'compilation.txt', hide: !verboseHelp, @@ -260,7 +260,7 @@ abstract class FlutterCommand extends Command { ); } - void addDynamicPatchingFlags({bool verboseHelp = false}) { + void addDynamicPatchingFlags({ bool verboseHelp = false }) { argParser.addOption('patch-number', hide: !verboseHelp, help: 'An integer used as an internal version number for dynamic patch.\n' @@ -291,7 +291,7 @@ abstract class FlutterCommand extends Command { addDynamicBaselineFlags(verboseHelp: verboseHelp); } - void addDynamicBaselineFlags({bool verboseHelp = false}) { + void addDynamicBaselineFlags({ bool verboseHelp = false }) { argParser.addOption('baseline-dir', defaultsTo: '.baseline', hide: !verboseHelp, @@ -301,7 +301,7 @@ abstract class FlutterCommand extends Command { ); } - void usesFuchsiaOptions({bool hide = false}) { + void usesFuchsiaOptions({ bool hide = false }) { argParser.addOption( 'target-model', help: 'Target model that determines what core libraries are available', diff --git a/packages/flutter_tools/lib/src/services.dart b/packages/flutter_tools/lib/src/services.dart index fee5383981..2eb5560d82 100644 --- a/packages/flutter_tools/lib/src/services.dart +++ b/packages/flutter_tools/lib/src/services.dart @@ -26,8 +26,9 @@ dynamic _loadYamlFile(String path) { /// Loads all services specified in `pubspec.yaml`. Parses each service config file, /// storing meta data in [services] and the list of jar files in [jars]. Future parseServiceConfigs( - List> services, { List jars } -) async { + List> services, { + List jars, +}) async { Map packageMap; try { packageMap = PackageMap(PackageMap.globalPackagesPath).map; @@ -95,7 +96,8 @@ Future getServiceFromUrl(String url, String rootDir, String serviceName) /// ] /// } File generateServiceDefinitions( - String dir, List> servicesIn + String dir, + List> servicesIn, ) { final List> services = servicesIn.map>((Map service) => { diff --git a/packages/flutter_tools/lib/src/test/event_printer.dart b/packages/flutter_tools/lib/src/test/event_printer.dart index e672f207b6..81fd579864 100644 --- a/packages/flutter_tools/lib/src/test/event_printer.dart +++ b/packages/flutter_tools/lib/src/test/event_printer.dart @@ -18,7 +18,7 @@ class EventPrinter extends TestWatcher { {'observatoryUri': event.observatoryUri.toString()}); } - void _sendEvent(String name, [dynamic params]) { + void _sendEvent(String name, [ dynamic params ]) { final Map map = { 'event': name}; if (params != null) { map['params'] = params; diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index f93900f1c4..451cf1ac38 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -463,10 +463,15 @@ class _FlutterPlatform extends PlatformPlugin { return remoteChannel; } - Future _compileExpressionService(String isolateId, String expression, - List definitions, List typeDefinitions, - String libraryUri, String klass, bool isStatic, - ) async { + Future _compileExpressionService( + String isolateId, + String expression, + List definitions, + List typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) async { if (compiler == null || compiler.compiler == null) { throw 'Compiler is not set up properly to compile $expression'; } @@ -807,8 +812,12 @@ class _FlutterPlatform extends PlatformPlugin { return outOfBandError; } - String _createListenerDart(List<_Finalizer> finalizers, int ourTestCount, - String testPath, HttpServer server) { + String _createListenerDart( + List<_Finalizer> finalizers, + int ourTestCount, + String testPath, + HttpServer server, + ) { // Prepare a temporary directory to store the Dart file that will talk to us. final Directory tempDir = fs.systemTempDirectory.createTempSync('flutter_test_listener.'); finalizers.add(() async { @@ -1061,7 +1070,7 @@ class _FlutterPlatformStreamSinkWrapper implements StreamSink { @override void add(S event) => _parent.add(event); @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) => _parent.addError(errorEvent, stackTrace); + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) => _parent.addError(errorEvent, stackTrace); @override Future addStream(Stream stream) => _parent.addStream(stream); } diff --git a/packages/flutter_tools/lib/src/tester/flutter_tester.dart b/packages/flutter_tools/lib/src/tester/flutter_tester.dart index ea52c548f7..463d84c812 100644 --- a/packages/flutter_tools/lib/src/tester/flutter_tester.dart +++ b/packages/flutter_tools/lib/src/tester/flutter_tester.dart @@ -71,7 +71,7 @@ class FlutterTesterDevice extends Device { _FlutterTesterDeviceLogReader(); @override - DeviceLogReader getLogReader({ApplicationPackage app}) => _logReader; + DeviceLogReader getLogReader({ ApplicationPackage app }) => _logReader; @override Future installApp(ApplicationPackage app) async => true; @@ -235,7 +235,7 @@ class _FlutterTesterDeviceLogReader extends DeviceLogReader { /// where the VM is running on the same machine and does not need ports forwarding. class _NoopPortForwarder extends DevicePortForwarder { @override - Future forward(int devicePort, {int hostPort}) { + Future forward(int devicePort, { int hostPort }) { if (hostPort != null && hostPort != devicePort) throw 'Forwarding to a different port is not supported by flutter tester'; return Future.value(devicePort); diff --git a/packages/flutter_tools/lib/src/usage.dart b/packages/flutter_tools/lib/src/usage.dart index 72d5857775..3cd6c63304 100644 --- a/packages/flutter_tools/lib/src/usage.dart +++ b/packages/flutter_tools/lib/src/usage.dart @@ -91,8 +91,11 @@ class Usage { _analytics.sendScreenView(command, parameters: parameters); } - void sendEvent(String category, String parameter, - { Map parameters }) { + void sendEvent( + String category, + String parameter, { + Map parameters, + }) { if (suppressAnalytics) return; @@ -106,7 +109,7 @@ class Usage { String variableName, Duration duration, { String label, - }) { + }) { if (!suppressAnalytics) { _analytics.sendTiming( variableName, diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index bd65cc3151..e196816613 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -120,7 +120,7 @@ class FlutterVersion { /// A date String describing the last framework commit. String get frameworkCommitDate => _latestGitCommitDate(); - static String _latestGitCommitDate([String branch]) { + static String _latestGitCommitDate([ String branch ]) { final List args = ['git', 'log']; if (branch != null) @@ -171,7 +171,7 @@ class FlutterVersion { static FlutterVersion get instance => context[FlutterVersion]; /// Return a short string for the version (e.g. `master/0.0.59-pre.92`, `scroll_refactor/a76bc8e22b`). - String getVersionString({bool redactUnknownBranches = false}) { + String getVersionString({ bool redactUnknownBranches = false }) { if (frameworkVersion != 'unknown') return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkVersion'; return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkRevisionShort'; @@ -496,7 +496,7 @@ class VersionCheckError implements Exception { /// /// If [lenient] is true and the command fails, returns an empty string. /// Otherwise, throws a [ToolExit] exception. -String _runSync(List command, {bool lenient = true}) { +String _runSync(List command, { bool lenient = true }) { final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot); if (results.exitCode == 0) diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index 2585c502a0..545443ee8f 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -379,8 +379,10 @@ String _stripRef(String type) => _hasRef(type) ? type.substring(1) : type; /// recursively walk the response and replace values that are service maps with /// actual [ServiceObject]s. During the upgrade the owner is given a chance /// to return a cached / canonicalized object. -void _upgradeCollection(dynamic collection, - ServiceObjectOwner owner) { +void _upgradeCollection( + dynamic collection, + ServiceObjectOwner owner, +) { if (collection is ServiceMap) return; if (collection is Map) { @@ -827,7 +829,8 @@ class VM extends ServiceObjectOwner { } /// Invoke the RPC and return the raw response. - Future> invokeRpcRaw(String method, { + Future> invokeRpcRaw( + String method, { Map params = const {}, }) async { printTrace('Sending to VM service: $method($params)'); @@ -847,7 +850,8 @@ class VM extends ServiceObjectOwner { } /// Invoke the RPC and return a [ServiceObject] response. - Future invokeRpc(String method, { + Future invokeRpc( + String method, { Map params = const {}, }) async { final Map response = await invokeRpcRaw( @@ -873,7 +877,8 @@ class VM extends ServiceObjectOwner { } // Write one file into a file system. - Future> writeDevFSFile(String fsName, { + Future> writeDevFSFile( + String fsName, { @required String path, @required List fileContents }) { @@ -911,10 +916,12 @@ class VM extends ServiceObjectOwner { return invokeRpcRaw('_deleteDevFS', params: { 'fsName': fsName }); } - Future runInView(String viewId, - Uri main, - Uri packages, - Uri assetsDirectory) { + Future runInView( + String viewId, + Uri main, + Uri packages, + Uri assetsDirectory, + ) { return invokeRpc('_flutter.runInView', params: { 'viewId': viewId, @@ -1090,7 +1097,8 @@ class Isolate extends ServiceObjectOwner { Future> _fetchDirect() => invokeRpcRaw('getIsolate'); /// Invoke the RPC and return the raw response. - Future> invokeRpcRaw(String method, { + Future> invokeRpcRaw( + String method, { Map params, }) { // Inject the 'isolateId' parameter. @@ -1134,10 +1142,11 @@ class Isolate extends ServiceObjectOwner { static const int kIsolateReloadBarred = 1005; - Future> reloadSources( - { bool pause = false, - Uri rootLibUri, - Uri packagesUri}) async { + Future> reloadSources({ + bool pause = false, + Uri rootLibUri, + Uri packagesUri, + }) async { try { final Map arguments = { 'pause': pause @@ -1222,9 +1231,8 @@ class Isolate extends ServiceObjectOwner { // available, returns null. Future> invokeFlutterExtensionRpcRaw( String method, { - Map params, - } - ) async { + Map params, + }) async { try { return await invokeRpcRaw(method, params: params); } on rpc.RpcException catch (e) { @@ -1314,7 +1322,7 @@ class Isolate extends ServiceObjectOwner { return invokeFlutterExtensionRpcRaw('ext.flutter.exit'); } - Future flutterPlatformOverride([String platform]) async { + Future flutterPlatformOverride([ String platform ]) async { final Map result = await invokeFlutterExtensionRpcRaw( 'ext.flutter.platformOverride', params: platform != null ? { 'value': platform } : {}, @@ -1386,7 +1394,7 @@ class ServiceMap extends ServiceObject implements Map { void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update); Map retype() => _map.cast(); @override - dynamic update(String key, dynamic update(dynamic value), {dynamic ifAbsent()}) => _map.update(key, update, ifAbsent: ifAbsent); + dynamic update(String key, dynamic update(dynamic value), { dynamic ifAbsent() }) => _map.update(key, update, ifAbsent: ifAbsent); } /// Peered to an Android/iOS FlutterView widget on a device. @@ -1404,9 +1412,11 @@ class FlutterView extends ServiceObject { } // TODO(johnmccutchan): Report errors when running failed. - Future runFromSource(Uri entryUri, - Uri packagesUri, - Uri assetsDirectoryUri) async { + Future runFromSource( + Uri entryUri, + Uri packagesUri, + Uri assetsDirectoryUri, + ) async { final String viewId = id; // When this completer completes the isolate is running. final Completer completer = Completer(); diff --git a/packages/flutter_tools/lib/src/vmservice_record_replay.dart b/packages/flutter_tools/lib/src/vmservice_record_replay.dart index 086868222e..9da5bf437f 100644 --- a/packages/flutter_tools/lib/src/vmservice_record_replay.dart +++ b/packages/flutter_tools/lib/src/vmservice_record_replay.dart @@ -180,7 +180,7 @@ class _RecordingSink implements StreamSink { } @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) { + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) { throw UnimplementedError('Add support for this if the need ever arises'); } @@ -272,7 +272,7 @@ class _ReplaySink implements StreamSink { } @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) { + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) { throw UnimplementedError('Add support for this if the need ever arises'); } diff --git a/packages/flutter_tools/lib/src/vscode/vscode.dart b/packages/flutter_tools/lib/src/vscode/vscode.dart index c9503fd187..94c9a048f2 100644 --- a/packages/flutter_tools/lib/src/vscode/vscode.dart +++ b/packages/flutter_tools/lib/src/vscode/vscode.dart @@ -189,8 +189,7 @@ class VsCode { ]); } - static List _findInstalled( - List<_VsCodeInstallLocation> allLocations) { + static List _findInstalled(List<_VsCodeInstallLocation> allLocations) { final Iterable<_VsCodeInstallLocation> searchLocations = _includeInsiders ? allLocations diff --git a/packages/flutter_tools/lib/src/windows/windows_device.dart b/packages/flutter_tools/lib/src/windows/windows_device.dart index 954efecbba..005e100aaf 100644 --- a/packages/flutter_tools/lib/src/windows/windows_device.dart +++ b/packages/flutter_tools/lib/src/windows/windows_device.dart @@ -17,7 +17,7 @@ class WindowsDevice extends Device { void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('windows'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('windows'); @override Future installApp(ApplicationPackage app) { @@ -50,7 +50,8 @@ class WindowsDevice extends Device { Future get sdkNameAndVersion async => os.name; @override - Future startApp(ApplicationPackage package, { + Future startApp( + ApplicationPackage package, { String mainPath, String route, DebuggingOptions debuggingOptions, diff --git a/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart b/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart index a30b8cb1c8..648a092549 100644 --- a/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart @@ -26,7 +26,7 @@ void main() { // rolls into Flutter. return path?.replaceAll('/', fs.path.separator); } - void writePubspecFile(String path, String name, {String fontsSection}) { + void writePubspecFile(String path, String name, { String fontsSection }) { if (fontsSection == null) { fontsSection = ''; } else { diff --git a/packages/flutter_tools/test/asset_bundle_package_test.dart b/packages/flutter_tools/test/asset_bundle_package_test.dart index 9ed6f039f6..2ea79460ec 100644 --- a/packages/flutter_tools/test/asset_bundle_package_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_test.dart @@ -26,7 +26,7 @@ void main() { // rolls into Flutter. return path?.replaceAll('/', fs.path.separator); } - void writePubspecFile(String path, String name, {List assets}) { + void writePubspecFile(String path, String name, { List assets }) { String assetsSection; if (assets == null) { assetsSection = ''; diff --git a/packages/flutter_tools/test/base/net_test.dart b/packages/flutter_tools/test/base/net_test.dart index c99182c4a9..dd867ed505 100644 --- a/packages/flutter_tools/test/base/net_test.dart +++ b/packages/flutter_tools/test/base/net_test.dart @@ -192,8 +192,11 @@ class MockHttpClientResponse extends Stream> implements io.HttpClientR String get reasonPhrase => ''; @override - StreamSubscription> listen(void onData(List event), { - Function onError, void onDone(), bool cancelOnError + StreamSubscription> listen( + void onData(List event), { + Function onError, + void onDone(), + bool cancelOnError, }) { return Stream>.fromFuture(Future>.error(const io.SocketException('test'))) .listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); diff --git a/packages/flutter_tools/test/base/process_test.dart b/packages/flutter_tools/test/base/process_test.dart index f8976902c7..2139a5457d 100644 --- a/packages/flutter_tools/test/base/process_test.dart +++ b/packages/flutter_tools/test/base/process_test.dart @@ -69,7 +69,7 @@ void main() { mockLogger = BufferLogger(); }); - MockProcess Function(List) processMetaFactory(List stdout, {List stderr = const []}) { + MockProcess Function(List) processMetaFactory(List stdout, { List stderr = const [] }) { final Stream> stdoutStream = Stream>.fromIterable(stdout.map>((String s) => s.codeUnits)); final Stream> stderrStream = diff --git a/packages/flutter_tools/test/cache_test.dart b/packages/flutter_tools/test/cache_test.dart index 03912cb446..41840a3834 100644 --- a/packages/flutter_tools/test/cache_test.dart +++ b/packages/flutter_tools/test/cache_test.dart @@ -154,7 +154,7 @@ class MockFileSystem extends ForwardingFileSystem { class MockFile extends Mock implements File { @override - Future open({FileMode mode = FileMode.read}) async { + Future open({ FileMode mode = FileMode.read }) async { return MockRandomAccessFile(); } } diff --git a/packages/flutter_tools/test/channel_test.dart b/packages/flutter_tools/test/channel_test.dart index 1e6ea10df1..6e985c9050 100644 --- a/packages/flutter_tools/test/channel_test.dart +++ b/packages/flutter_tools/test/channel_test.dart @@ -18,7 +18,7 @@ import 'package:process/process.dart'; import 'src/common.dart'; import 'src/context.dart'; -Process createMockProcess({int exitCode = 0, String stdout = '', String stderr = ''}) { +Process createMockProcess({ int exitCode = 0, String stdout = '', String stderr = '' }) { final Stream> stdoutStream = Stream>.fromIterable(>[ utf8.encode(stdout), ]); diff --git a/packages/flutter_tools/test/commands/create_test.dart b/packages/flutter_tools/test/commands/create_test.dart index 70ad7467f8..21fa293845 100644 --- a/packages/flutter_tools/test/commands/create_test.dart +++ b/packages/flutter_tools/test/commands/create_test.dart @@ -956,7 +956,7 @@ Future _analyzeProject(String workingDir) async { expect(exec.exitCode, 0); } -Future _runFlutterTest(Directory workingDir, {String target}) async { +Future _runFlutterTest(Directory workingDir, { String target }) async { final String flutterToolsPath = fs.path.absolute(fs.path.join( 'bin', 'flutter_tools.dart', @@ -1057,8 +1057,11 @@ class MockHttpClientResponse extends Stream> implements HttpClientResp String get reasonPhrase => ''; @override - StreamSubscription> listen(void onData(List event), { - Function onError, void onDone(), bool cancelOnError + StreamSubscription> listen( + void onData(List event), { + Function onError, + void onDone(), + bool cancelOnError }) { return Stream>.fromIterable(>[result.codeUnits]) .listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); diff --git a/packages/flutter_tools/test/commands/devices_test.dart b/packages/flutter_tools/test/commands/devices_test.dart index f3fa1260b9..a63f19bdaf 100644 --- a/packages/flutter_tools/test/commands/devices_test.dart +++ b/packages/flutter_tools/test/commands/devices_test.dart @@ -42,27 +42,27 @@ void main() { class MockProcessManager extends Mock implements ProcessManager { @override Future run( - List command, { - String workingDirectory, - Map environment, - bool includeParentEnvironment = true, - bool runInShell = false, - Encoding stdoutEncoding = systemEncoding, - Encoding stderrEncoding = systemEncoding, - }) async { + List command, { + String workingDirectory, + Map environment, + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = systemEncoding, + Encoding stderrEncoding = systemEncoding, + }) async { return ProcessResult(0, 0, '', ''); } @override ProcessResult runSync( - List command, { - String workingDirectory, - Map environment, - bool includeParentEnvironment = true, - bool runInShell = false, - Encoding stdoutEncoding = systemEncoding, - Encoding stderrEncoding = systemEncoding, - }) { + List command, { + String workingDirectory, + Map environment, + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = systemEncoding, + Encoding stderrEncoding = systemEncoding, + }) { return ProcessResult(0, 0, '', ''); } } diff --git a/packages/flutter_tools/test/commands/drive_test.dart b/packages/flutter_tools/test/commands/drive_test.dart index bf61d20f52..81a435c059 100644 --- a/packages/flutter_tools/test/commands/drive_test.dart +++ b/packages/flutter_tools/test/commands/drive_test.dart @@ -26,7 +26,7 @@ void main() { MemoryFileSystem fs; Directory tempDir; - void withMockDevice([Device mock]) { + void withMockDevice([ Device mock ]) { mockDevice = mock ?? MockDevice(); targetDeviceFinder = () async => mockDevice; testDeviceManager.addDevice(mockDevice); diff --git a/packages/flutter_tools/test/commands/ide_config_test.dart b/packages/flutter_tools/test/commands/ide_config_test.dart index f3959a1b61..4f4bf24dba 100644 --- a/packages/flutter_tools/test/commands/ide_config_test.dart +++ b/packages/flutter_tools/test/commands/ide_config_test.dart @@ -20,7 +20,7 @@ void main() { Directory intellijDir; Directory toolsDir; - Map _getFilesystemContents([Directory root]) { + Map _getFilesystemContents([ Directory root ]) { final String tempPath = tempDir.absolute.path; final List paths = (root ?? tempDir).listSync(recursive: true).map((FileSystemEntity entity) { @@ -39,7 +39,7 @@ void main() { return contents; } - Map _getManifest(Directory base, String marker, {bool isTemplate = false}) { + Map _getManifest(Directory base, String marker, { bool isTemplate = false }) { final String basePath = fs.path.relative(base.path, from: tempDir.absolute.path); final String suffix = isTemplate ? Template.copyTemplateExtension : ''; return { diff --git a/packages/flutter_tools/test/commands/packages_test.dart b/packages/flutter_tools/test/commands/packages_test.dart index 051bd39089..d7a471895c 100644 --- a/packages/flutter_tools/test/commands/packages_test.dart +++ b/packages/flutter_tools/test/commands/packages_test.dart @@ -45,7 +45,7 @@ void main() { tryToDelete(tempDir); }); - Future createProjectWithPlugin(String plugin, {List arguments}) async { + Future createProjectWithPlugin(String plugin, { List arguments }) async { final String projectPath = await createProject(tempDir, arguments: arguments); final File pubspec = fs.file(fs.path.join(projectPath, 'pubspec.yaml')); String content = await pubspec.readAsString(); diff --git a/packages/flutter_tools/test/commands/test_test.dart b/packages/flutter_tools/test/commands/test_test.dart index 4c05295233..cefe0bd3f2 100644 --- a/packages/flutter_tools/test/commands/test_test.dart +++ b/packages/flutter_tools/test/commands/test_test.dart @@ -90,7 +90,7 @@ void main() { }); } -Future _testFile(String testName, String workingDirectory, String testDirectory, {Matcher exitCode}) async { +Future _testFile(String testName, String workingDirectory, String testDirectory, { Matcher exitCode }) async { exitCode ??= isNonZero; final String fullTestExpectation = fs.path.join(testDirectory, '${testName}_expectation.txt'); final File expectationFile = fs.file(fullTestExpectation); diff --git a/packages/flutter_tools/test/compile_test.dart b/packages/flutter_tools/test/compile_test.dart index ba7ae68a6c..5bef8cc30d 100644 --- a/packages/flutter_tools/test/compile_test.dart +++ b/packages/flutter_tools/test/compile_test.dart @@ -502,9 +502,12 @@ example:org-dartlang-app:/ }); } -Future _recompile(StreamController> streamController, - ResidentCompiler generator, MockStdIn mockFrontendServerStdIn, - String mockCompilerOutput) async { +Future _recompile( + StreamController> streamController, + ResidentCompiler generator, + MockStdIn mockFrontendServerStdIn, + String mockCompilerOutput, +) async { // Put content into the output stream after generator.recompile gets // going few lines below, resets completer. scheduleMicrotask(() { @@ -565,12 +568,12 @@ class MockStdIn extends Mock implements IOSink { } @override - void write([Object o = '']) { + void write([ Object o = '' ]) { _stdInWrites.write(o); } @override - void writeln([Object o = '']) { + void writeln([ Object o = '' ]) { _stdInWrites.writeln(o); } } diff --git a/packages/flutter_tools/test/crash_reporting_test.dart b/packages/flutter_tools/test/crash_reporting_test.dart index f3255c6e94..cac269ef77 100644 --- a/packages/flutter_tools/test/crash_reporting_test.dart +++ b/packages/flutter_tools/test/crash_reporting_test.dart @@ -216,16 +216,16 @@ class _NoopIOSink implements IOSink { void write(_) {} @override - void writeAll(_, [__ = '']) {} + void writeAll(_, [ __ = '' ]) {} @override - void writeln([_ = '']) {} + void writeln([ _ = '' ]) {} @override void writeCharCode(_) {} @override - void addError(_, [__]) {} + void addError(_, [ __ ]) {} @override Future addStream(_) async {} diff --git a/packages/flutter_tools/test/dart/pub_get_test.dart b/packages/flutter_tools/test/dart/pub_get_test.dart index abd5d8b2f9..f3552c2c8d 100644 --- a/packages/flutter_tools/test/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/dart/pub_get_test.dart @@ -200,7 +200,7 @@ class MockStream implements Stream { Stream where(bool test(T event)) => MockStream(); @override - StreamSubscription listen(void onData(T event), {Function onError, void onDone(), bool cancelOnError}) { + StreamSubscription listen(void onData(T event), { Function onError, void onDone(), bool cancelOnError }) { return MockStreamSubscription(); } @@ -210,7 +210,7 @@ class MockStream implements Stream { class MockStreamSubscription implements StreamSubscription { @override - Future asFuture([E futureValue]) => Future.value(); + Future asFuture([ E futureValue ]) => Future.value(); @override Future cancel() async { } @@ -236,7 +236,7 @@ class MockFileSystem extends ForwardingFileSystem { class MockFile implements File { @override - Future open({FileMode mode = FileMode.read}) async { + Future open({ FileMode mode = FileMode.read }) async { return MockRandomAccessFile(); } diff --git a/packages/flutter_tools/test/devfs_test.dart b/packages/flutter_tools/test/devfs_test.dart index 5a96c7da94..16ccf40849 100644 --- a/packages/flutter_tools/test/devfs_test.dart +++ b/packages/flutter_tools/test/devfs_test.dart @@ -604,7 +604,8 @@ class MockVM implements VM { } @override - Future> invokeRpcRaw(String method, { + Future> invokeRpcRaw( + String method, { Map params = const {}, Duration timeout, bool timeoutFatal = true, diff --git a/packages/flutter_tools/test/flutter_manifest_test.dart b/packages/flutter_tools/test/flutter_manifest_test.dart index 424c9da164..b4f4508730 100644 --- a/packages/flutter_tools/test/flutter_manifest_test.dart +++ b/packages/flutter_tools/test/flutter_manifest_test.dart @@ -494,8 +494,11 @@ flutter: expect(flutterManifest.isEmpty, false); } - void testUsingContextAndFs(String description, FileSystem filesystem, - dynamic testMethod()) { + void testUsingContextAndFs( + String description, + FileSystem filesystem, + dynamic testMethod(), + ) { testUsingContext(description, () async { writeEmptySchemaFile(filesystem); diff --git a/packages/flutter_tools/test/integration/test_driver.dart b/packages/flutter_tools/test/integration/test_driver.dart index 952f227109..dcb011d2cf 100644 --- a/packages/flutter_tools/test/integration/test_driver.dart +++ b/packages/flutter_tools/test/integration/test_driver.dart @@ -120,7 +120,7 @@ abstract class FlutterTestDriver { _stderr.stream.listen((String message) => _debugPrint(message, topic: '<=stderr=')); } - Future connectToVmService({bool pauseOnExceptions = false}) async { + Future connectToVmService({ bool pauseOnExceptions = false }) async { _vmService = await vmServiceConnectUri('$_vmServiceWsUri'); _vmService.onSend.listen((String s) => _debugPrint(s, topic: '=vm=>')); _vmService.onReceive.listen((String s) => _debugPrint(s, topic: '<=vm=')); @@ -240,11 +240,11 @@ abstract class FlutterTestDriver { ); } - Future resume({bool waitForNextPause = false}) => _resume(null, waitForNextPause); - Future stepOver({bool waitForNextPause = true}) => _resume(StepOption.kOver, waitForNextPause); + Future resume({ bool waitForNextPause = false }) => _resume(null, waitForNextPause); + Future stepOver({ bool waitForNextPause = true }) => _resume(StepOption.kOver, waitForNextPause); Future stepOverAsync({ bool waitForNextPause = true }) => _resume(StepOption.kOverAsyncSuspension, waitForNextPause); - Future stepInto({bool waitForNextPause = true}) => _resume(StepOption.kInto, waitForNextPause); - Future stepOut({bool waitForNextPause = true}) => _resume(StepOption.kOut, waitForNextPause); + Future stepInto({ bool waitForNextPause = true }) => _resume(StepOption.kInto, waitForNextPause); + Future stepOut({ bool waitForNextPause = true }) => _resume(StepOption.kOut, waitForNextPause); Future isAtAsyncSuspension() async { final Isolate isolate = await _getFlutterIsolate(); @@ -354,7 +354,8 @@ abstract class FlutterTestDriver { ).whenComplete(subscription.cancel); } - Future _timeoutWithMessages(Future Function() callback, { + Future _timeoutWithMessages( + Future Function() callback, { @required String task, Duration timeout = defaultTimeout, }) { @@ -491,10 +492,10 @@ class FlutterRunTestDriver extends FlutterTestDriver { _currentRunningAppId = (await started)['params']['appId']; } - Future hotRestart({bool pause = false}) => _restart(fullRestart: true, pause: pause); + Future hotRestart({ bool pause = false }) => _restart(fullRestart: true, pause: pause); Future hotReload() => _restart(fullRestart: false); - Future _restart({bool fullRestart = false, bool pause = false}) async { + Future _restart({ bool fullRestart = false, bool pause = false }) async { if (_currentRunningAppId == null) throw Exception('App has not started yet'); diff --git a/packages/flutter_tools/test/ios/cocoapods_test.dart b/packages/flutter_tools/test/ios/cocoapods_test.dart index 3a8384c32d..78454d749c 100644 --- a/packages/flutter_tools/test/ios/cocoapods_test.dart +++ b/packages/flutter_tools/test/ios/cocoapods_test.dart @@ -572,5 +572,5 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by class MockProcessManager extends Mock implements ProcessManager {} class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterpreter {} -ProcessResult exitsWithError([String stdout = '']) => ProcessResult(1, 1, stdout, ''); -ProcessResult exitsHappy([String stdout = '']) => ProcessResult(1, 0, stdout, ''); +ProcessResult exitsWithError([ String stdout = '' ]) => ProcessResult(1, 1, stdout, ''); +ProcessResult exitsHappy([ String stdout = '' ]) => ProcessResult(1, 0, stdout, ''); diff --git a/packages/flutter_tools/test/protocol_discovery_test.dart b/packages/flutter_tools/test/protocol_discovery_test.dart index c4e905028d..4c71291f15 100644 --- a/packages/flutter_tools/test/protocol_discovery_test.dart +++ b/packages/flutter_tools/test/protocol_discovery_test.dart @@ -228,7 +228,7 @@ class MockPortForwarder extends DevicePortForwarder { final int availablePort; @override - Future forward(int devicePort, {int hostPort}) async { + Future forward(int devicePort, { int hostPort }) async { hostPort ??= 0; if (hostPort == 0) { return availablePort; diff --git a/packages/flutter_tools/test/src/common.dart b/packages/flutter_tools/test/src/common.dart index c672e98edf..44f65560f1 100644 --- a/packages/flutter_tools/test/src/common.dart +++ b/packages/flutter_tools/test/src/common.dart @@ -68,7 +68,7 @@ String getFlutterRoot() { return fs.path.normalize(fs.path.join(toolsPath, '..', '..')); } -CommandRunner createTestCommandRunner([FlutterCommand command]) { +CommandRunner createTestCommandRunner([ FlutterCommand command ]) { final FlutterCommandRunner runner = FlutterCommandRunner(); if (command != null) runner.addCommand(command); @@ -76,15 +76,17 @@ CommandRunner createTestCommandRunner([FlutterCommand command]) { } /// Updates [path] to have a modification time [seconds] from now. -void updateFileModificationTime(String path, - DateTime baseTime, - int seconds) { +void updateFileModificationTime( + String path, + DateTime baseTime, + int seconds, +) { final DateTime modificationTime = baseTime.add(Duration(seconds: seconds)); fs.file(path).setLastModifiedSync(modificationTime); } /// Matcher for functions that throw [ToolExit]. -Matcher throwsToolExit({int exitCode, Pattern message}) { +Matcher throwsToolExit({ int exitCode, Pattern message }) { Matcher matcher = isToolExit; if (exitCode != null) matcher = allOf(matcher, (ToolExit e) => e.exitCode == exitCode); @@ -97,7 +99,7 @@ Matcher throwsToolExit({int exitCode, Pattern message}) { final Matcher isToolExit = isInstanceOf(); /// Matcher for functions that throw [ProcessExit]. -Matcher throwsProcessExit([dynamic exitCode]) { +Matcher throwsProcessExit([ dynamic exitCode ]) { return exitCode == null ? throwsA(isProcessExit) : throwsA(allOf(isProcessExit, (ProcessExit e) => e.exitCode == exitCode)); @@ -109,7 +111,7 @@ final Matcher isProcessExit = isInstanceOf(); /// Creates a flutter project in the [temp] directory using the /// [arguments] list if specified, or `--no-pub` if not. /// Returns the path to the flutter project. -Future createProject(Directory temp, {List arguments}) async { +Future createProject(Directory temp, { List arguments }) async { arguments ??= ['--no-pub']; final String projectPath = fs.path.join(temp.path, 'flutter_project'); final CreateCommand command = CreateCommand(); diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index 92ae65eaac..143a791c0f 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart @@ -38,7 +38,9 @@ MockDoctor get testDoctor => context[Doctor]; typedef ContextInitializer = void Function(AppContext testContext); @isTest -void testUsingContext(String description, dynamic testMethod(), { +void testUsingContext( + String description, + dynamic testMethod(), { Timeout timeout, Map overrides = const {}, bool initializeFlutterRoot = true, diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index 3dcc063b15..015b96e7ff 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart @@ -268,12 +268,12 @@ class MemoryIOSink implements IOSink { } @override - void writeln([Object obj = '']) { + void writeln([ Object obj = '' ]) { add(encoding.encode('$obj\n')); } @override - void writeAll(Iterable objects, [String separator = '']) { + void writeAll(Iterable objects, [ String separator = '' ]) { bool addSeparator = false; for (dynamic object in objects) { if (addSeparator) { @@ -285,7 +285,7 @@ class MemoryIOSink implements IOSink { } @override - void addError(dynamic error, [StackTrace stackTrace]) { + void addError(dynamic error, [ StackTrace stackTrace ]) { throw UnimplementedError(); } @@ -482,7 +482,7 @@ class MockResidentCompiler extends BasicMock implements ResidentCompiler { return null; } @override - Future recompile(String mainPath, List invalidatedFiles, {String outputPath, String packagesFilePath}) async { + Future recompile(String mainPath, List invalidatedFiles, { String outputPath, String packagesFilePath }) async { fs.file(outputPath).createSync(recursive: true); fs.file(outputPath).writeAsStringSync('compiled_kernel_output'); return CompilerOutput(outputPath, 0); diff --git a/packages/flutter_tools/test/version_test.dart b/packages/flutter_tools/test/version_test.dart index 17963e3eab..d25c57ce08 100644 --- a/packages/flutter_tools/test/version_test.dart +++ b/packages/flutter_tools/test/version_test.dart @@ -442,7 +442,7 @@ void fakeData( }); final Answering syncAnswer = (Invocation invocation) { - bool argsAre(String a1, [String a2, String a3, String a4, String a5, String a6, String a7, String a8]) { + bool argsAre(String a1, [ String a2, String a3, String a4, String a5, String a6, String a7, String a8 ]) { const ListEquality equality = ListEquality(); final List args = invocation.positionalArguments.single; final List expectedArgs = [a1, a2, a3, a4, a5, a6, a7, a8].where((String arg) => arg != null).toList(); diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart index d44308c14d..adcd157bf6 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart @@ -32,8 +32,11 @@ final Logger _log = Logger('FuchsiaRemoteConnection'); /// `interface` and `configFile`. The config file is used primarily for the /// default SSH port forwarding configuration. typedef PortForwardingFunction = Future Function( - String address, int remotePort, - [String interface, String configFile]); + String address, + int remotePort, [ + String interface, + String configFile, +]); /// The function for forwarding the local machine's ports to a remote Fuchsia /// device. @@ -128,8 +131,7 @@ class FuchsiaRemoteConnection { /// Same as [FuchsiaRemoteConnection.connect] albeit with a provided /// [SshCommandRunner] instance. - static Future connectWithSshCommandRunner( - SshCommandRunner commandRunner) async { + static Future connectWithSshCommandRunner(SshCommandRunner commandRunner) async { final FuchsiaRemoteConnection connection = FuchsiaRemoteConnection._( isIpV6Address(commandRunner.address), commandRunner); await connection._forwardLocalPortsToDeviceServicePorts(); @@ -474,7 +476,7 @@ class FuchsiaRemoteConnection { /// Runs a dummy heartbeat command on all Dart VM instances. /// /// Removes any failing ports from the cache. - Future _checkPorts([bool queueEvents = true]) async { + Future _checkPorts([ bool queueEvents = true ]) async { // Filters out stale ports after connecting. Ignores results. await _invokeForAllVms>( (DartVm vmService) async { @@ -591,8 +593,12 @@ class _SshPortForwarder implements PortForwarder { /// Starts SSH forwarding through a subprocess, and returns an instance of /// [_SshPortForwarder]. - static Future<_SshPortForwarder> start(String address, int remotePort, - [String interface, String sshConfigPath]) async { + static Future<_SshPortForwarder> start( + String address, + int remotePort, [ + String interface, + String sshConfigPath, + ]) async { final bool isIpV6 = isIpV6Address(address); final ServerSocket localSocket = await _createLocalSocket(); if (localSocket == null || localSocket.port == 0) { diff --git a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart index c7444af698..4204e66c4d 100644 --- a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart +++ b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart @@ -34,8 +34,11 @@ void main() { forwardedPorts = []; int port = 0; Future mockPortForwardingFunction( - String address, int remotePort, - [String interface = '', String configFile]) { + String address, + int remotePort, [ + String interface = '', + String configFile, + ]) { return Future(() { final MockPortForwarder pf = MockPortForwarder(); forwardedPorts.add(pf);