Skip to content

Commit

Permalink
remove outdated ignores (flutter#35143)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Aug 4, 2022
1 parent 8a82422 commit b74af4c
Show file tree
Hide file tree
Showing 53 changed files with 215 additions and 271 deletions.
2 changes: 1 addition & 1 deletion lib/ui/hash_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _Jenkins {
/// For example:
///
/// ```dart
/// int get hashCode => hashValues(foo, bar, hashList(quux), baz); // ignore: deprecated_member_use
/// int get hashCode => hashValues(foo, bar, hashList(quux), baz);
/// ```
///
/// ## Deprecation
Expand Down
1 change: 0 additions & 1 deletion lib/ui/hooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
part of dart.ui;

@pragma('vm:entry-point')
// ignore: unused_element
void _updateWindowMetrics(
Object id,
double devicePixelRatio,
Expand Down
12 changes: 6 additions & 6 deletions lib/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3579,7 +3579,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// Creates an image filter that applies a Gaussian blur.
_ImageFilter.blur(_GaussianBlurImageFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
_constructor();
_initBlur(filter.sigmaX, filter.sigmaY, filter.tileMode.index);
}
Expand All @@ -3588,7 +3588,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// to the max value within the given radii along the x and y axes.
_ImageFilter.dilate(_DilateImageFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
_constructor();
_initDilate(filter.radiusX, filter.radiusY);
}
Expand All @@ -3597,7 +3597,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// to the minimum channel value within the given radii along the x and y axes.
_ImageFilter.erode(_ErodeImageFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
_constructor();
_initErode(filter.radiusX, filter.radiusY);
}
Expand All @@ -3608,7 +3608,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// when used with [BackdropFilter] would magnify the background image.
_ImageFilter.matrix(_MatrixImageFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
if (filter.data.length != 16) {
throw ArgumentError('"matrix4" must have 16 entries.');
}
Expand All @@ -3619,7 +3619,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// Converts a color filter to an image filter.
_ImageFilter.fromColorFilter(ColorFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
_constructor();
final _ColorFilter? nativeFilter = filter._toNativeColorFilter();
_initColorFilter(nativeFilter);
Expand All @@ -3628,7 +3628,7 @@ class _ImageFilter extends NativeFieldWrapperClass1 {
/// Composes `_innerFilter` with `_outerFilter`.
_ImageFilter.composed(_ComposeImageFilter filter)
: assert(filter != null),
creator = filter { // ignore: prefer_initializing_formals
creator = filter {
_constructor();
final _ImageFilter nativeFilterInner = filter.innerFilter._toNativeImageFilter();
final _ImageFilter nativeFilterOuter = filter.outerFilter._toNativeImageFilter();
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import 'dart:collection' as collection;
import 'dart:convert';
import 'dart:developer' as developer;
import 'dart:ffi';
import 'dart:io'; // ignore: unused_import
import 'dart:io';
import 'dart:isolate' show SendPort;
import 'dart:math' as math;
import 'dart:nativewrappers'; // ignore: unused_import
import 'dart:nativewrappers';
import 'dart:typed_data';

part 'annotations.dart';
Expand Down
47 changes: 23 additions & 24 deletions lib/web_ui/lib/geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

// See https://github.com/flutter/engine/blob/main/lib/ui/geometry.dart for
// documentation of APIs.
// ignore_for_file: public_member_api_docs
part of ui;

abstract class OffsetBase {
const OffsetBase(this._dx, this._dy)
: assert(_dx != null), // ignore: unnecessary_null_comparison
assert(_dy != null); // ignore: unnecessary_null_comparison
: assert(_dx != null),
assert(_dy != null);

final double _dx;
final double _dy;
Expand Down Expand Up @@ -58,7 +57,7 @@ class Offset extends OffsetBase {
Offset operator %(double operand) => Offset(dx % operand, dy % operand);
Rect operator &(Size other) => Rect.fromLTWH(dx, dy, other.width, other.height);
static Offset? lerp(Offset? a, Offset? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down Expand Up @@ -149,7 +148,7 @@ class Size extends OffsetBase {

Size get flipped => Size(height, width);
static Size? lerp(Size? a, Size? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down Expand Up @@ -182,10 +181,10 @@ class Size extends OffsetBase {

class Rect {
const Rect.fromLTRB(this.left, this.top, this.right, this.bottom)
: assert(left != null), // ignore: unnecessary_null_comparison
assert(top != null), // ignore: unnecessary_null_comparison
assert(right != null), // ignore: unnecessary_null_comparison
assert(bottom != null); // ignore: unnecessary_null_comparison
: assert(left != null),
assert(top != null),
assert(right != null),
assert(bottom != null);

const Rect.fromLTWH(double left, double top, double width, double height)
: this.fromLTRB(left, top, left + width, top + height);
Expand Down Expand Up @@ -292,7 +291,7 @@ class Rect {
}

static Rect? lerp(Rect? a, Rect? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down Expand Up @@ -350,7 +349,7 @@ class Radius {
Radius operator ~/(double operand) => Radius.elliptical((x ~/ operand).toDouble(), (y ~/ operand).toDouble());
Radius operator %(double operand) => Radius.elliptical(x % operand, y % operand);
static Radius? lerp(Radius? a, Radius? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down Expand Up @@ -548,18 +547,18 @@ class RRect {
this.blRadiusX = 0.0,
this.blRadiusY = 0.0,
bool uniformRadii = false,
}) : assert(left != null), // ignore: unnecessary_null_comparison
assert(top != null), // ignore: unnecessary_null_comparison
assert(right != null), // ignore: unnecessary_null_comparison
assert(bottom != null), // ignore: unnecessary_null_comparison
assert(tlRadiusX != null), // ignore: unnecessary_null_comparison
assert(tlRadiusY != null), // ignore: unnecessary_null_comparison
assert(trRadiusX != null), // ignore: unnecessary_null_comparison
assert(trRadiusY != null), // ignore: unnecessary_null_comparison
assert(brRadiusX != null), // ignore: unnecessary_null_comparison
assert(brRadiusY != null), // ignore: unnecessary_null_comparison
assert(blRadiusX != null), // ignore: unnecessary_null_comparison
assert(blRadiusY != null), // ignore: unnecessary_null_comparison
}) : assert(left != null),
assert(top != null),
assert(right != null),
assert(bottom != null),
assert(tlRadiusX != null),
assert(tlRadiusY != null),
assert(trRadiusX != null),
assert(trRadiusY != null),
assert(brRadiusX != null),
assert(brRadiusY != null),
assert(blRadiusX != null),
assert(blRadiusY != null),
webOnlyUniformRadii = uniformRadii;

final double left;
Expand Down Expand Up @@ -806,7 +805,7 @@ class RRect {
}

static RRect? lerp(RRect? a, RRect? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down
23 changes: 11 additions & 12 deletions lib/web_ui/lib/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
// found in the LICENSE file.

// For documentation see https://github.com/flutter/engine/blob/main/lib/ui/painting.dart
// ignore_for_file: public_member_api_docs
part of ui;

// ignore: unused_element, Used in Shader assert.
bool _offsetIsValid(Offset offset) {
assert(offset != null, 'Offset argument was null.'); // ignore: unnecessary_null_comparison
assert(offset != null, 'Offset argument was null.');
assert(!offset.dx.isNaN && !offset.dy.isNaN, 'Offset argument contained a NaN value.');
return true;
}

// ignore: unused_element, Used in Shader assert.
bool _matrix4IsValid(Float32List matrix4) {
assert(matrix4 != null, 'Matrix4 argument was null.'); // ignore: unnecessary_null_comparison
assert(matrix4 != null, 'Matrix4 argument was null.');
assert(matrix4.length == 16, 'Matrix4 must have 16 entries.');
return true;
}
Expand All @@ -37,7 +36,7 @@ Color _scaleAlpha(Color a, double factor) {
}

class Color {
const Color(int value) : this.value = value & 0xFFFFFFFF;// ignore: unnecessary_this
const Color(int value) : value = value & 0xFFFFFFFF;
const Color.fromARGB(int a, int r, int g, int b)
: value = (((a & 0xff) << 24) |
((r & 0xff) << 16) |
Expand Down Expand Up @@ -94,7 +93,7 @@ class Color {
}

static Color? lerp(Color? a, Color? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand Down Expand Up @@ -146,7 +145,7 @@ class Color {
}

static int getAlphaFromOpacity(double opacity) {
assert(opacity != null); // ignore: unnecessary_null_comparison
assert(opacity != null);
return (opacity.clamp(0.0, 1.0) * 255).round();
}

Expand Down Expand Up @@ -369,8 +368,8 @@ class MaskFilter {
const MaskFilter.blur(
this._style,
this._sigma,
) : assert(_style != null), // ignore: unnecessary_null_comparison
assert(_sigma != null); // ignore: unnecessary_null_comparison
) : assert(_style != null),
assert(_sigma != null);

final BlurStyle _style;
final double _sigma;
Expand Down Expand Up @@ -656,8 +655,8 @@ class Shadow {
this.color = const Color(_kColorDefault),
this.offset = Offset.zero,
this.blurRadius = 0.0,
}) : assert(color != null, 'Text shadow color was null.'), // ignore: unnecessary_null_comparison
assert(offset != null, 'Text shadow offset was null.'), // ignore: unnecessary_null_comparison
}) : assert(color != null, 'Text shadow color was null.'),
assert(offset != null, 'Text shadow offset was null.'),
assert(blurRadius >= 0.0, 'Text shadow blur radius should be non-negative.');

static const int _kColorDefault = 0xFF000000;
Expand Down Expand Up @@ -686,7 +685,7 @@ class Shadow {
}

static Shadow? lerp(Shadow? a, Shadow? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (b == null) {
if (a == null) {
return null;
Expand All @@ -707,7 +706,7 @@ class Shadow {
}

static List<Shadow>? lerpList(List<Shadow>? a, List<Shadow>? b, double t) {
assert(t != null); // ignore: unnecessary_null_comparison
assert(t != null);
if (a == null && b == null) {
return null;
}
Expand Down
5 changes: 2 additions & 3 deletions lib/web_ui/lib/path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
part of ui;

// For documentation see https://github.com/flutter/engine/blob/main/lib/ui/painting.dart
// ignore_for_file: public_member_api_docs

abstract class Path {
factory Path() {
Expand Down Expand Up @@ -64,8 +63,8 @@ abstract class Path {
// see https://skia.org/user/api/SkPath_Reference#SkPath_getBounds
Rect getBounds();
static Path combine(PathOperation operation, Path path1, Path path2) {
assert(path1 != null); // ignore: unnecessary_null_comparison
assert(path2 != null); // ignore: unnecessary_null_comparison
assert(path1 != null);
assert(path2 != null);
if (engine.useCanvasKit) {
return engine.CkPath.combine(operation, path1, path2);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/path_metrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ abstract class PathMetric {

class Tangent {
const Tangent(this.position, this.vector)
: assert(position != null), // ignore: unnecessary_null_comparison
assert(vector != null); // ignore: unnecessary_null_comparison
: assert(position != null),
assert(vector != null);
factory Tangent.fromAngle(Offset position, double angle) {
return Tangent(position, Offset(math.cos(angle), math.sin(angle)));
}
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,15 @@ class Locale {
const Locale(
this._languageCode, [
this._countryCode,
]) : assert(_languageCode != null), // ignore: unnecessary_null_comparison
]) : assert(_languageCode != null),
assert(_languageCode != ''),
scriptCode = null;

const Locale.fromSubtags({
String languageCode = 'und',
this.scriptCode,
String? countryCode,
}) : assert(languageCode != null), // ignore: unnecessary_null_comparison
}) : assert(languageCode != null),
assert(languageCode != ''),
_languageCode = languageCode,
assert(scriptCode != ''),
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/pointer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ class PointerData {

class PointerDataPacket {
const PointerDataPacket({this.data = const <PointerData>[]})
: assert(data != null); // ignore: unnecessary_null_comparison
: assert(data != null);
final List<PointerData> data;
}
4 changes: 2 additions & 2 deletions lib/web_ui/lib/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
part of ui;

class SemanticsAction {
const SemanticsAction._(this.index) : assert(index != null); // ignore: unnecessary_null_comparison
const SemanticsAction._(this.index) : assert(index != null);

static const int _kTapIndex = 1 << 0;
static const int _kLongPressIndex = 1 << 1;
Expand Down Expand Up @@ -134,7 +134,7 @@ class SemanticsAction {
}

class SemanticsFlag {
const SemanticsFlag._(this.index) : assert(index != null); // ignore: unnecessary_null_comparison
const SemanticsFlag._(this.index) : assert(index != null);

final int index;

Expand Down
1 change: 0 additions & 1 deletion lib/web_ui/lib/src/engine/canvaskit/canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs
import 'dart:math' as math;
import 'dart:typed_data';

Expand Down
2 changes: 0 additions & 2 deletions lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/// Prefer keeping the original CanvasKit names so it is easier to locate
/// the API behind these bindings in the Skia source code.
// ignore_for_file: non_constant_identifier_names

// ignore_for_file: public_member_api_docs
@JS()
library canvaskit_api;

Expand Down
Loading

0 comments on commit b74af4c

Please sign in to comment.