From 82262d8896d58f6d13893d695559a9dc8036cfbd Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Thu, 9 Jan 2020 17:23:02 +0100 Subject: [PATCH] format operator== according to flutter style guide (#48449) --- .../lib/framework/running_processes.dart | 8 +++--- dev/tools/vitool/lib/vitool.dart | 6 ++--- .../transformations_demo_board.dart | 2 +- .../flutter_gallery/lib/gallery/demos.dart | 7 +++--- .../flutter_gallery/lib/gallery/options.dart | 4 +-- .../flutter_gallery/lib/gallery/scales.dart | 12 ++++----- .../flutter/lib/src/cupertino/colors.dart | 25 ++++++++++--------- packages/flutter/lib/src/cupertino/route.dart | 4 +-- packages/flutter/lib/src/foundation/key.dart | 2 +- .../lib/src/foundation/stack_frame.dart | 18 ++++++------- .../lib/src/gestures/velocity_tracker.dart | 2 +- .../lib/src/material/app_bar_theme.dart | 2 +- .../lib/src/material/banner_theme.dart | 2 +- .../src/material/bottom_app_bar_theme.dart | 2 +- .../lib/src/material/button_theme.dart | 2 +- .../flutter/lib/src/material/card_theme.dart | 2 +- packages/flutter/lib/src/material/chip.dart | 2 +- .../lib/src/material/dialog_theme.dart | 2 +- .../lib/src/material/divider_theme.dart | 2 +- .../flutter/lib/src/material/dropdown.dart | 2 +- .../lib/src/material/expansion_panel.dart | 2 +- .../lib/src/material/input_border.dart | 8 +++--- .../lib/src/material/input_decorator.dart | 8 +++--- .../lib/src/material/mergeable_material.dart | 2 +- .../lib/src/material/outline_button.dart | 4 +-- .../src/material/page_transitions_theme.dart | 4 +-- .../flutter/lib/src/material/scaffold.dart | 2 +- .../lib/src/material/snack_bar_theme.dart | 2 +- .../lib/src/material/tab_bar_theme.dart | 2 +- .../flutter/lib/src/material/text_theme.dart | 2 +- .../flutter/lib/src/material/theme_data.dart | 2 +- packages/flutter/lib/src/material/time.dart | 2 +- .../lib/src/painting/_network_image_io.dart | 2 +- .../lib/src/painting/_network_image_web.dart | 2 +- .../flutter/lib/src/painting/alignment.dart | 2 +- .../painting/beveled_rectangle_border.dart | 4 +-- .../lib/src/painting/border_radius.dart | 4 +-- .../flutter/lib/src/painting/borders.dart | 8 +++--- .../flutter/lib/src/painting/box_border.dart | 8 +++--- .../lib/src/painting/box_decoration.dart | 4 +-- .../flutter/lib/src/painting/box_shadow.dart | 4 +-- .../lib/src/painting/circle_border.dart | 4 +-- packages/flutter/lib/src/painting/colors.dart | 6 ++--- .../painting/continuous_rectangle_border.dart | 4 +-- .../lib/src/painting/decoration_image.dart | 4 +-- .../flutter/lib/src/painting/edge_insets.dart | 2 +- .../lib/src/painting/flutter_logo.dart | 2 +- .../flutter/lib/src/painting/gradient.dart | 12 ++++----- .../lib/src/painting/image_provider.dart | 10 ++++---- .../lib/src/painting/image_resolution.dart | 2 +- .../lib/src/painting/image_stream.dart | 2 +- .../flutter/lib/src/painting/inline_span.dart | 13 +++++----- .../painting/rounded_rectangle_border.dart | 8 +++--- .../lib/src/painting/shape_decoration.dart | 4 +-- .../lib/src/painting/stadium_border.dart | 12 ++++----- .../flutter/lib/src/painting/strut_style.dart | 2 +- .../flutter/lib/src/painting/text_span.dart | 2 +- .../flutter/lib/src/painting/text_style.dart | 2 +- packages/flutter/lib/src/rendering/box.dart | 6 ++--- .../flutter/lib/src/rendering/sliver.dart | 2 +- packages/flutter/lib/src/rendering/stack.dart | 2 +- .../lib/src/rendering/table_border.dart | 4 +-- .../flutter/lib/src/semantics/semantics.dart | 6 ++--- .../lib/src/services/keyboard_key.dart | 4 +-- .../lib/src/services/raw_keyboard.dart | 10 +++++--- .../lib/src/services/system_chrome.dart | 2 +- .../lib/src/services/text_editing.dart | 2 +- .../flutter/lib/src/services/text_input.dart | 4 +-- packages/flutter/lib/src/widgets/async.dart | 2 +- .../flutter/lib/src/widgets/framework.dart | 6 ++--- .../flutter/lib/src/widgets/icon_data.dart | 4 +-- .../lib/src/widgets/icon_theme_data.dart | 2 +- .../flutter/lib/src/widgets/page_storage.dart | 2 +- .../lib/src/widgets/widget_inspector.dart | 4 +-- .../flutter/lib/src/widgets/widget_span.dart | 2 +- .../test/services/fake_platform_views.dart | 16 ++++++------ packages/flutter/test/widgets/key_test.dart | 2 +- .../flutter_driver/lib/src/driver/driver.dart | 2 +- packages/flutter_test/test/matchers_test.dart | 2 +- packages/flutter_tools/lib/src/asset.dart | 2 +- .../lib/src/base/fingerprint.dart | 2 +- .../flutter_tools/lib/src/base/version.dart | 10 ++++---- packages/flutter_tools/lib/src/device.dart | 8 +++--- packages/flutter_tools/lib/src/emulator.dart | 8 +++--- 84 files changed, 196 insertions(+), 197 deletions(-) diff --git a/dev/devicelab/lib/framework/running_processes.dart b/dev/devicelab/lib/framework/running_processes.dart index cb09cf56c0..399b957465 100644 --- a/dev/devicelab/lib/framework/running_processes.dart +++ b/dev/devicelab/lib/framework/running_processes.dart @@ -19,10 +19,10 @@ class RunningProcessInfo { @override bool operator ==(Object other) { - return other is RunningProcessInfo && - other.pid == pid && - other.commandLine == commandLine && - other.creationDate == creationDate; + return other is RunningProcessInfo + && other.pid == pid + && other.commandLine == commandLine + && other.creationDate == creationDate; } @override diff --git a/dev/tools/vitool/lib/vitool.dart b/dev/tools/vitool/lib/vitool.dart index df713c2535..bd0bdfe376 100644 --- a/dev/tools/vitool/lib/vitool.dart +++ b/dev/tools/vitool/lib/vitool.dart @@ -268,7 +268,7 @@ class FrameData { @override bool operator ==(Object other) { - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is FrameData && other.size == size @@ -320,7 +320,7 @@ class SvgPath { @override bool operator ==(Object other) { - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is SvgPath && other.id == id @@ -369,7 +369,7 @@ class SvgPathCommand { @override bool operator ==(Object other) { - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is SvgPathCommand && other.type == type diff --git a/examples/flutter_gallery/lib/demo/transformations/transformations_demo_board.dart b/examples/flutter_gallery/lib/demo/transformations/transformations_demo_board.dart index 25db3043a9..1ff5d6da23 100644 --- a/examples/flutter_gallery/lib/demo/transformations/transformations_demo_board.dart +++ b/examples/flutter_gallery/lib/demo/transformations/transformations_demo_board.dart @@ -266,7 +266,7 @@ class BoardPoint { // Only compares by location. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } diff --git a/examples/flutter_gallery/lib/gallery/demos.dart b/examples/flutter_gallery/lib/gallery/demos.dart index 979dc7aa34..3b1c72255f 100644 --- a/examples/flutter_gallery/lib/gallery/demos.dart +++ b/examples/flutter_gallery/lib/gallery/demos.dart @@ -17,13 +17,14 @@ class GalleryDemoCategory { final IconData icon; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is GalleryDemoCategory - && other.name == name && other.icon == icon; + && other.name == name + && other.icon == icon; } @override diff --git a/examples/flutter_gallery/lib/gallery/options.dart b/examples/flutter_gallery/lib/gallery/options.dart index 841090eaee..c939fca6a4 100644 --- a/examples/flutter_gallery/lib/gallery/options.dart +++ b/examples/flutter_gallery/lib/gallery/options.dart @@ -55,8 +55,8 @@ class GalleryOptions { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is GalleryOptions && other.themeMode == themeMode diff --git a/examples/flutter_gallery/lib/gallery/scales.dart b/examples/flutter_gallery/lib/gallery/scales.dart index b25b2c313f..2554a8f194 100644 --- a/examples/flutter_gallery/lib/gallery/scales.dart +++ b/examples/flutter_gallery/lib/gallery/scales.dart @@ -11,8 +11,8 @@ class GalleryTextScaleValue { final String label; @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is GalleryTextScaleValue && other.scale == scale @@ -44,12 +44,12 @@ class GalleryVisualDensityValue { final String label; @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is GalleryVisualDensityValue - && visualDensity == other.visualDensity - && label == other.label; + && other.visualDensity == visualDensity + && other.label == label; } @override diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index 44cf7ad20d..282a4abcd7 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -1000,20 +1000,21 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - - return other.runtimeType == runtimeType - && value == other.value - && color == other.color - && darkColor == other.darkColor - && highContrastColor == other.highContrastColor - && darkHighContrastColor == other.darkHighContrastColor - && elevatedColor == other.elevatedColor - && darkElevatedColor == other.darkElevatedColor - && highContrastElevatedColor == other.highContrastElevatedColor - && darkHighContrastElevatedColor == other.darkHighContrastElevatedColor; + if (other.runtimeType != runtimeType) + return false; + return other is CupertinoDynamicColor + && other.value == value + && other.color == color + && other.darkColor == darkColor + && other.highContrastColor == highContrastColor + && other.darkHighContrastColor == darkHighContrastColor + && other.elevatedColor == elevatedColor + && other.darkElevatedColor == darkElevatedColor + && other.highContrastElevatedColor == highContrastElevatedColor + && other.darkHighContrastElevatedColor == darkHighContrastElevatedColor; } @override diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 724011ed16..61e88f6b0e 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -734,8 +734,8 @@ class _CupertinoEdgeShadowDecoration extends Decoration { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is _CupertinoEdgeShadowDecoration && other.edgeGradient == edgeGradient; diff --git a/packages/flutter/lib/src/foundation/key.dart b/packages/flutter/lib/src/foundation/key.dart index 31d6e857d1..2c54957671 100644 --- a/packages/flutter/lib/src/foundation/key.dart +++ b/packages/flutter/lib/src/foundation/key.dart @@ -70,7 +70,7 @@ class ValueKey extends LocalKey { final T value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ValueKey diff --git a/packages/flutter/lib/src/foundation/stack_frame.dart b/packages/flutter/lib/src/foundation/stack_frame.dart index d0ffc93633..a1474530e9 100644 --- a/packages/flutter/lib/src/foundation/stack_frame.dart +++ b/packages/flutter/lib/src/foundation/stack_frame.dart @@ -213,16 +213,16 @@ class StackFrame { @override bool operator ==(Object other) { - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; - return other is StackFrame && - number == other.number && - package == other.package && - line == other.line && - column == other.column && - className == other.className && - method == other.method && - source == other.source; + return other is StackFrame + && other.number == number + && other.package == package + && other.line == line + && other.column == column + && other.className == className + && other.method == method + && other.source == source; } @override diff --git a/packages/flutter/lib/src/gestures/velocity_tracker.dart b/packages/flutter/lib/src/gestures/velocity_tracker.dart index b5783f1cba..34d02474c3 100644 --- a/packages/flutter/lib/src/gestures/velocity_tracker.dart +++ b/packages/flutter/lib/src/gestures/velocity_tracker.dart @@ -62,7 +62,7 @@ class Velocity { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is Velocity && other.pixelsPerSecond == pixelsPerSecond; } diff --git a/packages/flutter/lib/src/material/app_bar_theme.dart b/packages/flutter/lib/src/material/app_bar_theme.dart index e9cb2b71cc..f4758f9de8 100644 --- a/packages/flutter/lib/src/material/app_bar_theme.dart +++ b/packages/flutter/lib/src/material/app_bar_theme.dart @@ -123,7 +123,7 @@ class AppBarTheme extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/banner_theme.dart b/packages/flutter/lib/src/material/banner_theme.dart index 9fea036c05..4e3d2b7207 100644 --- a/packages/flutter/lib/src/material/banner_theme.dart +++ b/packages/flutter/lib/src/material/banner_theme.dart @@ -89,7 +89,7 @@ class MaterialBannerThemeData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/bottom_app_bar_theme.dart b/packages/flutter/lib/src/material/bottom_app_bar_theme.dart index c8bc83f718..a05c15baa5 100644 --- a/packages/flutter/lib/src/material/bottom_app_bar_theme.dart +++ b/packages/flutter/lib/src/material/bottom_app_bar_theme.dart @@ -87,7 +87,7 @@ class BottomAppBarTheme extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/button_theme.dart b/packages/flutter/lib/src/material/button_theme.dart index fbe6d47969..f4e0616faa 100644 --- a/packages/flutter/lib/src/material/button_theme.dart +++ b/packages/flutter/lib/src/material/button_theme.dart @@ -904,7 +904,7 @@ class ButtonThemeData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ButtonThemeData diff --git a/packages/flutter/lib/src/material/card_theme.dart b/packages/flutter/lib/src/material/card_theme.dart index 37b2609826..6f05f3f92b 100644 --- a/packages/flutter/lib/src/material/card_theme.dart +++ b/packages/flutter/lib/src/material/card_theme.dart @@ -117,7 +117,7 @@ class CardTheme extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 16206ff9d7..96cf9ad2bc 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -2180,7 +2180,7 @@ class _ChipRenderTheme { final bool canTapBody; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } diff --git a/packages/flutter/lib/src/material/dialog_theme.dart b/packages/flutter/lib/src/material/dialog_theme.dart index 68fb204a63..995bdde295 100644 --- a/packages/flutter/lib/src/material/dialog_theme.dart +++ b/packages/flutter/lib/src/material/dialog_theme.dart @@ -104,7 +104,7 @@ class DialogTheme extends Diagnosticable { int get hashCode => shape.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/divider_theme.dart b/packages/flutter/lib/src/material/divider_theme.dart index 4aa01350cc..399d24f36f 100644 --- a/packages/flutter/lib/src/material/divider_theme.dart +++ b/packages/flutter/lib/src/material/divider_theme.dart @@ -105,7 +105,7 @@ class DividerThemeData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 293d3a7bb9..dfd0398338 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -366,7 +366,7 @@ class _DropdownRouteResult { final T result; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is _DropdownRouteResult && other.result == result; } diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index c9e794e349..616aa69f7d 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -24,7 +24,7 @@ class _SaltedKey extends LocalKey { final V value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is _SaltedKey diff --git a/packages/flutter/lib/src/material/input_border.dart b/packages/flutter/lib/src/material/input_border.dart index e225bd969d..3371a8fcac 100644 --- a/packages/flutter/lib/src/material/input_border.dart +++ b/packages/flutter/lib/src/material/input_border.dart @@ -235,10 +235,10 @@ class UnderlineInputBorder extends InputBorder { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is InputBorder && other.borderSide == borderSide; @@ -492,10 +492,10 @@ class OutlineInputBorder extends InputBorder { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is OutlineInputBorder && other.borderSide == borderSide diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index f9627d41be..9894930660 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -39,10 +39,10 @@ class _InputBorderGap extends ChangeNotifier { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is _InputBorderGap && other.start == start @@ -525,7 +525,7 @@ class _Decoration { final Widget container; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -3189,7 +3189,7 @@ class InputDecoration { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/mergeable_material.dart b/packages/flutter/lib/src/material/mergeable_material.dart index e60d5fabf6..a6691d4a9a 100644 --- a/packages/flutter/lib/src/material/mergeable_material.dart +++ b/packages/flutter/lib/src/material/mergeable_material.dart @@ -631,7 +631,7 @@ class _MergeableMaterialSliceKey extends GlobalKey { final LocalKey value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is _MergeableMaterialSliceKey && other.value == value; } diff --git a/packages/flutter/lib/src/material/outline_button.dart b/packages/flutter/lib/src/material/outline_button.dart index 0b8cd05c60..ba8158751b 100644 --- a/packages/flutter/lib/src/material/outline_button.dart +++ b/packages/flutter/lib/src/material/outline_button.dart @@ -552,10 +552,10 @@ class _OutlineBorder extends ShapeBorder implements MaterialStateProperty(_all(other.builders), _all(builders)); diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 48ca12dcbb..7d9870af41 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -314,7 +314,7 @@ class _BodyBoxConstraints extends BoxConstraints { // If the height of the bottom widgets has changed, even though the constraints' // min and max values have not, we still want performLayout to happen. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (super != other) return false; return other is _BodyBoxConstraints diff --git a/packages/flutter/lib/src/material/snack_bar_theme.dart b/packages/flutter/lib/src/material/snack_bar_theme.dart index a5281f037b..33b3e8c818 100644 --- a/packages/flutter/lib/src/material/snack_bar_theme.dart +++ b/packages/flutter/lib/src/material/snack_bar_theme.dart @@ -156,7 +156,7 @@ class SnackBarThemeData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/tab_bar_theme.dart b/packages/flutter/lib/src/material/tab_bar_theme.dart index 69963d83cf..84685624cd 100644 --- a/packages/flutter/lib/src/material/tab_bar_theme.dart +++ b/packages/flutter/lib/src/material/tab_bar_theme.dart @@ -117,7 +117,7 @@ class TabBarTheme extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/text_theme.dart b/packages/flutter/lib/src/material/text_theme.dart index 13a4e89f78..870d4c231e 100644 --- a/packages/flutter/lib/src/material/text_theme.dart +++ b/packages/flutter/lib/src/material/text_theme.dart @@ -476,7 +476,7 @@ class TextTheme extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 087a183ccc..5281031041 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -1816,7 +1816,7 @@ class VisualDensity extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } diff --git a/packages/flutter/lib/src/material/time.dart b/packages/flutter/lib/src/material/time.dart index c7e7243182..2d93b8946d 100644 --- a/packages/flutter/lib/src/material/time.dart +++ b/packages/flutter/lib/src/material/time.dart @@ -112,7 +112,7 @@ class TimeOfDay { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is TimeOfDay && other.hour == hour && other.minute == minute; diff --git a/packages/flutter/lib/src/painting/_network_image_io.dart b/packages/flutter/lib/src/painting/_network_image_io.dart index 574188f65a..2c20305c71 100644 --- a/packages/flutter/lib/src/painting/_network_image_io.dart +++ b/packages/flutter/lib/src/painting/_network_image_io.dart @@ -108,7 +108,7 @@ class NetworkImage extends image_provider.ImageProvider(other.borders, borders); diff --git a/packages/flutter/lib/src/painting/box_border.dart b/packages/flutter/lib/src/painting/box_border.dart index 30b425b642..8dc27ca139 100644 --- a/packages/flutter/lib/src/painting/box_border.dart +++ b/packages/flutter/lib/src/painting/box_border.dart @@ -527,10 +527,10 @@ class Border extends BoxBorder { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is Border && other.top == top @@ -831,10 +831,10 @@ class BorderDirectional extends BoxBorder { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is BorderDirectional && other.top == top diff --git a/packages/flutter/lib/src/painting/box_decoration.dart b/packages/flutter/lib/src/painting/box_decoration.dart index afbd20c5bf..e966dc2d5e 100644 --- a/packages/flutter/lib/src/painting/box_decoration.dart +++ b/packages/flutter/lib/src/painting/box_decoration.dart @@ -309,10 +309,10 @@ class BoxDecoration extends Decoration { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is BoxDecoration && other.color == color diff --git a/packages/flutter/lib/src/painting/box_shadow.dart b/packages/flutter/lib/src/painting/box_shadow.dart index e3d3ea3d8b..947b9b003c 100644 --- a/packages/flutter/lib/src/painting/box_shadow.dart +++ b/packages/flutter/lib/src/painting/box_shadow.dart @@ -113,10 +113,10 @@ class BoxShadow extends ui.Shadow { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is BoxShadow && other.color == color diff --git a/packages/flutter/lib/src/painting/circle_border.dart b/packages/flutter/lib/src/painting/circle_border.dart index 1ecefbfdb1..bb0c8f31ec 100644 --- a/packages/flutter/lib/src/painting/circle_border.dart +++ b/packages/flutter/lib/src/painting/circle_border.dart @@ -81,8 +81,8 @@ class CircleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is CircleBorder && other.side == side; diff --git a/packages/flutter/lib/src/painting/colors.dart b/packages/flutter/lib/src/painting/colors.dart index 98fea46e41..ccb7c4c0c7 100644 --- a/packages/flutter/lib/src/painting/colors.dart +++ b/packages/flutter/lib/src/painting/colors.dart @@ -214,7 +214,7 @@ class HSVColor { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is HSVColor @@ -398,7 +398,7 @@ class HSLColor { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is HSLColor @@ -441,7 +441,7 @@ class ColorSwatch extends Color { Color operator [](T index) => _swatch[index]; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/painting/continuous_rectangle_border.dart b/packages/flutter/lib/src/painting/continuous_rectangle_border.dart index 20ba150551..38fbd67608 100644 --- a/packages/flutter/lib/src/painting/continuous_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/continuous_rectangle_border.dart @@ -148,8 +148,8 @@ class ContinuousRectangleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is ContinuousRectangleBorder && other.side == side diff --git a/packages/flutter/lib/src/painting/decoration_image.dart b/packages/flutter/lib/src/painting/decoration_image.dart index e7dfe173c7..6f2e89ba22 100644 --- a/packages/flutter/lib/src/painting/decoration_image.dart +++ b/packages/flutter/lib/src/painting/decoration_image.dart @@ -136,10 +136,10 @@ class DecorationImage { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is DecorationImage && other.image == image diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart index ac331a3038..8e508ceaf7 100644 --- a/packages/flutter/lib/src/painting/edge_insets.dart +++ b/packages/flutter/lib/src/painting/edge_insets.dart @@ -279,7 +279,7 @@ abstract class EdgeInsetsGeometry { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is EdgeInsetsGeometry && other._left == _left && other._right == _right diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index 59b9da4824..bc783fb504 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -206,7 +206,7 @@ class FlutterLogoDecoration extends Decoration { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { assert(debugAssertIsValid()); if (identical(this, other)) return true; diff --git a/packages/flutter/lib/src/painting/gradient.dart b/packages/flutter/lib/src/painting/gradient.dart index db5c2815cd..6d1ecb31c3 100644 --- a/packages/flutter/lib/src/painting/gradient.dart +++ b/packages/flutter/lib/src/painting/gradient.dart @@ -493,10 +493,10 @@ class LinearGradient extends Gradient { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is LinearGradient && other.begin == begin @@ -753,10 +753,10 @@ class RadialGradient extends Gradient { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is RadialGradient && other.center == center @@ -999,10 +999,10 @@ class SweepGradient extends Gradient { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is SweepGradient && other.center == center diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index 1c51cc4236..3c0672aa7c 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -91,7 +91,7 @@ class ImageConfiguration { static const ImageConfiguration empty = ImageConfiguration(); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ImageConfiguration @@ -436,7 +436,7 @@ class AssetBundleImageKey { final double scale; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is AssetBundleImageKey @@ -654,7 +654,7 @@ class FileImage extends ImageProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is FileImage @@ -715,7 +715,7 @@ class MemoryImage extends ImageProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is MemoryImage @@ -852,7 +852,7 @@ class ExactAssetImage extends AssetBundleImageProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ExactAssetImage diff --git a/packages/flutter/lib/src/painting/image_resolution.dart b/packages/flutter/lib/src/painting/image_resolution.dart index 17e6eb811e..66ebf36278 100644 --- a/packages/flutter/lib/src/painting/image_resolution.dart +++ b/packages/flutter/lib/src/painting/image_resolution.dart @@ -277,7 +277,7 @@ class AssetImage extends AssetBundleImageProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is AssetImage diff --git a/packages/flutter/lib/src/painting/image_stream.dart b/packages/flutter/lib/src/painting/image_stream.dart index 4b062f99c0..79d257dd0e 100644 --- a/packages/flutter/lib/src/painting/image_stream.dart +++ b/packages/flutter/lib/src/painting/image_stream.dart @@ -116,7 +116,7 @@ class ImageStreamListener { int get hashCode => hashValues(onImage, onChunk, onError); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ImageStreamListener diff --git a/packages/flutter/lib/src/painting/inline_span.dart b/packages/flutter/lib/src/painting/inline_span.dart index 90cd399954..fa959d6f32 100644 --- a/packages/flutter/lib/src/painting/inline_span.dart +++ b/packages/flutter/lib/src/painting/inline_span.dart @@ -84,11 +84,12 @@ class InlineSpanSemanticsInformation { final bool requiresOwnNode; @override - bool operator ==(dynamic other) { - if (other is! InlineSpanSemanticsInformation) { - return false; - } - return other.text == text && other.semanticsLabel == semanticsLabel && other.recognizer == recognizer && other.isPlaceholder == isPlaceholder; + bool operator ==(Object other) { + return other is InlineSpanSemanticsInformation + && other.text == text + && other.semanticsLabel == semanticsLabel + && other.recognizer == recognizer + && other.isPlaceholder == isPlaceholder; } @override @@ -354,7 +355,7 @@ abstract class InlineSpan extends DiagnosticableTree { RenderComparison compareTo(InlineSpan other); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart index fcd388ac94..e90edffb30 100644 --- a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart @@ -123,8 +123,8 @@ class RoundedRectangleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is RoundedRectangleBorder && other.side == side @@ -283,8 +283,8 @@ class _RoundedRectangleToCircleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is _RoundedRectangleToCircleBorder && other.side == side diff --git a/packages/flutter/lib/src/painting/shape_decoration.dart b/packages/flutter/lib/src/painting/shape_decoration.dart index 5e0fcac3dd..6237e461e3 100644 --- a/packages/flutter/lib/src/painting/shape_decoration.dart +++ b/packages/flutter/lib/src/painting/shape_decoration.dart @@ -246,10 +246,10 @@ class ShapeDecoration extends Decoration { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is ShapeDecoration && other.color == color diff --git a/packages/flutter/lib/src/painting/stadium_border.dart b/packages/flutter/lib/src/painting/stadium_border.dart index 77b69d38fa..a1c63fe9d1 100644 --- a/packages/flutter/lib/src/painting/stadium_border.dart +++ b/packages/flutter/lib/src/painting/stadium_border.dart @@ -110,8 +110,8 @@ class StadiumBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is StadiumBorder && other.side == side; @@ -257,8 +257,8 @@ class _StadiumToCircleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is _StadiumToCircleBorder && other.side == side @@ -399,8 +399,8 @@ class _StadiumToRoundedRectangleBorder extends ShapeBorder { } @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is _StadiumToRoundedRectangleBorder && other.side == side diff --git a/packages/flutter/lib/src/painting/strut_style.dart b/packages/flutter/lib/src/painting/strut_style.dart index eb085bb1a3..b156d484ea 100644 --- a/packages/flutter/lib/src/painting/strut_style.dart +++ b/packages/flutter/lib/src/painting/strut_style.dart @@ -541,7 +541,7 @@ class StrutStyle extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart index 5bd5e3f097..91f8d80ff0 100644 --- a/packages/flutter/lib/src/painting/text_span.dart +++ b/packages/flutter/lib/src/painting/text_span.dart @@ -416,7 +416,7 @@ class TextSpan extends InlineSpan { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 19dd904442..f6ac991626 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -1139,7 +1139,7 @@ class TextStyle extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 47d6fd18c6..2edc25a11b 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -581,11 +581,11 @@ class BoxConstraints extends Constraints { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { assert(debugAssertIsValid()); if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; assert(other is BoxConstraints && other.debugAssertIsValid()); return other is BoxConstraints @@ -855,7 +855,7 @@ class _IntrinsicDimensionsCacheEntry { final double argument; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is _IntrinsicDimensionsCacheEntry && other.dimension == dimension && other.argument == argument; diff --git a/packages/flutter/lib/src/rendering/sliver.dart b/packages/flutter/lib/src/rendering/sliver.dart index a53d948164..a6b775cc1e 100644 --- a/packages/flutter/lib/src/rendering/sliver.dart +++ b/packages/flutter/lib/src/rendering/sliver.dart @@ -466,7 +466,7 @@ class SliverConstraints extends Constraints { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other is! SliverConstraints) diff --git a/packages/flutter/lib/src/rendering/stack.dart b/packages/flutter/lib/src/rendering/stack.dart index 75f334f01e..502588b095 100644 --- a/packages/flutter/lib/src/rendering/stack.dart +++ b/packages/flutter/lib/src/rendering/stack.dart @@ -151,7 +151,7 @@ class RelativeRect { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is RelativeRect diff --git a/packages/flutter/lib/src/rendering/table_border.dart b/packages/flutter/lib/src/rendering/table_border.dart index 7fa011862a..bb1ec1f033 100644 --- a/packages/flutter/lib/src/rendering/table_border.dart +++ b/packages/flutter/lib/src/rendering/table_border.dart @@ -260,10 +260,10 @@ class TableBorder { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; - if (runtimeType != other.runtimeType) + if (other.runtimeType != runtimeType) return false; return other is TableBorder && other.top == top diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index 6447128af2..904e35a6cb 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -126,7 +126,7 @@ class CustomSemanticsAction { int get hashCode => ui.hashValues(label, hint, action); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is CustomSemanticsAction @@ -421,7 +421,7 @@ class SemanticsData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is SemanticsData && other.flags == flags && other.actions == actions @@ -559,7 +559,7 @@ class SemanticsHintOverrides extends DiagnosticableTree { int get hashCode => ui.hashValues(onTapHint, onLongPressHint); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is SemanticsHintOverrides diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index f70d9d3b09..3b95679e84 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -167,7 +167,7 @@ class LogicalKeyboardKey extends KeyboardKey { int get hashCode => keyId.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } @@ -2069,7 +2069,7 @@ class PhysicalKeyboardKey extends KeyboardKey { int get hashCode => usbHidUsage.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } diff --git a/packages/flutter/lib/src/services/raw_keyboard.dart b/packages/flutter/lib/src/services/raw_keyboard.dart index 3a841c0712..60bceaca8d 100644 --- a/packages/flutter/lib/src/services/raw_keyboard.dart +++ b/packages/flutter/lib/src/services/raw_keyboard.dart @@ -618,10 +618,12 @@ class _ModifierSidePair extends Object { final KeyboardSide side; @override - bool operator ==(dynamic other) { - return runtimeType == other.runtimeType - && modifier == other.modifier - && side == other.side; + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) + return false; + return other is _ModifierSidePair + && other.modifier == modifier + && other.side == side; } @override diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index 2cef6cd2d6..bf60574b5e 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -193,7 +193,7 @@ class SystemUiOverlayStyle { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is SystemUiOverlayStyle diff --git a/packages/flutter/lib/src/services/text_editing.dart b/packages/flutter/lib/src/services/text_editing.dart index 9b10271802..abd9d8cc7a 100644 --- a/packages/flutter/lib/src/services/text_editing.dart +++ b/packages/flutter/lib/src/services/text_editing.dart @@ -98,7 +98,7 @@ class TextSelection extends TextRange { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is TextSelection diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index fac229b6a6..cbcfd1daf5 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -189,7 +189,7 @@ class TextInputType { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is TextInputType && other.index == index && other.signed == signed @@ -688,7 +688,7 @@ class TextEditingValue { String toString() => '$runtimeType(text: \u2524$text\u251C, selection: $selection, composing: $composing)'; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is TextEditingValue diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart index 71454b180b..acfdafa76e 100644 --- a/packages/flutter/lib/src/widgets/async.dart +++ b/packages/flutter/lib/src/widgets/async.dart @@ -265,7 +265,7 @@ class AsyncSnapshot { String toString() => '$runtimeType($connectionState, $data, $error)'; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is AsyncSnapshot diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index cf8eb5d3bc..1179cf6bfb 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -73,7 +73,7 @@ class ObjectKey extends LocalKey { final Object value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ObjectKey @@ -325,7 +325,7 @@ class GlobalObjectKey> extends GlobalKey { final Object value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is GlobalObjectKey @@ -453,7 +453,7 @@ abstract class Widget extends DiagnosticableTree { @override @nonVirtual - bool operator ==(dynamic other) => super==other; + bool operator ==(Object other) => super == other; @override @nonVirtual diff --git a/packages/flutter/lib/src/widgets/icon_data.dart b/packages/flutter/lib/src/widgets/icon_data.dart index 0321d73fcc..ef390df568 100644 --- a/packages/flutter/lib/src/widgets/icon_data.dart +++ b/packages/flutter/lib/src/widgets/icon_data.dart @@ -50,8 +50,8 @@ class IconData { final bool matchTextDirection; @override - bool operator ==(dynamic other) { - if (runtimeType != other.runtimeType) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is IconData && other.codePoint == codePoint diff --git a/packages/flutter/lib/src/widgets/icon_theme_data.dart b/packages/flutter/lib/src/widgets/icon_theme_data.dart index 06da4ea539..f4b25cd645 100644 --- a/packages/flutter/lib/src/widgets/icon_theme_data.dart +++ b/packages/flutter/lib/src/widgets/icon_theme_data.dart @@ -100,7 +100,7 @@ class IconThemeData extends Diagnosticable { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is IconThemeData diff --git a/packages/flutter/lib/src/widgets/page_storage.dart b/packages/flutter/lib/src/widgets/page_storage.dart index 137c55ae6d..eab078de43 100644 --- a/packages/flutter/lib/src/widgets/page_storage.dart +++ b/packages/flutter/lib/src/widgets/page_storage.dart @@ -47,7 +47,7 @@ class _StorageEntryIdentifier { bool get isNotEmpty => keys.isNotEmpty; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is _StorageEntryIdentifier diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index d113c750e9..4d021afd80 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -2435,7 +2435,7 @@ class _TransformedRect { final Matrix4 transform; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is _TransformedRect @@ -2467,7 +2467,7 @@ class _InspectorOverlayRenderState { final TextDirection textDirection; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is _InspectorOverlayRenderState diff --git a/packages/flutter/lib/src/widgets/widget_span.dart b/packages/flutter/lib/src/widgets/widget_span.dart index ad3407611e..f1b89eab00 100644 --- a/packages/flutter/lib/src/widgets/widget_span.dart +++ b/packages/flutter/lib/src/widgets/widget_span.dart @@ -164,7 +164,7 @@ class WidgetSpan extends PlaceholderSpan { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) diff --git a/packages/flutter/test/services/fake_platform_views.dart b/packages/flutter/test/services/fake_platform_views.dart index 02957cf555..c08d359a9b 100644 --- a/packages/flutter/test/services/fake_platform_views.dart +++ b/packages/flutter/test/services/fake_platform_views.dart @@ -387,8 +387,8 @@ class FakeAndroidPlatformView { int layoutDirection; @override - bool operator ==(dynamic other) { - if (other.runtimeType != FakeAndroidPlatformView) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is FakeAndroidPlatformView && other.id == id @@ -415,9 +415,7 @@ class FakeAndroidMotionEvent { @override - bool operator ==(dynamic other) { - if (other is! FakeAndroidMotionEvent) - return false; + bool operator ==(Object other) { return other is FakeAndroidMotionEvent && listEquals(other.pointerIds, pointerIds) && other.action == action @@ -441,8 +439,8 @@ class FakeUiKitView { final Uint8List creationParams; @override - bool operator ==(dynamic other) { - if (other.runtimeType != FakeUiKitView) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is FakeUiKitView && other.id == id @@ -466,8 +464,8 @@ class FakeHtmlPlatformView { final String type; @override - bool operator ==(dynamic other) { - if (other.runtimeType != FakeHtmlPlatformView) + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; return other is FakeHtmlPlatformView && other.id == id diff --git a/packages/flutter/test/widgets/key_test.dart b/packages/flutter/test/widgets/key_test.dart index 3dc59e3449..6989b8c0b1 100644 --- a/packages/flutter/test/widgets/key_test.dart +++ b/packages/flutter/test/widgets/key_test.dart @@ -12,7 +12,7 @@ class TestValueKey extends ValueKey { class NotEquals { const NotEquals(); @override - bool operator ==(dynamic other) => false; + bool operator ==(Object other) => false; @override int get hashCode => 0; } diff --git a/packages/flutter_driver/lib/src/driver/driver.dart b/packages/flutter_driver/lib/src/driver/driver.dart index 41938f91a6..cf12cab2b5 100644 --- a/packages/flutter_driver/lib/src/driver/driver.dart +++ b/packages/flutter_driver/lib/src/driver/driver.dart @@ -751,7 +751,7 @@ class DriverOffset { String toString() => '$runtimeType($dx, $dy)'; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is DriverOffset && other.dx == dx && other.dy == dy; diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart index 79af061981..4fe0e99773 100644 --- a/packages/flutter_test/test/matchers_test.dart +++ b/packages/flutter_test/test/matchers_test.dart @@ -709,7 +709,7 @@ class _CustomColor extends Color { bool isEqual; @override - bool operator ==(dynamic other) => isEqual ?? super == other; + bool operator ==(Object other) => isEqual ?? super == other; @override int get hashCode => hashValues(super.hashCode, isEqual); diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index d1a47064a8..79b06949f0 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -283,7 +283,7 @@ class _Asset { String toString() => 'asset: $entryUri'; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(other, this)) { return true; } diff --git a/packages/flutter_tools/lib/src/base/fingerprint.dart b/packages/flutter_tools/lib/src/base/fingerprint.dart index 9ef80c7380..45549ea8a4 100644 --- a/packages/flutter_tools/lib/src/base/fingerprint.dart +++ b/packages/flutter_tools/lib/src/base/fingerprint.dart @@ -140,7 +140,7 @@ class Fingerprint { }); @override - bool operator==(dynamic other) { + bool operator==(Object other) { if (identical(other, this)) { return true; } diff --git a/packages/flutter_tools/lib/src/base/version.dart b/packages/flutter_tools/lib/src/base/version.dart index e89772c463..04a91fe3c7 100644 --- a/packages/flutter_tools/lib/src/base/version.dart +++ b/packages/flutter_tools/lib/src/base/version.dart @@ -84,11 +84,11 @@ class Version implements Comparable { /// Two [Version]s are equal if their version numbers are. The version text /// is ignored. @override - bool operator ==(dynamic other) { - if (other is! Version) { - return false; - } - return major == other.major && minor == other.minor && patch == other.patch; + bool operator ==(Object other) { + return other is Version + && other.major == major + && other.minor == minor + && other.patch == patch; } @override diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 9109845151..debd75a5b5 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -440,14 +440,12 @@ abstract class Device { int get hashCode => id.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! Device) { - return false; - } - return id == other.id; + return other is Device + && other.id == id; } @override diff --git a/packages/flutter_tools/lib/src/emulator.dart b/packages/flutter_tools/lib/src/emulator.dart index 3cfcac6048..7a9141014f 100644 --- a/packages/flutter_tools/lib/src/emulator.dart +++ b/packages/flutter_tools/lib/src/emulator.dart @@ -228,14 +228,12 @@ abstract class Emulator { int get hashCode => id.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! Emulator) { - return false; - } - return id == other.id; + return other is Emulator + && other.id == id; } Future launch();