Unverified Commit 6d20ff24 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove all obsolete "// ignore:" (#27271)

parent dc38a260
......@@ -124,7 +124,7 @@ Future<Map<String, double>> _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<String, double>.from(json.decode(jsonOutput)));
} catch (ex) {
......
......@@ -53,7 +53,7 @@ class SyntaxHighlighterStyle {
final TextStyle constantStyle;
}
abstract class SyntaxHighlighter { // ignore: one_member_abstracts
abstract class SyntaxHighlighter {
TextSpan format(String src);
}
......
......@@ -106,10 +106,8 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
}) : 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;
......
......@@ -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) {
......
......@@ -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;
......
......@@ -140,12 +140,11 @@ class ExpansionPanelList extends StatefulWidget {
/// of [ExpansionPanelRadio].
const ExpansionPanelList.radio({
Key key,
List<ExpansionPanelRadio> children = const <ExpansionPanelRadio>[],
this.children = const <ExpansionPanelRadio>[],
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);
......
......@@ -48,10 +48,8 @@ class MaterialPageRoute<T> extends PageRoute<T> {
}) : 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;
......
......@@ -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;
......
......@@ -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.
}
}
}
......@@ -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;
}
......
......@@ -225,7 +225,7 @@ class _DismissibleClipper extends CustomClipper<Rect> {
enum _FlingGestureKind { none, forward, reverse }
class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { // ignore: MIXIN_INFERENCE_INCONSISTENT_MATCHING_CLASSES
class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
@override
void initState() {
super.initState();
......
......@@ -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<Element> get children => _children.where((Element child) => !_forgottenChildren.contains(child));
List<Element> _children;
......
......@@ -1816,7 +1816,7 @@ class NavigatorState extends State<Navigator> 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);
......
......@@ -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,
......
......@@ -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;
......
......@@ -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)
......
......@@ -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,
),
)));
......
......@@ -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);
}
......
......@@ -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()
);
......
......@@ -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),
<Key>[null, key1, null, key2, null],
);
});
......
......@@ -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));
......
......@@ -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<void>();
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,
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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<String, dynamic> toJson();
}
......@@ -467,6 +467,7 @@ abstract class Status {
final Stopwatch _stopwatch = Stopwatch();
@protected
@visibleForTesting
bool get seemsSlow => timeout != null && _stopwatch.elapsed > timeout;
@protected
......
......@@ -187,9 +187,7 @@ abstract class Domain {
String toString() => name;
void handleCommand(String command, dynamic id, Map<String, dynamic> args) {
// Remove 'new' once Google catches up to dev4.0 Dart SDK.
//ignore: unnecessary_new
new Future<dynamic>.sync(() {
Future<dynamic>.sync(() {
if (_handlers.containsKey(command))
return _handlers[command](args);
throw 'command not understood: $name.$command';
......
......@@ -163,7 +163,7 @@ class Xcode {
try {
_xcodeSelectPath = processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']).stdout.trim();
} on ProcessException {
// Ignore: return null below.
// Ignored, return null below.
}
}
return _xcodeSelectPath;
......
......@@ -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.
}
}
......
......@@ -436,7 +436,7 @@ class HotRunner extends ResidentRunner {
for (FlutterView view in device.views)
futures.add(view.runFromSource(entryUri, packagesUri, assetsDirectoryUri));
final Completer<void> completer = Completer<void>();
Future.wait(futures).whenComplete(() { completer.complete(null); }); // ignore: unawaited_futures
Future.wait(futures).whenComplete(() { completer.complete(null); });
return completer.future;
}
......
......@@ -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);
......
......@@ -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.
......
......@@ -1384,7 +1384,7 @@ class ServiceMap extends ServiceObject implements Map<String, dynamic> {
Iterable<MapEntry<String, dynamic>> get entries => _map.entries;
@override
void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update);
Map<RK, RV> retype<RK, RV>() => _map.cast<RK, RV>(); // ignore: annotate_overrides
Map<RK, RV> retype<RK, RV>() => _map.cast<RK, RV>();
@override
dynamic update(String key, dynamic update(dynamic value), {dynamic ifAbsent()}) => _map.update(key, update, ifAbsent: ifAbsent);
}
......
......@@ -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('(!)'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment