From 6d20ff244650ffc94761eefb3a4f93a6186c3e65 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 30 Jan 2019 08:56:12 -0800 Subject: [PATCH] Remove all obsolete "// ignore:" (#27271) --- dev/devicelab/lib/tasks/microbenchmarks.dart | 2 +- .../lib/gallery/syntax_highlighter.dart | 2 +- packages/flutter/lib/src/cupertino/route.dart | 6 ++-- .../lib/src/foundation/change_notifier.dart | 1 + .../flutter/lib/src/gestures/hit_test.dart | 6 ++-- .../lib/src/material/expansion_panel.dart | 5 ++-- packages/flutter/lib/src/material/page.dart | 6 ++-- .../flutter/lib/src/rendering/editable.dart | 2 -- packages/flutter/lib/src/rendering/error.dart | 8 +++-- packages/flutter/lib/src/rendering/layer.dart | 2 ++ .../flutter/lib/src/widgets/dismissible.dart | 2 +- .../flutter/lib/src/widgets/framework.dart | 5 +++- .../flutter/lib/src/widgets/navigator.dart | 2 +- .../lib/src/widgets/platform_view.dart | 3 +- .../lib/src/widgets/scroll_position.dart | 1 + .../scroll_position_with_single_context.dart | 1 + .../flutter/test/material/scaffold_test.dart | 2 +- .../flutter/test/rendering/layers_test.dart | 8 ++--- packages/flutter/test/widgets/clip_test.dart | 2 +- .../flutter/test/widgets/framework_test.dart | 2 +- .../flutter/test/widgets/inherited_test.dart | 2 +- .../test/widgets/platform_view_test.dart | 30 +++++++++---------- .../flutter/test/widgets/scrollable_test.dart | 3 +- .../widgets/slivers_appbar_floating_test.dart | 2 +- .../lib/src/common/message.dart | 2 +- .../flutter_tools/lib/src/base/logger.dart | 1 + .../lib/src/commands/daemon.dart | 4 +-- packages/flutter_tools/lib/src/ios/mac.dart | 2 +- .../flutter_tools/lib/src/ios/xcodeproj.dart | 2 +- packages/flutter_tools/lib/src/run_hot.dart | 2 +- .../lib/src/test/flutter_platform.dart | 2 +- packages/flutter_tools/lib/src/usage.dart | 3 -- packages/flutter_tools/lib/src/vmservice.dart | 2 +- .../flutter_tools/test/base/logger_test.dart | 8 ++--- 34 files changed, 66 insertions(+), 67 deletions(-) diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index 91892be2e6..c4dd4ef24e 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -124,7 +124,7 @@ Future> _readJsonResults(Process process) { process.stdin.write('q'); await process.stdin.flush(); // Also send a kill signal in case the `q` above didn't work. - process.kill(ProcessSignal.sigint); // ignore: deprecated_member_use + process.kill(ProcessSignal.sigint); try { completer.complete(Map.from(json.decode(jsonOutput))); } catch (ex) { diff --git a/examples/flutter_gallery/lib/gallery/syntax_highlighter.dart b/examples/flutter_gallery/lib/gallery/syntax_highlighter.dart index 9f9d8dfe66..8b9246e2d2 100644 --- a/examples/flutter_gallery/lib/gallery/syntax_highlighter.dart +++ b/examples/flutter_gallery/lib/gallery/syntax_highlighter.dart @@ -53,7 +53,7 @@ class SyntaxHighlighterStyle { final TextStyle constantStyle; } -abstract class SyntaxHighlighter { // ignore: one_member_abstracts +abstract class SyntaxHighlighter { TextSpan format(String src); } diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 6aa2bd497e..6cfd781352 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -106,10 +106,8 @@ class CupertinoPageRoute extends PageRoute { }) : assert(builder != null), assert(maintainState != null), assert(fullscreenDialog != null), - super(settings: settings, fullscreenDialog: fullscreenDialog) { - // ignore: prefer_asserts_in_initializer_lists, https://github.com/dart-lang/sdk/issues/31223 - assert(opaque); // PageRoute makes it return true. - } + assert(opaque), + super(settings: settings, fullscreenDialog: fullscreenDialog); /// Builds the primary contents of the route. final WidgetBuilder builder; diff --git a/packages/flutter/lib/src/foundation/change_notifier.dart b/packages/flutter/lib/src/foundation/change_notifier.dart index 823b73892c..7a53b0e07f 100644 --- a/packages/flutter/lib/src/foundation/change_notifier.dart +++ b/packages/flutter/lib/src/foundation/change_notifier.dart @@ -195,6 +195,7 @@ class ChangeNotifier implements Listenable { /// in response to a notification) that has been registered multiple times. /// See the discussion at [removeListener]. @protected + @visibleForTesting void notifyListeners() { assert(_debugAssertNotDisposed()); if (_listeners != null) { diff --git a/packages/flutter/lib/src/gestures/hit_test.dart b/packages/flutter/lib/src/gestures/hit_test.dart index e2be1dba9c..cb1ef03f76 100644 --- a/packages/flutter/lib/src/gestures/hit_test.dart +++ b/packages/flutter/lib/src/gestures/hit_test.dart @@ -5,7 +5,7 @@ import 'events.dart'; /// An object that can hit-test pointers. -abstract class HitTestable { // ignore: one_member_abstracts +abstract class HitTestable { // This class is intended to be used as an interface with the implements // keyword, and should not be extended directly. factory HitTestable._() => null; @@ -18,7 +18,7 @@ abstract class HitTestable { // ignore: one_member_abstracts } /// An object that can dispatch events. -abstract class HitTestDispatcher { // ignore: one_member_abstracts +abstract class HitTestDispatcher { // This class is intended to be used as an interface with the implements // keyword, and should not be extended directly. factory HitTestDispatcher._() => null; @@ -28,7 +28,7 @@ abstract class HitTestDispatcher { // ignore: one_member_abstracts } /// An object that can handle events. -abstract class HitTestTarget { // ignore: one_member_abstracts +abstract class HitTestTarget { // This class is intended to be used as an interface with the implements // keyword, and should not be extended directly. factory HitTestTarget._() => null; diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 933c709678..f4401bf7b6 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -140,12 +140,11 @@ class ExpansionPanelList extends StatefulWidget { /// of [ExpansionPanelRadio]. const ExpansionPanelList.radio({ Key key, - List children = const [], + this.children = const [], this.expansionCallback, this.animationDuration = kThemeAnimationDuration, this.initialOpenPanelValue, - }) : children = children, // ignore: prefer_initializing_formals - assert(children != null), + }) : assert(children != null), assert(animationDuration != null), _allowOnlyOnePanelOpen = true, super(key: key); diff --git a/packages/flutter/lib/src/material/page.dart b/packages/flutter/lib/src/material/page.dart index fc2ff196ed..1dc004e211 100644 --- a/packages/flutter/lib/src/material/page.dart +++ b/packages/flutter/lib/src/material/page.dart @@ -48,10 +48,8 @@ class MaterialPageRoute extends PageRoute { }) : assert(builder != null), assert(maintainState != null), assert(fullscreenDialog != null), - super(settings: settings, fullscreenDialog: fullscreenDialog) { - // ignore: prefer_asserts_in_initializer_lists , https://github.com/dart-lang/sdk/issues/31223 - assert(opaque); - } + assert(opaque), + super(settings: settings, fullscreenDialog: fullscreenDialog); /// Builds the primary contents of the route. final WidgetBuilder builder; diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index dbc5f89919..f7a3345836 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -//ignore: Remove this once Google catches up with dev.4 Dart. -import 'dart:async'; import 'dart:math' as math; import 'dart:ui' as ui show TextBox, lerpDouble; diff --git a/packages/flutter/lib/src/rendering/error.dart b/packages/flutter/lib/src/rendering/error.dart index 3881fdfd5e..03ab647493 100644 --- a/packages/flutter/lib/src/rendering/error.dart +++ b/packages/flutter/lib/src/rendering/error.dart @@ -51,7 +51,9 @@ class RenderErrorBox extends RenderBox { ); _paragraph = builder.build(); } - } catch (e) { } // ignore: empty_catches + } catch (e) { + // Intentionally left empty. + } } /// The message to attempt to display at paint time. @@ -114,6 +116,8 @@ class RenderErrorBox extends RenderBox { context.canvas.drawParagraph(_paragraph, offset); } - } catch (e) { } // ignore: empty_catches + } catch (e) { + // Intentionally left empty. + } } } diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index b79933e472..4e06e80f97 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -48,6 +48,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin { /// Mark that this layer has changed and [addToScene] needs to be called. @protected + @visibleForTesting void markNeedsAddToScene() { _needsAddToScene = true; } @@ -90,6 +91,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin { /// A subtree needs [addToScene] if any of its layer needs [addToScene]. /// The [ContainerLayer] will override this to respect its children. @protected + @visibleForTesting void updateSubtreeNeedsAddToScene() { _subtreeNeedsAddToScene = _needsAddToScene || alwaysNeedsAddToScene; } diff --git a/packages/flutter/lib/src/widgets/dismissible.dart b/packages/flutter/lib/src/widgets/dismissible.dart index e61224c9bc..f1a3d95a08 100644 --- a/packages/flutter/lib/src/widgets/dismissible.dart +++ b/packages/flutter/lib/src/widgets/dismissible.dart @@ -225,7 +225,7 @@ class _DismissibleClipper extends CustomClipper { enum _FlingGestureKind { none, forward, reverse } -class _DismissibleState extends State with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { // ignore: MIXIN_INFERENCE_INCONSISTENT_MATCHING_CLASSES +class _DismissibleState extends State with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { @override void initState() { super.initState(); diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 07ab8058c1..2377bc4ce9 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -3626,7 +3626,9 @@ class ErrorWidget extends LeafRenderObjectWidget { static String _stringify(Object exception) { try { return exception.toString(); - } catch (e) { } // ignore: empty_catches + } catch (e) { + // intentionally left empty. + } return 'Error'; } @@ -4922,6 +4924,7 @@ class MultiChildRenderObjectElement extends RenderObjectElement { /// This list is filtered to hide elements that have been forgotten (using /// [forgetChild]). @protected + @visibleForTesting Iterable get children => _children.where((Element child) => !_forgottenChildren.contains(child)); List _children; diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index b47546905f..46adce8a60 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -1816,7 +1816,7 @@ class NavigatorState extends State with TickerProviderStateMixin { assert(!_debugLocked); assert(oldRoute != null); assert(newRoute != null); - if (oldRoute == newRoute) // ignore: unrelated_type_equality_checks, https://github.com/dart-lang/sdk/issues/32522 + if (oldRoute == newRoute) return; assert(() { _debugLocked = true; return true; }()); assert(oldRoute._navigator == this); diff --git a/packages/flutter/lib/src/widgets/platform_view.dart b/packages/flutter/lib/src/widgets/platform_view.dart index a946533422..9f16ae11a5 100644 --- a/packages/flutter/lib/src/widgets/platform_view.dart +++ b/packages/flutter/lib/src/widgets/platform_view.dart @@ -201,8 +201,7 @@ class UiKitView extends StatefulWidget { /// Creates a widget that embeds an iOS view. /// /// {@macro flutter.widgets.platformViews.constructorParams} - UiKitView({ // ignore: prefer_const_constructors_in_immutables - // TODO(aam): Remove lint ignore above once https://dartbug.com/34297 is fixed + const UiKitView({ Key key, @required this.viewType, this.onPlatformViewCreated, diff --git a/packages/flutter/lib/src/widgets/scroll_position.dart b/packages/flutter/lib/src/widgets/scroll_position.dart index 0e91ceea40..0b294f6ef3 100644 --- a/packages/flutter/lib/src/widgets/scroll_position.dart +++ b/packages/flutter/lib/src/widgets/scroll_position.dart @@ -609,6 +609,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// /// Call [beginActivity] to change the current activity. @protected + @visibleForTesting ScrollActivity get activity => _activity; ScrollActivity _activity; 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 2b691fd968..68c36b7009 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 @@ -160,6 +160,7 @@ class ScrollPositionWithSingleContext extends ScrollPosition implements ScrollAc /// /// If this changes the value, then a [UserScrollNotification] is dispatched. @protected + @visibleForTesting void updateUserScrollDirection(ScrollDirection value) { assert(value != null); if (userScrollDirection == value) diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 75c4243f27..e413b6ce85 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -72,7 +72,7 @@ void main() { child: Scaffold( appBar: AppBar(title: const Text('Title')), body: Container(key: bodyKey), - resizeToAvoidBottomPadding: false, // ignore: deprecated_member_use + resizeToAvoidBottomPadding: false, ), ))); diff --git a/packages/flutter/test/rendering/layers_test.dart b/packages/flutter/test/rendering/layers_test.dart index 366e107cb8..84f34bb6da 100644 --- a/packages/flutter/test/rendering/layers_test.dart +++ b/packages/flutter/test/rendering/layers_test.dart @@ -75,7 +75,7 @@ void main() { g.append(j); a.debugMarkClean(); - b.markNeedsAddToScene(); // ignore: invalid_use_of_protected_member + b.markNeedsAddToScene(); c.debugMarkClean(); d.debugMarkClean(); e.debugMarkClean(); @@ -83,7 +83,7 @@ void main() { g.debugMarkClean(); h.debugMarkClean(); i.debugMarkClean(); - j.markNeedsAddToScene(); // ignore: invalid_use_of_protected_member + j.markNeedsAddToScene(); a.updateSubtreeNeedsAddToScene(); @@ -114,10 +114,10 @@ void main() { void checkNeedsAddToScene(Layer layer, void mutateCallback()) { layer.debugMarkClean(); - layer.updateSubtreeNeedsAddToScene(); // ignore: invalid_use_of_protected_member + layer.updateSubtreeNeedsAddToScene(); expect(layer.debugSubtreeNeedsAddToScene, false); mutateCallback(); - layer.updateSubtreeNeedsAddToScene(); // ignore: invalid_use_of_protected_member + layer.updateSubtreeNeedsAddToScene(); expect(layer.debugSubtreeNeedsAddToScene, true); } diff --git a/packages/flutter/test/widgets/clip_test.dart b/packages/flutter/test/widgets/clip_test.dart index 2e58ce5646..bfb6929706 100644 --- a/packages/flutter/test/widgets/clip_test.dart +++ b/packages/flutter/test/widgets/clip_test.dart @@ -242,7 +242,7 @@ void main() { ..restore() ); debugPaintSizeEnabled = true; - expect(tester.renderObject(find.byType(ClipRect)).debugPaint, paints // ignore: INVALID_USE_OF_PROTECTED_MEMBER + expect(tester.renderObject(find.byType(ClipRect)).debugPaint, paints ..rect(rect: Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)) ..paragraph() ); diff --git a/packages/flutter/test/widgets/framework_test.dart b/packages/flutter/test/widgets/framework_test.dart index 7656ab6652..69dddbae0e 100644 --- a/packages/flutter/test/widgets/framework_test.dart +++ b/packages/flutter/test/widgets/framework_test.dart @@ -511,7 +511,7 @@ void main() { )); final MultiChildRenderObjectElement element = key0.currentContext; expect( - element.children.map((Element element) => element.widget.key), // ignore: INVALID_USE_OF_PROTECTED_MEMBER + element.children.map((Element element) => element.widget.key), [null, key1, null, key2, null], ); }); diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart index 47da69f86c..91a162b3ff 100644 --- a/packages/flutter/test/widgets/inherited_test.dart +++ b/packages/flutter/test/widgets/inherited_test.dart @@ -503,7 +503,7 @@ void main() { await tester.pump(); expect(buildCount, equals(1)); - notifier.notifyListeners(); // ignore: invalid_use_of_protected_member + notifier.notifyListeners(); await tester.pump(); expect(buildCount, equals(2)); diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index be06681108..d017f68792 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -817,7 +817,7 @@ void main() { viewsController.registerViewType('webview'); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -840,7 +840,7 @@ void main() { viewsController.registerViewType('webview'); viewsController.registerViewType('maps'); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -850,7 +850,7 @@ void main() { ); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -871,7 +871,7 @@ void main() { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -900,7 +900,7 @@ void main() { viewsController.registerViewType('webview'); viewsController.creationDelay = Completer(); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -967,7 +967,7 @@ void main() { viewsController.registerViewType('webview'); await tester.pumpWidget( - Center( + const Center( child: SizedBox( width: 200.0, height: 100.0, @@ -975,7 +975,7 @@ void main() { viewType: 'webview', layoutDirection: TextDirection.ltr, creationParams: 'creation parameters', - creationParamsCodec: const StringCodec(), + creationParamsCodec: StringCodec(), ), ), ), @@ -1005,7 +1005,7 @@ void main() { viewsController.registerViewType('webview'); await tester.pumpWidget( - Align( + const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, @@ -1044,7 +1044,7 @@ void main() { numPointerDownsOnParent++; }, ), - Positioned( + const Positioned( child: SizedBox( width: 200.0, height: 100.0, @@ -1089,7 +1089,7 @@ void main() { numPointerDownsOnParent++; }, ), - Positioned( + const Positioned( child: SizedBox( width: 200.0, height: 100.0, @@ -1134,7 +1134,7 @@ void main() { numPointerDownsOnParent++; }, ), - Positioned( + const Positioned( child: SizedBox( width: 200.0, height: 100.0, @@ -1176,7 +1176,7 @@ void main() { onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, - child: SizedBox( + child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), @@ -1256,7 +1256,7 @@ void main() { verticalDragAcceptedByParent = true; }, onLongPress: () {}, - child: SizedBox( + child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView( @@ -1286,7 +1286,7 @@ void main() { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( - Align( + const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, @@ -1307,7 +1307,7 @@ void main() { await gesture.moveBy(const Offset(0.0, 100.0)); await tester.pumpWidget( - Align( + const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart index 66f99cc0bd..8b4cf1cec9 100644 --- a/packages/flutter/test/widgets/scrollable_test.dart +++ b/packages/flutter/test/widgets/scrollable_test.dart @@ -30,8 +30,7 @@ double getScrollOffset(WidgetTester tester) { double getScrollVelocity(WidgetTester tester) { final RenderViewport viewport = tester.renderObject(find.byType(Viewport)); final ScrollPosition position = viewport.offset; - // Access for test only. - return position.activity.velocity; // ignore: INVALID_USE_OF_PROTECTED_MEMBER + return position.activity.velocity; } void resetScrollOffset(WidgetTester tester) { diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart index 932871c77e..03603bdadb 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart @@ -187,7 +187,7 @@ void main() { verifyPaintPosition(key3, const Offset(0.0, 0.0), true); position.animateTo(bigHeight + delegate.maxExtent * 1.9, curve: Curves.linear, duration: const Duration(minutes: 1)); - position.updateUserScrollDirection(ScrollDirection.forward); // ignore: invalid_use_of_protected_member + position.updateUserScrollDirection(ScrollDirection.forward); await tester.pumpAndSettle(const Duration(milliseconds: 1000)); verifyPaintPosition(key1, const Offset(0.0, 0.0), false); verifyPaintPosition(key2, const Offset(0.0, 0.0), true); diff --git a/packages/flutter_driver/lib/src/common/message.dart b/packages/flutter_driver/lib/src/common/message.dart index 0b510103e2..87bc19f125 100644 --- a/packages/flutter_driver/lib/src/common/message.dart +++ b/packages/flutter_driver/lib/src/common/message.dart @@ -46,7 +46,7 @@ abstract class Command { /// An object sent from a Flutter application back to the Flutter Driver in /// response to a command. -abstract class Result { // ignore: one_member_abstracts +abstract class Result { /// Serializes this message to a JSON map. Map toJson(); } diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index 06b78075b6..ec08efb4e5 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart @@ -467,6 +467,7 @@ abstract class Status { final Stopwatch _stopwatch = Stopwatch(); @protected + @visibleForTesting bool get seemsSlow => timeout != null && _stopwatch.elapsed > timeout; @protected diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index b73f41ffbf..0a261e08bf 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -187,9 +187,7 @@ abstract class Domain { String toString() => name; void handleCommand(String command, dynamic id, Map args) { - // Remove 'new' once Google catches up to dev4.0 Dart SDK. - //ignore: unnecessary_new - new Future.sync(() { + Future.sync(() { if (_handlers.containsKey(command)) return _handlers[command](args); throw 'command not understood: $name.$command'; diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index ed31c94a93..01d8c5cb2d 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -163,7 +163,7 @@ class Xcode { try { _xcodeSelectPath = processManager.runSync(['/usr/bin/xcode-select', '--print-path']).stdout.trim(); } on ProcessException { - // Ignore: return null below. + // Ignored, return null below. } } return _xcodeSelectPath; diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index e8e07fcc3e..79a02ac354 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -120,7 +120,7 @@ class XcodeProjectInterpreter { _majorVersion = int.parse(components[0]); _minorVersion = components.length == 1 ? 0 : int.parse(components[1]); } on ProcessException { - // Ignore: leave values null. + // Ignored, leave values null. } } diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index df9627e6d1..a3edabbbba 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -436,7 +436,7 @@ class HotRunner extends ResidentRunner { for (FlutterView view in device.views) futures.add(view.runFromSource(entryUri, packagesUri, assetsDirectoryUri)); final Completer completer = Completer(); - Future.wait(futures).whenComplete(() { completer.complete(null); }); // ignore: unawaited_futures + Future.wait(futures).whenComplete(() { completer.complete(null); }); return completer.future; } diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index e6f37e3fcb..a7071e8c75 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -497,7 +497,7 @@ class _FlutterPlatform extends PlatformPlugin { // Callback can't throw since it's just setting a variable. controller.sink.done.whenComplete(() { // ignore: unawaited_futures controllerSinkClosed = true; - }); // ignore: unawaited_futures + }); // Prepare our WebSocket server to talk to the engine subproces. final HttpServer server = await HttpServer.bind(host, port); diff --git a/packages/flutter_tools/lib/src/usage.dart b/packages/flutter_tools/lib/src/usage.dart index 7422d85ac3..72d5857775 100644 --- a/packages/flutter_tools/lib/src/usage.dart +++ b/packages/flutter_tools/lib/src/usage.dart @@ -35,9 +35,6 @@ class Usage { final FlutterVersion flutterVersion = FlutterVersion.instance; final String version = versionOverride ?? flutterVersion.getVersionString(redactUnknownBranches: true); _analytics = AnalyticsIO(_kFlutterUA, settingsName, version, - // Analyzer doesn't recognize that [Directory] objects match up due to a - // conditional import. - // ignore: argument_type_not_assignable documentDirectory: configDirOverride != null ? fs.directory(configDirOverride) : null); // Report a more detailed OS version string than package:usage does by default. diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index c733b5222c..2585c502a0 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -1384,7 +1384,7 @@ class ServiceMap extends ServiceObject implements Map { Iterable> get entries => _map.entries; @override void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update); - Map retype() => _map.cast(); // ignore: annotate_overrides + Map retype() => _map.cast(); @override dynamic update(String key, dynamic update(dynamic value), {dynamic ifAbsent()}) => _map.update(key, update, ifAbsent: ifAbsent); } diff --git a/packages/flutter_tools/test/base/logger_test.dart b/packages/flutter_tools/test/base/logger_test.dart index ec61cffb5e..07d5061f6d 100644 --- a/packages/flutter_tools/test/base/logger_test.dart +++ b/packages/flutter_tools/test/base/logger_test.dart @@ -137,11 +137,11 @@ void main() { timeout: const Duration(milliseconds: 10), )..start(); doWhileAsync(time, () => ansiSpinner.ticks < 10); // one second - expect(ansiSpinner.seemsSlow, isFalse); // ignore: invalid_use_of_protected_member + expect(ansiSpinner.seemsSlow, isFalse); expect(outputStdout().join('\n'), isNot(contains('This is taking an unexpectedly long time.'))); await tenMillisecondsLater; doWhileAsync(time, () => ansiSpinner.ticks < 30); // three seconds - expect(ansiSpinner.seemsSlow, isTrue); // ignore: invalid_use_of_protected_member + expect(ansiSpinner.seemsSlow, isTrue); expect(outputStdout().join('\n'), contains('This is taking an unexpectedly long time.')); ansiSpinner.stop(); expect(outputStdout().join('\n'), isNot(contains('(!)'))); @@ -231,12 +231,12 @@ void main() { await FakeAsync().run((FakeAsync time) async { ansiStatus.start(); doWhileAsync(time, () => ansiStatus.ticks < 10); // one second - expect(ansiStatus.seemsSlow, isFalse); // ignore: invalid_use_of_protected_member + expect(ansiStatus.seemsSlow, isFalse); expect(outputStdout().join('\n'), isNot(contains('This is taking an unexpectedly long time.'))); expect(outputStdout().join('\n'), isNot(contains('(!)'))); await tenMillisecondsLater; doWhileAsync(time, () => ansiStatus.ticks < 30); // three seconds - expect(ansiStatus.seemsSlow, isTrue); // ignore: invalid_use_of_protected_member + expect(ansiStatus.seemsSlow, isTrue); expect(outputStdout().join('\n'), contains('This is taking an unexpectedly long time.')); ansiStatus.stop(); expect(outputStdout().join('\n'), contains('(!)'));