diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index 8e6138a35e..50eabff8e6 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -25,18 +25,18 @@ abstract class _ErrorDiagnostic extends DiagnosticsProperty> { /// interactive display of errors. _ErrorDiagnostic( String message, { - DiagnosticsTreeStyle style = DiagnosticsTreeStyle.flat, - DiagnosticLevel level = DiagnosticLevel.info, - }) : assert(message != null), - super( - null, - [message], - showName: false, - showSeparator: false, - defaultValue: null, - style: style, - level: level, - ); + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.flat, + DiagnosticLevel level = DiagnosticLevel.info, + }) : assert(message != null), + super( + null, + [message], + showName: false, + showSeparator: false, + defaultValue: null, + style: style, + level: level, + ); /// In debug builds, a kernel transformer rewrites calls to the default /// constructors for [ErrorSummary], [ErrorDetails], and [ErrorHint] to use diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index f3c3513958..b4c77ed872 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -1097,8 +1097,8 @@ class TextTreeRenderer { /// single line style does not provide any meaningful style for how children /// should be connected to their parents. TextTreeConfiguration _childTextConfiguration( - DiagnosticsNode child, - TextTreeConfiguration textStyle, + DiagnosticsNode child, + TextTreeConfiguration textStyle, ) { final DiagnosticsTreeStyle childStyle = child?.style; return (_isSingleLine(childStyle) || childStyle == DiagnosticsTreeStyle.errorProperty) ? textStyle : child.textTreeConfiguration; @@ -1588,9 +1588,9 @@ abstract class DiagnosticsNode { /// The provided `nodes` may be properties or children of the `parent` /// [DiagnosticsNode]. static List> toJsonList( - List nodes, - DiagnosticsNode parent, - DiagnosticsSerializationDelegate delegate, + List nodes, + DiagnosticsNode parent, + DiagnosticsSerializationDelegate delegate, ) { bool truncated = false; if (nodes == null) diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 2151ccac46..5f20f4f6db 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -322,8 +322,8 @@ class BottomNavigationBar extends StatefulWidget { // [BottomNavigationBarType.fixed] is used for 3 or fewer items, and // [BottomNavigationBarType.shifting] is used for 4+ items. static BottomNavigationBarType _type( - BottomNavigationBarType type, - List items, + BottomNavigationBarType type, + List items, ) { if (type != null) { return type; diff --git a/packages/flutter/lib/src/material/range_slider.dart b/packages/flutter/lib/src/material/range_slider.dart index 5b6b600450..565a108aff 100644 --- a/packages/flutter/lib/src/material/range_slider.dart +++ b/packages/flutter/lib/src/material/range_slider.dart @@ -476,13 +476,13 @@ class _RangeSliderState extends State with TickerProviderStateMixin // non-zero displacement is negative, then the left thumb is selected, and if its // positive, then the right thumb is selected. static final RangeThumbSelector _defaultRangeThumbSelector = ( - TextDirection textDirection, - RangeValues values, - double tapValue, - Size thumbSize, - Size trackSize, - double dx, // The horizontal delta or displacement of the drag update. - ) { + TextDirection textDirection, + RangeValues values, + double tapValue, + Size thumbSize, + Size trackSize, + double dx, // The horizontal delta or displacement of the drag update. + ) { final double touchRadius = math.max(thumbSize.width, RangeSlider._minTouchTargetWidth) / 2; final bool inStartTouchTarget = (tapValue - values.start).abs() * trackSize.width < touchRadius; final bool inEndTouchTarget = (tapValue - values.end).abs() * trackSize.width < touchRadius; diff --git a/packages/flutter/lib/src/material/slider_theme.dart b/packages/flutter/lib/src/material/slider_theme.dart index 8b3c5f5baa..4d2599f228 100644 --- a/packages/flutter/lib/src/material/slider_theme.dart +++ b/packages/flutter/lib/src/material/slider_theme.dart @@ -1626,16 +1626,16 @@ class RoundedRectSliderTrackShape extends SliderTrackShape with BaseSliderTrackS @override void paint( - PaintingContext context, - Offset offset, { - @required RenderBox parentBox, - @required SliderThemeData sliderTheme, - @required Animation enableAnimation, - @required TextDirection textDirection, - @required Offset thumbCenter, - bool isDiscrete = false, - bool isEnabled = false, - }) { + PaintingContext context, + Offset offset, { + @required RenderBox parentBox, + @required SliderThemeData sliderTheme, + @required Animation enableAnimation, + @required TextDirection textDirection, + @required Offset thumbCenter, + bool isDiscrete = false, + bool isEnabled = false, + }) { assert(context != null); assert(offset != null); assert(parentBox != null); diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 534e003d9e..c5d86f35d7 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -1483,7 +1483,7 @@ class MaterialBasedCupertinoThemeData extends CupertinoThemeData { /// /// The [materialTheme] parameter must not be null. MaterialBasedCupertinoThemeData({ - @required ThemeData materialTheme, + @required ThemeData materialTheme, }) : this._( materialTheme, (materialTheme.cupertinoOverrideTheme ?? const CupertinoThemeData()).noDefault(), diff --git a/packages/flutter/lib/src/painting/colors.dart b/packages/flutter/lib/src/painting/colors.dart index 4f0aaa5f25..16cdc446b9 100644 --- a/packages/flutter/lib/src/painting/colors.dart +++ b/packages/flutter/lib/src/painting/colors.dart @@ -469,10 +469,10 @@ class ColorProperty extends DiagnosticsProperty { ColorProperty( String name, Color value, { - bool showName = true, - Object defaultValue = kNoDefaultValue, - DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, - DiagnosticLevel level = DiagnosticLevel.info, + bool showName = true, + Object defaultValue = kNoDefaultValue, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(style != null), assert(level != null), diff --git a/packages/flutter/lib/src/painting/gradient.dart b/packages/flutter/lib/src/painting/gradient.dart index 3c64a0d52d..374cc98330 100644 --- a/packages/flutter/lib/src/painting/gradient.dart +++ b/packages/flutter/lib/src/painting/gradient.dart @@ -37,11 +37,11 @@ Color _sample(List colors, List stops, double t) { } _ColorsAndStops _interpolateColorsAndStops( - List aColors, - List aStops, - List bColors, - List bStops, - double t, + List aColors, + List aStops, + List bColors, + List bStops, + double t, ) { assert(aColors.length >= 2); assert(bColors.length >= 2); diff --git a/packages/flutter/lib/src/painting/matrix_utils.dart b/packages/flutter/lib/src/painting/matrix_utils.dart index 0f9ee235fe..7f60282026 100644 --- a/packages/flutter/lib/src/painting/matrix_utils.dart +++ b/packages/flutter/lib/src/painting/matrix_utils.dart @@ -164,9 +164,7 @@ class MatrixUtils { } static Float64List _minMax; - static void _accumulate(Float64List m, double x, double y, - bool first, bool isAffine) - { + static void _accumulate(Float64List m, double x, double y, bool first, bool isAffine) { final double w = isAffine ? 1.0 : 1.0 / (m[3] * x + m[7] * y + m[15]); final double tx = (m[0] * x + m[4] * y + m[12]) * w; final double ty = (m[1] * x + m[5] * y + m[13]) * w; diff --git a/packages/flutter/lib/src/painting/shader_warm_up.dart b/packages/flutter/lib/src/painting/shader_warm_up.dart index 33334a69d0..8840f8b085 100644 --- a/packages/flutter/lib/src/painting/shader_warm_up.dart +++ b/packages/flutter/lib/src/painting/shader_warm_up.dart @@ -99,9 +99,10 @@ abstract class ShaderWarmUp { /// issues seen so far. class DefaultShaderWarmUp extends ShaderWarmUp { /// Allow [DefaultShaderWarmUp] to be used as the default value of parameters. - const DefaultShaderWarmUp( - {this.drawCallSpacing = 0.0, - this.canvasSize = const ui.Size(100.0, 100.0)}); + const DefaultShaderWarmUp({ + this.drawCallSpacing = 0.0, + this.canvasSize = const ui.Size(100.0, 100.0), + }); /// Constant that can be used to space out draw calls for visualizing the draws /// for debugging purposes (example: 80.0). Be sure to also change your canvas diff --git a/packages/flutter/lib/src/widgets/heroes.dart b/packages/flutter/lib/src/widgets/heroes.dart index d7f02a0105..749eaad605 100644 --- a/packages/flutter/lib/src/widgets/heroes.dart +++ b/packages/flutter/lib/src/widgets/heroes.dart @@ -250,9 +250,9 @@ class Hero extends StatefulWidget { // should be considered for animation when `navigator` transitions from one // PageRoute to another. static Map _allHeroesFor( - BuildContext context, - bool isUserGestureTransition, - NavigatorState navigator, + BuildContext context, + bool isUserGestureTransition, + NavigatorState navigator, ) { assert(context != null); assert(isUserGestureTransition != null); diff --git a/packages/flutter/lib/src/widgets/icon_data.dart b/packages/flutter/lib/src/widgets/icon_data.dart index 6b2c7761d7..f854541eb3 100644 --- a/packages/flutter/lib/src/widgets/icon_data.dart +++ b/packages/flutter/lib/src/widgets/icon_data.dart @@ -75,10 +75,10 @@ class IconDataProperty extends DiagnosticsProperty { IconDataProperty( String name, IconData value, { - String ifNull, - bool showName = true, - DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, - DiagnosticLevel level = DiagnosticLevel.info, + String ifNull, + bool showName = true, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(style != null), assert(level != null), diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index abcd7f89a2..44be3f30d3 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -1625,17 +1625,17 @@ mixin WidgetInspectorService { /// * [getChildrenDetailsSubtree], a method to get children of a node /// in the details subtree. String getDetailsSubtree( - String id, - String groupName, { - int subtreeDepth = 2, - }) { + String id, + String groupName, { + int subtreeDepth = 2, + }) { return _safeJsonEncode(_getDetailsSubtree( id, groupName, subtreeDepth)); } Map _getDetailsSubtree( - String id, - String groupName, - int subtreeDepth, + String id, + String groupName, + int subtreeDepth, ) { final DiagnosticsNode root = toObject(id); if (root == null) { diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index fd23bf47fb..91986d0a44 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -83,8 +83,8 @@ class PathBoundsMatcher extends Matcher { class PathPointsMatcher extends Matcher { const PathPointsMatcher({ - this.includes = const [], - this.excludes = const [], + this.includes = const [], + this.excludes = const [], }) : super(); final Iterable includes; diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 90d9f7e46f..66b92e90f1 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -1291,9 +1291,7 @@ void main() { expect(selectedIndex, 13); }); - testWidgets('Dropdown button will accept widgets as its underline', ( - WidgetTester tester) async { - + testWidgets('Dropdown button will accept widgets as its underline', (WidgetTester tester) async { const BoxDecoration decoration = BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xFFCCBB00), width: 4.0)), ); diff --git a/packages/flutter/test/material/scrollbar_test.dart b/packages/flutter/test/material/scrollbar_test.dart index 32fb7b08ab..903fa2b7a2 100644 --- a/packages/flutter/test/material/scrollbar_test.dart +++ b/packages/flutter/test/material/scrollbar_test.dart @@ -20,9 +20,9 @@ class TestCanvas implements Canvas { } Widget _buildBoilerplate({ - TextDirection textDirection = TextDirection.ltr, - EdgeInsets padding = EdgeInsets.zero, - Widget child, + TextDirection textDirection = TextDirection.ltr, + EdgeInsets padding = EdgeInsets.zero, + Widget child, }) { return Directionality( textDirection: textDirection, diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index bfa15797d6..40416727c9 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -27,19 +27,19 @@ class LoggingThumbShape extends SliderComponentShape { @override void paint( - PaintingContext context, - Offset thumbCenter, { - Animation activationAnimation, - Animation enableAnimation, - bool isEnabled, - bool isDiscrete, - bool onActiveTrack, - TextPainter labelPainter, - RenderBox parentBox, - SliderThemeData sliderTheme, - TextDirection textDirection, - double value, - }) { + PaintingContext context, + Offset thumbCenter, { + Animation activationAnimation, + Animation enableAnimation, + bool isEnabled, + bool isDiscrete, + bool onActiveTrack, + TextPainter labelPainter, + RenderBox parentBox, + SliderThemeData sliderTheme, + TextDirection textDirection, + double value, + }) { log.add(thumbCenter); final Paint thumbPaint = Paint()..color = Colors.red; context.canvas.drawCircle(thumbCenter, 5.0, thumbPaint); @@ -54,15 +54,15 @@ class TallSliderTickMarkShape extends SliderTickMarkShape { @override void paint( - PaintingContext context, - Offset offset, { - Offset thumbCenter, - RenderBox parentBox, - SliderThemeData sliderTheme, - Animation enableAnimation, - bool isEnabled, - TextDirection textDirection, - }) { + PaintingContext context, + Offset offset, { + Offset thumbCenter, + RenderBox parentBox, + SliderThemeData sliderTheme, + Animation enableAnimation, + bool isEnabled, + TextDirection textDirection, + }) { final Paint paint = Paint()..color = Colors.red; context.canvas.drawRect(Rect.fromLTWH(offset.dx, offset.dy, 10.0, 20.0), paint); } diff --git a/packages/flutter/test/rendering/recording_canvas.dart b/packages/flutter/test/rendering/recording_canvas.dart index 654f6436a8..d56af80b65 100644 --- a/packages/flutter/test/rendering/recording_canvas.dart +++ b/packages/flutter/test/rendering/recording_canvas.dart @@ -104,30 +104,55 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex } @override - ClipRectLayer pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, - PaintingContextCallback painter, { Clip clipBehavior = Clip.hardEdge, ClipRectLayer oldLayer }) { + ClipRectLayer pushClipRect( + bool needsCompositing, + Offset offset, + Rect clipRect, + PaintingContextCallback painter, { + Clip clipBehavior = Clip.hardEdge, + ClipRectLayer oldLayer, + }) { clipRectAndPaint(clipRect.shift(offset), clipBehavior, clipRect.shift(offset), () => painter(this, offset)); return null; } @override - ClipRRectLayer pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, - PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipRRectLayer oldLayer }) { + ClipRRectLayer pushClipRRect( + bool needsCompositing, + Offset offset, + Rect bounds, + RRect clipRRect, + PaintingContextCallback painter, { + Clip clipBehavior = Clip.antiAlias, + ClipRRectLayer oldLayer, + }) { assert(clipBehavior != null); clipRRectAndPaint(clipRRect.shift(offset), clipBehavior, bounds.shift(offset), () => painter(this, offset)); return null; } @override - ClipPathLayer pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, - PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipPathLayer oldLayer }) { + ClipPathLayer pushClipPath( + bool needsCompositing, + Offset offset, + Rect bounds, + Path clipPath, + PaintingContextCallback painter, { + Clip clipBehavior = Clip.antiAlias, + ClipPathLayer oldLayer, + }) { clipPathAndPaint(clipPath.shift(offset), clipBehavior, bounds.shift(offset), () => painter(this, offset)); return null; } @override - TransformLayer pushTransform(bool needsCompositing, Offset offset, Matrix4 transform, - PaintingContextCallback painter, { TransformLayer oldLayer }) { + TransformLayer pushTransform( + bool needsCompositing, + Offset offset, + Matrix4 transform, + PaintingContextCallback painter, { + TransformLayer oldLayer, + }) { canvas.save(); canvas.transform(transform.storage); painter(this, offset); diff --git a/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart b/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart index 98cbbc9cf0..b259776a8d 100644 --- a/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart +++ b/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart @@ -82,12 +82,12 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager { @override double estimateMaxScrollOffset( - SliverConstraints constraints, { - int firstIndex, - int lastIndex, - double leadingScrollOffset, - double trailingScrollOffset, - }) { + SliverConstraints constraints, { + int firstIndex, + int lastIndex, + double leadingScrollOffset, + double trailingScrollOffset, + }) { assert(lastIndex >= firstIndex); return children.length * (trailingScrollOffset - leadingScrollOffset) / (lastIndex - firstIndex + 1); } diff --git a/packages/flutter/test/rendering/slivers_block_test.dart b/packages/flutter/test/rendering/slivers_block_test.dart index 57e51b907b..7b14ec8059 100644 --- a/packages/flutter/test/rendering/slivers_block_test.dart +++ b/packages/flutter/test/rendering/slivers_block_test.dart @@ -98,10 +98,10 @@ class ViewportOffsetSpy extends ViewportOffset { @override Future animateTo( - double to, { - @required Duration duration, - @required Curve curve, - }) async { + double to, { + @required Duration duration, + @required Curve curve, + }) async { // Do nothing, not required in test. } diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 9df6dfba35..f4b6c937f9 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -224,10 +224,11 @@ class AndroidDevice extends Device { } String runAdbCheckedSync( - List params, { - String workingDirectory, - bool allowReentrantFlutter = false, - Map environment}) { + List params, { + String workingDirectory, + bool allowReentrantFlutter = false, + Map environment, + }) { return processUtils.runSync( adbCommandForDevice(params), throwOnError: true, @@ -239,10 +240,10 @@ class AndroidDevice extends Device { } Future runAdbCheckedAsync( - List params, { - String workingDirectory, - bool allowReentrantFlutter = false, - }) async { + List params, { + String workingDirectory, + bool allowReentrantFlutter = false, + }) async { return processUtils.run( adbCommandForDevice(params), throwOnError: true, diff --git a/packages/flutter_tools/lib/src/base/async_guard.dart b/packages/flutter_tools/lib/src/base/async_guard.dart index 9cedd0dee4..97e2c6c85d 100644 --- a/packages/flutter_tools/lib/src/base/async_guard.dart +++ b/packages/flutter_tools/lib/src/base/async_guard.dart @@ -79,9 +79,10 @@ import 'dart:async'; /// [onError] must have type `FutureOr Function(Object error)` or /// `FutureOr Function(Object error, StackTrace stackTrace)` otherwise an /// [ArgumentError] will be thrown synchronously. -Future asyncGuard(Future Function() fn, { - Function onError, - }) { +Future asyncGuard( + Future Function() fn, { + Function onError, +}) { if (onError != null && onError is! _UnaryOnError && onError is! _BinaryOnError) { diff --git a/packages/flutter_tools/lib/src/base/file_system.dart b/packages/flutter_tools/lib/src/base/file_system.dart index 2283fe03b3..0e3d3fa8db 100644 --- a/packages/flutter_tools/lib/src/base/file_system.dart +++ b/packages/flutter_tools/lib/src/base/file_system.dart @@ -71,12 +71,10 @@ void ensureDirectoryExists(String filePath) { /// Skips files if [shouldCopyFile] returns `false`. void copyDirectorySync( Directory srcDir, - Directory destDir, - { - bool shouldCopyFile(File srcFile, File destFile), - void onFileCopied(File srcFile, File destFile), - } -) { + Directory destDir, { + bool shouldCopyFile(File srcFile, File destFile), + void onFileCopied(File srcFile, File destFile), +}) { if (!srcDir.existsSync()) { throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy'); } diff --git a/packages/flutter_tools/lib/src/build_system/build_system.dart b/packages/flutter_tools/lib/src/build_system/build_system.dart index 0184f5cb9a..78a2052437 100644 --- a/packages/flutter_tools/lib/src/build_system/build_system.dart +++ b/packages/flutter_tools/lib/src/build_system/build_system.dart @@ -629,8 +629,14 @@ void verifyOutputDirectories(List outputs, Environment environment, Target /// A node in the build graph. class Node { - Node(this.target, this.inputs, this.outputs, this.dependencies, - Environment environment, this.missingDepfile) { + Node( + this.target, + this.inputs, + this.outputs, + this.dependencies, + Environment environment, + this.missingDepfile, + ) { final File stamp = target._findStampFile(environment); // If the stamp file doesn't exist, we haven't run this step before and diff --git a/packages/flutter_tools/lib/src/build_system/source.dart b/packages/flutter_tools/lib/src/build_system/source.dart index 9e983fd9fb..74f6c30da4 100644 --- a/packages/flutter_tools/lib/src/build_system/source.dart +++ b/packages/flutter_tools/lib/src/build_system/source.dart @@ -215,8 +215,7 @@ abstract class Source { /// The source is provided by an [Artifact]. /// /// If [artifact] points to a directory then all child files are included. - const factory Source.artifact(Artifact artifact, {TargetPlatform platform, - BuildMode mode}) = _ArtifactSource; + const factory Source.artifact(Artifact artifact, {TargetPlatform platform, BuildMode mode}) = _ArtifactSource; /// The source is provided by a depfile generated at runtime. /// diff --git a/packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart b/packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart index 84183661ef..80e43efb6a 100644 --- a/packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart +++ b/packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart @@ -92,8 +92,7 @@ class FuchsiaAmberCtl { /// Instructs the pkg_resolver instance running on [device] to prefetch the /// package [packageName]. - Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, - String packageName) async { + Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, String packageName) async { final String packageUrl = 'fuchsia-pkg://${server.name}/$packageName'; final RunResult result = await device.shell('pkgctl resolve $packageUrl'); return result.exitCode == 0; diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart index cb357cadb4..c6bba28005 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart @@ -34,10 +34,11 @@ Future _timedBuildStep(String name, Future Function() action) async // 2. Create a manifest file for assets. // 3. Using these manifests, use the Fuchsia SDK 'pm' tool to create the // Fuchsia package. -Future buildFuchsia( - {@required FuchsiaProject fuchsiaProject, - @required String target, // E.g., lib/main.dart - BuildInfo buildInfo = BuildInfo.debug}) async { +Future buildFuchsia({ + @required FuchsiaProject fuchsiaProject, + @required String target, // E.g., lib/main.dart + BuildInfo buildInfo = BuildInfo.debug, +}) async { final Directory outDir = fs.directory(getFuchsiaBuildDirectory()); if (!outDir.existsSync()) { outDir.createSync(recursive: true); @@ -53,9 +54,10 @@ Future buildFuchsia( } Future _buildAssets( - FuchsiaProject fuchsiaProject, - String target, // lib/main.dart - BuildInfo buildInfo) async { + FuchsiaProject fuchsiaProject, + String target, // lib/main.dart + BuildInfo buildInfo, +) async { final String assetDir = getAssetBuildDirectory(); final AssetBundle assets = await buildAssets( manifestPath: fuchsiaProject.project.pubspecFile.path, @@ -110,9 +112,10 @@ void _rewriteCmx(BuildMode mode, File src, File dst) { // TODO(zra): Allow supplying a signing key. Future _buildPackage( - FuchsiaProject fuchsiaProject, - String target, // lib/main.dart - BuildInfo buildInfo) async { + FuchsiaProject fuchsiaProject, + String target, // lib/main.dart + BuildInfo buildInfo, +) async { final String outDir = getFuchsiaBuildDirectory(); final String pkgDir = fs.path.join(outDir, 'pkg'); final String appName = fuchsiaProject.project.manifest.appName; diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart index 3b2c67cb04..3e10f90213 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart @@ -498,9 +498,9 @@ class FuchsiaDevice extends Device { return null; } - FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol( - String isolateName) => - FuchsiaIsolateDiscoveryProtocol(this, isolateName); + FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol(String isolateName) { + return FuchsiaIsolateDiscoveryProtocol(this, isolateName); + } @override bool isSupportedForProject(FlutterProject flutterProject) { diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart index 2834983324..5a0eda6dab 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart @@ -58,8 +58,7 @@ class FuchsiaPM { /// /// where $APPNAME is the same [appName] passed to [init], and meta/package /// is set up to be the file `meta/package` created by [init]. - Future build( - String buildPath, String keyPath, String manifestPath) { + Future build(String buildPath, String keyPath, String manifestPath) { return _runPMCommand([ '-o', buildPath, diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index d01a8121e6..9244719fee 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -279,7 +279,8 @@ class XcodeProjectInterpreter { /// Asynchronously retrieve xcode build settings. This one is preferred for /// new call-sites. Future> getBuildSettings( - String projectPath, String target, { + String projectPath, + String target, { Duration timeout = const Duration(minutes: 1), }) async { final Status status = Status.withSpinner( diff --git a/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart b/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart index 0b1188760b..5da581c1bd 100644 --- a/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart +++ b/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart @@ -14,8 +14,7 @@ import 'cocoapods.dart'; /// For a given build, determines whether dependencies have changed since the /// last call to processPods, then calls processPods with that information. -Future processPodsIfNeeded(XcodeBasedProject xcodeProject, - String buildDirectory, BuildMode buildMode) async { +Future processPodsIfNeeded(XcodeBasedProject xcodeProject, String buildDirectory, BuildMode buildMode) async { final FlutterProject project = xcodeProject.parent; // Ensure that the plugin list is up to date, since hasPlugins relies on it. refreshPluginsList(project); diff --git a/packages/flutter_tools/lib/src/mdns_discovery.dart b/packages/flutter_tools/lib/src/mdns_discovery.dart index 0ec29c203f..f94788dedb 100644 --- a/packages/flutter_tools/lib/src/mdns_discovery.dart +++ b/packages/flutter_tools/lib/src/mdns_discovery.dart @@ -157,8 +157,13 @@ class MDnsObservatoryDiscoveryResult { final String authCode; } -Future buildObservatoryUri(Device device, - String host, int devicePort, [int observatoryPort, String authCode]) async { +Future buildObservatoryUri( + Device device, + String host, + int devicePort, [ + int observatoryPort, + String authCode, +]) async { String path = '/'; if (authCode != null) { path = authCode; diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index 4132491bf8..beb1378ba2 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -484,8 +484,12 @@ abstract class FlutterCommand extends Command { /// /// For example, the command path (e.g. `build/apk`) and the result, /// as well as the time spent running it. - void _sendPostUsage(String commandPath, FlutterCommandResult commandResult, - DateTime startTime, DateTime endTime) { + void _sendPostUsage( + String commandPath, + FlutterCommandResult commandResult, + DateTime startTime, + DateTime endTime, + ) { if (commandPath == null) { return; } diff --git a/packages/flutter_tools/lib/src/test/flutter_web_platform.dart b/packages/flutter_tools/lib/src/test/flutter_web_platform.dart index 5672a07b27..da969adc24 100644 --- a/packages/flutter_tools/lib/src/test/flutter_web_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_web_platform.dart @@ -205,8 +205,12 @@ class FlutterWebPlatform extends PlatformPlugin { } @override - Future load(String path, SuitePlatform platform, - SuiteConfiguration suiteConfig, Object message) async { + Future load( + String path, + SuitePlatform platform, + SuiteConfiguration suiteConfig, + Object message, + ) async { if (_closed) { return null; } @@ -509,8 +513,11 @@ class BrowserManager { /// Returns the browser manager, or throws an [ApplicationException] if a /// connection fails to be established. static Future start( - Runtime runtime, Uri url, Future future, - {bool debug = false}) async { + Runtime runtime, + Uri url, + Future future, { + bool debug = false, + }) async { final Chrome chrome = await chromeLauncher.launch(url.toString(), headless: true); @@ -671,8 +678,12 @@ class BrowserManager { /// /// All methods forward directly to [BrowserManager]. class _BrowserEnvironment implements Environment { - _BrowserEnvironment(this._manager, this.observatoryUrl, - this.remoteDebuggerUrl, this.onRestart); + _BrowserEnvironment( + this._manager, + this.observatoryUrl, + this.remoteDebuggerUrl, + this.onRestart, + ); final BrowserManager _manager; diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart index 7c3acf6ead..96ebedfeb5 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart @@ -180,8 +180,7 @@ class MockFuchsiaPM extends Mock implements FuchsiaPM { } @override - Future build( - String buildPath, String keyPath, String manifestPath) async { + Future build(String buildPath, String keyPath, String manifestPath) async { if (!fs.file(fs.path.join(buildPath, 'meta', 'package')).existsSync() || !fs.file(keyPath).existsSync() || !fs.file(manifestPath).existsSync()) { @@ -192,8 +191,7 @@ class MockFuchsiaPM extends Mock implements FuchsiaPM { } @override - Future archive( - String buildPath, String keyPath, String manifestPath) async { + Future archive(String buildPath, String keyPath, String manifestPath) async { if (!fs.file(fs.path.join(buildPath, 'meta', 'package')).existsSync() || !fs.file(keyPath).existsSync() || !fs.file(manifestPath).existsSync()) { diff --git a/packages/flutter_tools/test/commands.shard/permeable/test_test.dart b/packages/flutter_tools/test/commands.shard/permeable/test_test.dart index 4e9698966f..571629d383 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/test_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/test_test.dart @@ -128,12 +128,12 @@ void main() { } Future _testFile( - String testName, - String workingDirectory, - String testDirectory, { - Matcher exitCode, - List extraArguments = const [], - }) async { + String testName, + String workingDirectory, + String testDirectory, { + Matcher exitCode, + List extraArguments = const [], +}) 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/general.shard/base/async_guard_test.dart b/packages/flutter_tools/test/general.shard/base/async_guard_test.dart index b21e30795a..1546cd5839 100644 --- a/packages/flutter_tools/test/general.shard/base/async_guard_test.dart +++ b/packages/flutter_tools/test/general.shard/base/async_guard_test.dart @@ -50,12 +50,12 @@ void main() { caughtByHandler = false; zone = Zone.current.fork(specification: ZoneSpecification( handleUncaughtError: ( - Zone self, - ZoneDelegate parent, - Zone zone, - Object error, - StackTrace stackTrace, - ) { + Zone self, + ZoneDelegate parent, + Zone zone, + Object error, + StackTrace stackTrace, + ) { caughtByZone = true; if (!caughtInZone.isCompleted) { caughtInZone.complete(); diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart index 6ed5d09ab8..1db28a268c 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart @@ -336,8 +336,7 @@ void main() { }); group(FuchsiaIsolateDiscoveryProtocol, () { - Future findUri( - List views, String expectedIsolateName) { + Future findUri(List views, String expectedIsolateName) { final MockPortForwarder portForwarder = MockPortForwarder(); final MockVMService vmService = MockVMService(); final MockVM vm = MockVM(); @@ -641,11 +640,11 @@ class MockFile extends Mock implements File {} class MockProcess extends Mock implements Process {} Process _createMockProcess({ - int exitCode = 0, - String stdout = '', - String stderr = '', - bool persistent = false, - }) { + int exitCode = 0, + String stdout = '', + String stderr = '', + bool persistent = false, +}) { final Stream> stdoutStream = Stream>.fromIterable(>[ utf8.encode(stdout), ]); @@ -717,9 +716,9 @@ class FuchsiaDeviceWithFakeDiscovery extends FuchsiaDevice { FuchsiaDeviceWithFakeDiscovery(String id, {String name}) : super(id, name: name); @override - FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol( - String isolateName) => - FakeFuchsiaIsolateDiscoveryProtocol(); + FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol(String isolateName) { + return FakeFuchsiaIsolateDiscoveryProtocol(); + } } class FakeFuchsiaIsolateDiscoveryProtocol implements FuchsiaIsolateDiscoveryProtocol { @@ -752,8 +751,7 @@ class FakeFuchsiaAmberCtl implements FuchsiaAmberCtl { } @override - Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, - String packageName) async { + Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, String packageName) async { return true; } @@ -785,8 +783,7 @@ class FailingAmberCtl implements FuchsiaAmberCtl { } @override - Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, - String packageName) async { + Future pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, String packageName) async { return false; } @@ -910,8 +907,7 @@ class FakeFuchsiaPM implements FuchsiaPM { } @override - Future build( - String buildPath, String keyPath, String manifestPath) async { + Future build(String buildPath, String keyPath, String manifestPath) async { if (!fs.file(fs.path.join(buildPath, 'meta', 'package')).existsSync() || !fs.file(keyPath).existsSync() || !fs.file(manifestPath).existsSync()) { @@ -922,8 +918,7 @@ class FakeFuchsiaPM implements FuchsiaPM { } @override - Future archive( - String buildPath, String keyPath, String manifestPath) async { + Future archive(String buildPath, String keyPath, String manifestPath) async { if (!fs.file(fs.path.join(buildPath, 'meta', 'package')).existsSync() || !fs.file(keyPath).existsSync() || !fs.file(manifestPath).existsSync()) { @@ -975,14 +970,12 @@ class FailingPM implements FuchsiaPM { } @override - Future build( - String buildPath, String keyPath, String manifestPath) async { + Future build(String buildPath, String keyPath, String manifestPath) async { return false; } @override - Future archive( - String buildPath, String keyPath, String manifestPath) async { + Future archive(String buildPath, String keyPath, String manifestPath) async { return false; } diff --git a/packages/flutter_tools/test/general.shard/web/workflow_test.dart b/packages/flutter_tools/test/general.shard/web/workflow_test.dart index 1d559a3346..18aa6faf35 100644 --- a/packages/flutter_tools/test/general.shard/web/workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/web/workflow_test.dart @@ -88,13 +88,14 @@ void main() { class MockProcessManager extends Mock implements ProcessManager {} class MockPlatform extends Mock implements Platform { - MockPlatform( - {this.windows = false, - this.macos = false, - this.linux = false, - this.environment = const { - kChromeEnvironment: 'chrome', - }}); + MockPlatform({ + this.windows = false, + this.macos = false, + this.linux = false, + this.environment = const { + kChromeEnvironment: 'chrome', + }, + }); final bool windows; final bool macos; diff --git a/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart b/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart index 3ffe1e0b46..fa8870088e 100644 --- a/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart +++ b/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart @@ -67,10 +67,11 @@ void main() { // Sets up the mock environment so that searching for Visual Studio with // exactly the given required components will provide a result. By default it // return a preset installation, but the response can be overridden. - void setMockVswhereResponse( - [List requiredComponents, - List additionalArguments, - Map response]) { + void setMockVswhereResponse([ + List requiredComponents, + List additionalArguments, + Map response, + ]) { fs.file(vswherePath).createSync(recursive: true); fs.file(vcvarsPath).createSync(recursive: true); diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index 6e4f7022c2..4e8da0f3a7 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart @@ -192,12 +192,12 @@ class MockProcessManager extends Mock implements ProcessManager { /// a given number of times before succeeding. The returned processes will /// fail after a delay if one is supplied. ProcessFactory flakyProcessFactory({ - int flakes, - bool Function(List command) filter, - Duration delay, - Stream> Function() stdout, - Stream> Function() stderr, - }) { + int flakes, + bool Function(List command) filter, + Duration delay, + Stream> Function() stdout, + Stream> Function() stderr, +}) { int flakesLeft = flakes; stdout ??= () => const Stream>.empty(); stderr ??= () => const Stream>.empty(); diff --git a/packages/flutter_tools/test/src/testbed.dart b/packages/flutter_tools/test/src/testbed.dart index b618633331..33a27df49c 100644 --- a/packages/flutter_tools/test/src/testbed.dart +++ b/packages/flutter_tools/test/src/testbed.dart @@ -188,25 +188,19 @@ class FakeHttpClient implements HttpClient { String userAgent; @override - void addCredentials( - Uri url, String realm, HttpClientCredentials credentials) {} + void addCredentials(Uri url, String realm, HttpClientCredentials credentials) {} @override - void addProxyCredentials( - String host, int port, String realm, HttpClientCredentials credentials) {} + void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) {} @override - set authenticate( - Future Function(Uri url, String scheme, String realm) f) {} + set authenticate(Future Function(Uri url, String scheme, String realm) f) {} @override - set authenticateProxy( - Future Function(String host, int port, String scheme, String realm) - f) {} + set authenticateProxy(Future Function(String host, int port, String scheme, String realm) f) {} @override - set badCertificateCallback( - bool Function(X509Certificate cert, String host, int port) callback) {} + set badCertificateCallback(bool Function(X509Certificate cert, String host, int port) callback) {} @override void close({bool force = false}) {} diff --git a/packages/flutter_tools/tool/tool_coverage.dart b/packages/flutter_tools/tool/tool_coverage.dart index 6529e748f2..1f02aec13b 100644 --- a/packages/flutter_tools/tool/tool_coverage.dart +++ b/packages/flutter_tools/tool/tool_coverage.dart @@ -68,8 +68,12 @@ class VMPlatform extends PlatformPlugin { throw UnimplementedError(); @override - Future load(String codePath, SuitePlatform platform, - SuiteConfiguration suiteConfig, Object message) async { + Future load( + String codePath, + SuitePlatform platform, + SuiteConfiguration suiteConfig, + Object message, + ) async { final ReceivePort receivePort = ReceivePort(); Isolate isolate; try {