forked from firka/flutter
Operator equals (flutter/engine#19303)
* use Object for operator== * apply style guide for operator==
This commit is contained in:
committed by
GitHub
parent
8a0511cd25
commit
2c2e5f362c
@@ -1,2 +1,2 @@
|
||||
Signature: d87fdd028d9cc76587c43c73be9d6541
|
||||
Signature: 850d87bf990697506c74c39a473e4645
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ abstract class OffsetBase {
|
||||
/// left-hand-side operand are equal to the horizontal and vertical values of
|
||||
/// the right-hand-side operand respectively. Returns false otherwise.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is OffsetBase
|
||||
&& other._dx == _dx
|
||||
&& other._dy == _dy;
|
||||
@@ -334,7 +334,7 @@ class Offset extends OffsetBase {
|
||||
|
||||
/// Compares two Offsets for equality.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is Offset
|
||||
&& other.dx == dx
|
||||
&& other.dy == dy;
|
||||
@@ -606,7 +606,7 @@ class Size extends OffsetBase {
|
||||
/// Compares two Sizes for equality.
|
||||
// We don't compare the runtimeType because of _DebugSize in the framework.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is Size
|
||||
&& other._dx == _dx
|
||||
&& other._dy == _dy;
|
||||
@@ -887,7 +887,7 @@ class Rect {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
@@ -1014,7 +1014,7 @@ class Radius {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
@@ -1615,7 +1615,7 @@ class RRect {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
|
||||
@@ -324,7 +324,7 @@ class Color {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other.runtimeType != runtimeType)
|
||||
@@ -2612,7 +2612,7 @@ class MaskFilter {
|
||||
static const int _TypeBlur = 1; // SkBlurMaskFilter
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is MaskFilter
|
||||
&& other._style == _style
|
||||
&& other._sigma == _sigma;
|
||||
@@ -2741,7 +2741,7 @@ class ColorFilter {
|
||||
static const int _TypeSrgbToLinearGamma = 4; // MakeSRGBToLinearGamma
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is ColorFilter
|
||||
&& other._type == _type
|
||||
&& _listEquals<double>(other._matrix, _matrix)
|
||||
@@ -2886,7 +2886,7 @@ class ImageFilter {
|
||||
static const int _kTypeMatrix = 1; // MakeMatrixFilterRowMajor255
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is ImageFilter
|
||||
&& other._type == _type
|
||||
&& _listEquals<double>(other._data, _data)
|
||||
@@ -4398,7 +4398,7 @@ class Shadow {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
return other is Shadow
|
||||
|
||||
@@ -24,7 +24,7 @@ class CallbackHandle {
|
||||
int toRawHandle() => _handle;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (runtimeType != other.runtimeType)
|
||||
return false;
|
||||
return other is CallbackHandle
|
||||
|
||||
@@ -298,7 +298,7 @@ class FontFeature {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other.runtimeType != runtimeType)
|
||||
@@ -389,7 +389,7 @@ class TextDecoration {
|
||||
static const TextDecoration lineThrough = TextDecoration._(0x4);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is TextDecoration
|
||||
&& other._mask == _mask;
|
||||
}
|
||||
@@ -496,7 +496,7 @@ class TextHeightBehavior {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType)
|
||||
return false;
|
||||
return other is TextHeightBehavior
|
||||
@@ -767,7 +767,7 @@ class TextStyle {
|
||||
final List<FontFeature>? _fontFeatures;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
return other is TextStyle
|
||||
@@ -1007,7 +1007,7 @@ class ParagraphStyle {
|
||||
final Locale? _locale;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other.runtimeType != runtimeType)
|
||||
@@ -1186,7 +1186,7 @@ class StrutStyle {
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other.runtimeType != runtimeType)
|
||||
@@ -1350,7 +1350,7 @@ class TextBox {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other.runtimeType != runtimeType)
|
||||
@@ -1462,7 +1462,7 @@ class TextPosition {
|
||||
final TextAffinity affinity;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType)
|
||||
return false;
|
||||
return other is TextPosition
|
||||
@@ -1546,7 +1546,7 @@ class TextRange {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
return other is TextRange
|
||||
@@ -1598,7 +1598,7 @@ class ParagraphConstraints {
|
||||
final double width;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType)
|
||||
return false;
|
||||
return other is ParagraphConstraints
|
||||
|
||||
@@ -470,7 +470,7 @@ class Locale {
|
||||
};
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other is! Locale) {
|
||||
@@ -1300,7 +1300,7 @@ class AccessibilityFeatures {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType)
|
||||
return false;
|
||||
return other is AccessibilityFeatures
|
||||
|
||||
@@ -27,8 +27,9 @@ class FilePath {
|
||||
path.relative(_absolutePath, from: environment.webUiRootDir.path);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
return other is FilePath && _absolutePath == other._absolutePath;
|
||||
bool operator ==(Object other) {
|
||||
return other is FilePath
|
||||
&& other._absolutePath == _absolutePath;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -121,20 +121,12 @@ class EngineColorFilter implements ui.ColorFilter {
|
||||
static const int _TypeSrgbToLinearGamma = 4; // MakeSRGBToLinearGamma
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
if (other is! EngineColorFilter) {
|
||||
return false;
|
||||
}
|
||||
final EngineColorFilter typedOther = other;
|
||||
|
||||
if (_type != typedOther._type) {
|
||||
return false;
|
||||
}
|
||||
if (!_listEquals<double>(_matrix, typedOther._matrix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return _color == typedOther._color && _blendMode == typedOther._blendMode;
|
||||
bool operator ==(Object other) {
|
||||
return other is EngineColorFilter
|
||||
&& other._type == _type
|
||||
&& _listEquals<double>(other._matrix, _matrix)
|
||||
&& other._color == _color
|
||||
&& other._blendMode == _blendMode;
|
||||
}
|
||||
|
||||
SkColorFilter? _toSkColorFilter() {
|
||||
|
||||
@@ -398,18 +398,14 @@ class EmbeddedViewParams {
|
||||
final ui.Size size;
|
||||
final MutatorsStack mutators;
|
||||
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other is! EmbeddedViewParams) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EmbeddedViewParams typedOther = other;
|
||||
return offset == typedOther.offset &&
|
||||
size == typedOther.size &&
|
||||
mutators == typedOther.mutators;
|
||||
return other is EmbeddedViewParams
|
||||
&& other.offset == offset
|
||||
&& other.size == size
|
||||
&& other.mutators == mutators;
|
||||
}
|
||||
|
||||
int get hashCode => ui.hashValues(offset, size, mutators);
|
||||
@@ -459,7 +455,7 @@ class Mutator {
|
||||
|
||||
double get alphaFloat => alpha! / 255.0;
|
||||
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
@@ -524,26 +520,12 @@ class MutatorsStack extends Iterable<Mutator> {
|
||||
_mutators.removeLast();
|
||||
}
|
||||
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (other is! MutatorsStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final MutatorsStack typedOther = other;
|
||||
if (_mutators.length != typedOther._mutators.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _mutators.length; i++) {
|
||||
if (_mutators[i] != typedOther._mutators[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return other is MutatorsStack
|
||||
&& _listEquals<Mutator>(other._mutators, _mutators);
|
||||
}
|
||||
|
||||
int get hashCode => ui.hashList(_mutators);
|
||||
|
||||
@@ -32,12 +32,10 @@ class SkImageFilter extends ResurrectableSkiaObject implements ui.ImageFilter {
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
if (other is! SkImageFilter) {
|
||||
return false;
|
||||
}
|
||||
final SkImageFilter typedOther = other;
|
||||
return _sigmaX == typedOther._sigmaX && _sigmaY == typedOther._sigmaY;
|
||||
bool operator ==(Object other) {
|
||||
return other is SkImageFilter
|
||||
&& other._sigmaX == _sigmaX
|
||||
&& other._sigmaY == _sigmaY;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -278,12 +278,10 @@ class EngineImageFilter implements ui.ImageFilter {
|
||||
final double sigmaY;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
if (other is! EngineImageFilter) {
|
||||
return false;
|
||||
}
|
||||
final EngineImageFilter typedOther = other;
|
||||
return sigmaX == typedOther.sigmaX && sigmaY == typedOther.sigmaY;
|
||||
bool operator ==(Object other) {
|
||||
return other is EngineImageFilter
|
||||
&& other.sigmaX == sigmaX
|
||||
&& other.sigmaY == sigmaY;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -103,27 +103,26 @@ class EngineLineMetrics implements ui.LineMetrics {
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final EngineLineMetrics typedOther = other;
|
||||
return displayText == typedOther.displayText &&
|
||||
startIndex == typedOther.startIndex &&
|
||||
endIndex == typedOther.endIndex &&
|
||||
hardBreak == typedOther.hardBreak &&
|
||||
ascent == typedOther.ascent &&
|
||||
descent == typedOther.descent &&
|
||||
unscaledAscent == typedOther.unscaledAscent &&
|
||||
height == typedOther.height &&
|
||||
width == typedOther.width &&
|
||||
left == typedOther.left &&
|
||||
baseline == typedOther.baseline &&
|
||||
lineNumber == typedOther.lineNumber;
|
||||
return other is EngineLineMetrics
|
||||
&& other.displayText == displayText
|
||||
&& other.startIndex == startIndex
|
||||
&& other.endIndex == endIndex
|
||||
&& other.hardBreak == hardBreak
|
||||
&& other.ascent == ascent
|
||||
&& other.descent == descent
|
||||
&& other.unscaledAscent == unscaledAscent
|
||||
&& other.height == height
|
||||
&& other.width == width
|
||||
&& other.left == left
|
||||
&& other.baseline == baseline
|
||||
&& other.lineNumber == lineNumber;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -687,25 +686,25 @@ class EngineParagraphStyle implements ui.ParagraphStyle {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final EngineParagraphStyle typedOther = other;
|
||||
return _textAlign == typedOther._textAlign ||
|
||||
_textDirection == typedOther._textDirection ||
|
||||
_fontWeight == typedOther._fontWeight ||
|
||||
_fontStyle == typedOther._fontStyle ||
|
||||
_maxLines == typedOther._maxLines ||
|
||||
_fontFamily == typedOther._fontFamily ||
|
||||
_fontSize == typedOther._fontSize ||
|
||||
_height == typedOther._height ||
|
||||
_textHeightBehavior == typedOther._textHeightBehavior ||
|
||||
_ellipsis == typedOther._ellipsis ||
|
||||
_locale == typedOther._locale;
|
||||
return other is EngineParagraphStyle
|
||||
&& other._textAlign == _textAlign
|
||||
&& other._textDirection == _textDirection
|
||||
&& other._fontWeight == _fontWeight
|
||||
&& other._fontStyle == _fontStyle
|
||||
&& other._maxLines == _maxLines
|
||||
&& other._fontFamily == _fontFamily
|
||||
&& other._fontSize == _fontSize
|
||||
&& other._height == _height
|
||||
&& other._textHeightBehavior == _textHeightBehavior
|
||||
&& other._ellipsis == _ellipsis
|
||||
&& other._locale == _locale;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -830,32 +829,31 @@ class EngineTextStyle implements ui.TextStyle {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final EngineTextStyle typedOther = other;
|
||||
return _color == typedOther._color &&
|
||||
_decoration == typedOther._decoration &&
|
||||
_decorationColor == typedOther._decorationColor &&
|
||||
_decorationStyle == typedOther._decorationStyle &&
|
||||
_fontWeight == typedOther._fontWeight &&
|
||||
_fontStyle == typedOther._fontStyle &&
|
||||
_textBaseline == typedOther._textBaseline &&
|
||||
_fontFamily == typedOther._fontFamily &&
|
||||
_fontSize == typedOther._fontSize &&
|
||||
_letterSpacing == typedOther._letterSpacing &&
|
||||
_wordSpacing == typedOther._wordSpacing &&
|
||||
_height == typedOther._height &&
|
||||
_locale == typedOther._locale &&
|
||||
_background == typedOther._background &&
|
||||
_foreground == typedOther._foreground &&
|
||||
_listEquals<ui.Shadow>(_shadows, typedOther._shadows) &&
|
||||
_listEquals<String>(
|
||||
_fontFamilyFallback, typedOther._fontFamilyFallback);
|
||||
return other is EngineTextStyle
|
||||
&& other._color == _color
|
||||
&& other._decoration == _decoration
|
||||
&& other._decorationColor == _decorationColor
|
||||
&& other._decorationStyle == _decorationStyle
|
||||
&& other._fontWeight == _fontWeight
|
||||
&& other._fontStyle == _fontStyle
|
||||
&& other._textBaseline == _textBaseline
|
||||
&& other._fontFamily == _fontFamily
|
||||
&& other._fontSize == _fontSize
|
||||
&& other._letterSpacing == _letterSpacing
|
||||
&& other._wordSpacing == _wordSpacing
|
||||
&& other._height == _height
|
||||
&& other._locale == _locale
|
||||
&& other._background == _background
|
||||
&& other._foreground == _foreground
|
||||
&& _listEquals<ui.Shadow>(other._shadows, _shadows)
|
||||
&& _listEquals<String>(other._fontFamilyFallback, _fontFamilyFallback);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -975,23 +973,22 @@ class EngineStrutStyle implements ui.StrutStyle {
|
||||
final bool? _forceStrutHeight;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final EngineStrutStyle typedOther = other;
|
||||
return _fontFamily == typedOther._fontFamily &&
|
||||
_fontSize == typedOther._fontSize &&
|
||||
_height == typedOther._height &&
|
||||
_leading == typedOther._leading &&
|
||||
_fontWeight == typedOther._fontWeight &&
|
||||
_fontStyle == typedOther._fontStyle &&
|
||||
_forceStrutHeight == typedOther._forceStrutHeight &&
|
||||
_listEquals<String>(
|
||||
_fontFamilyFallback, typedOther._fontFamilyFallback);
|
||||
return other is EngineStrutStyle
|
||||
&& other._fontFamily == _fontFamily
|
||||
&& other._fontSize == _fontSize
|
||||
&& other._height == _height
|
||||
&& other._leading == _leading
|
||||
&& other._fontWeight == _fontWeight
|
||||
&& other._fontStyle == _fontStyle
|
||||
&& other._forceStrutHeight == _forceStrutHeight
|
||||
&& _listEquals<String>(other._fontFamilyFallback, _fontFamilyFallback);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -95,24 +95,24 @@ class ParagraphGeometricStyle {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final ParagraphGeometricStyle typedOther = other;
|
||||
return fontWeight == typedOther.fontWeight &&
|
||||
fontStyle == typedOther.fontStyle &&
|
||||
fontFamily == typedOther.fontFamily &&
|
||||
fontSize == typedOther.fontSize &&
|
||||
lineHeight == typedOther.lineHeight &&
|
||||
maxLines == typedOther.maxLines &&
|
||||
letterSpacing == typedOther.letterSpacing &&
|
||||
wordSpacing == typedOther.wordSpacing &&
|
||||
decoration == typedOther.decoration &&
|
||||
ellipsis == typedOther.ellipsis;
|
||||
return other is ParagraphGeometricStyle
|
||||
&& other.fontWeight == fontWeight
|
||||
&& other.fontStyle == fontStyle
|
||||
&& other.fontFamily == fontFamily
|
||||
&& other.fontSize == fontSize
|
||||
&& other.lineHeight == lineHeight
|
||||
&& other.maxLines == maxLines
|
||||
&& other.letterSpacing == letterSpacing
|
||||
&& other.wordSpacing == wordSpacing
|
||||
&& other.decoration == decoration
|
||||
&& other.ellipsis == ellipsis;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -345,17 +345,17 @@ class EditingState {
|
||||
int get hashCode => ui.hashValues(text, baseOffset, extentOffset);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final EditingState typedOther = other;
|
||||
return text == typedOther.text &&
|
||||
baseOffset == typedOther.baseOffset &&
|
||||
extentOffset == typedOther.extentOffset;
|
||||
return other is EditingState
|
||||
&& other.text == text
|
||||
&& other.baseOffset == baseOffset
|
||||
&& other.extentOffset == extentOffset;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -83,7 +83,7 @@ abstract class OffsetBase {
|
||||
/// left-hand-side operand are equal to the horizontal and vertical values of
|
||||
/// the right-hand-side operand respectively. Returns false otherwise.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is OffsetBase
|
||||
&& other._dx == _dx
|
||||
&& other._dy == _dy;
|
||||
@@ -333,7 +333,7 @@ class Offset extends OffsetBase {
|
||||
|
||||
/// Compares two Offsets for equality.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is Offset
|
||||
&& other.dx == dx
|
||||
&& other.dy == dy;
|
||||
@@ -605,7 +605,7 @@ class Size extends OffsetBase {
|
||||
/// Compares two Sizes for equality.
|
||||
// We don't compare the runtimeType because of _DebugSize in the framework.
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
return other is Size
|
||||
&& other._dx == _dx
|
||||
&& other._dy == _dy;
|
||||
@@ -883,7 +883,7 @@ class Rect {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
@@ -1010,7 +1010,7 @@ class Radius {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
@@ -1620,7 +1620,7 @@ class RRect {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
|
||||
@@ -239,15 +239,15 @@ class Color {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final Color typedOther = other;
|
||||
return value == typedOther.value;
|
||||
return other is Color
|
||||
&& other.value == value;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1382,12 +1382,10 @@ class MaskFilter {
|
||||
BlurStyle get webOnlyBlurStyle => _style;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
if (other is! MaskFilter) {
|
||||
return false;
|
||||
}
|
||||
final MaskFilter typedOther = other;
|
||||
return _style == typedOther._style && _sigma == typedOther._sigma;
|
||||
bool operator ==(Object other) {
|
||||
return other is MaskFilter
|
||||
&& other._style == _style
|
||||
&& other._sigma == _sigma;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1810,17 +1808,14 @@ class Shadow {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other is! Shadow) {
|
||||
return false;
|
||||
}
|
||||
final Shadow typedOther = other;
|
||||
return color == typedOther.color &&
|
||||
offset == typedOther.offset &&
|
||||
blurRadius == typedOther.blurRadius;
|
||||
return other is Shadow
|
||||
&& other.color == color
|
||||
&& other.offset == offset
|
||||
&& other.blurRadius == blurRadius;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -280,15 +280,16 @@ class FontFeature {
|
||||
final int value;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final FontFeature typedOther = other;
|
||||
return feature == typedOther.feature && value == typedOther.value;
|
||||
return other is FontFeature
|
||||
&& other.feature == feature
|
||||
&& other.value == value;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -373,12 +374,9 @@ class TextDecoration {
|
||||
static const TextDecoration lineThrough = TextDecoration._(0x4);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
if (other is! TextDecoration) {
|
||||
return false;
|
||||
}
|
||||
final TextDecoration typedOther = other;
|
||||
return _mask == typedOther._mask;
|
||||
bool operator ==(Object other) {
|
||||
return other is TextDecoration
|
||||
&& other._mask == _mask;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -486,7 +484,7 @@ class TextHeightBehavior {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType)
|
||||
return false;
|
||||
return other is TextHeightBehavior
|
||||
@@ -907,19 +905,19 @@ class TextBox {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final TextBox typedOther = other;
|
||||
return typedOther.left == left &&
|
||||
typedOther.top == top &&
|
||||
typedOther.right == right &&
|
||||
typedOther.bottom == bottom &&
|
||||
typedOther.direction == direction;
|
||||
return other is TextBox
|
||||
&& other.left == left
|
||||
&& other.top == top
|
||||
&& other.right == right
|
||||
&& other.bottom == bottom
|
||||
&& other.direction == direction;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1023,12 +1021,13 @@ class TextPosition {
|
||||
final TextAffinity affinity;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final TextPosition typedOther = other;
|
||||
return typedOther.offset == offset && typedOther.affinity == affinity;
|
||||
return other is TextPosition
|
||||
&& other.offset == offset
|
||||
&& other.affinity == affinity;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1104,15 +1103,13 @@ class TextRange {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other is! TextRange) {
|
||||
return false;
|
||||
}
|
||||
final TextRange typedOther = other;
|
||||
return typedOther.start == start && typedOther.end == end;
|
||||
return other is TextRange
|
||||
&& other.start == start
|
||||
&& other.end == end;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1159,12 +1156,12 @@ class ParagraphConstraints {
|
||||
final double width;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final ParagraphConstraints typedOther = other;
|
||||
return typedOther.width == width;
|
||||
return other is ParagraphConstraints
|
||||
&& other.width == width;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -375,17 +375,14 @@ class Locale {
|
||||
};
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other is! Locale) {
|
||||
return false;
|
||||
}
|
||||
final Locale typedOther = other;
|
||||
return languageCode == typedOther.languageCode &&
|
||||
scriptCode == typedOther.scriptCode &&
|
||||
countryCode == typedOther.countryCode;
|
||||
return other is Locale
|
||||
&& other.languageCode == languageCode
|
||||
&& other.scriptCode == scriptCode
|
||||
&& other.countryCode == countryCode;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -926,12 +923,12 @@ class AccessibilityFeatures {
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final AccessibilityFeatures typedOther = other;
|
||||
return _index == typedOther._index;
|
||||
return other is AccessibilityFeatures
|
||||
&& other._index == _index;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -78,14 +78,16 @@ class BenchmarkDatapoint {
|
||||
int get hashCode => hashValues(name, value);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
return name == other.name && value == other.value;
|
||||
return other is BenchmarkDatapoint
|
||||
&& other.name == name
|
||||
&& other.value == value;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -173,8 +173,10 @@ class Line {
|
||||
int get hashCode => hashValues(text, breakType);
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
return other is Line && text == other.text && breakType == other.breakType;
|
||||
bool operator ==(Object other) {
|
||||
return other is Line
|
||||
&& other.text == text
|
||||
&& other.breakType == breakType;
|
||||
}
|
||||
|
||||
String get escapedText {
|
||||
|
||||
@@ -26,8 +26,10 @@ class Handle extends NativeFieldWrapperClass2 {
|
||||
String toString() => 'Handle($handle)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
(other is Handle) && (handle == other.handle);
|
||||
bool operator ==(Object other) {
|
||||
return other is Handle
|
||||
&& other.handle == handle;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => handle.hashCode;
|
||||
|
||||
@@ -25,13 +25,13 @@ abstract class Key {
|
||||
final dynamic _value;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (runtimeType != other.runtimeType)
|
||||
return false;
|
||||
final Key typedOther = other;
|
||||
return _value == typedOther._value;
|
||||
return other is Key
|
||||
&& other._value == _value;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user