From 2c1bcdbd931bf9b0282a237496b29a33a14e11a2 Mon Sep 17 00:00:00 2001 From: Kuloud Date: Wed, 20 Mar 2024 18:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=20'=3D=3D'=20operators=20sho?= =?UTF-8?q?uld=20be=20non-nullable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/types/camera.dart | 4 ++-- lib/src/types/ui.dart | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/types/camera.dart b/lib/src/types/camera.dart index eff3b3c..ebb148d 100644 --- a/lib/src/types/camera.dart +++ b/lib/src/types/camera.dart @@ -54,10 +54,10 @@ class CameraPosition { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) return false; - final CameraPosition typedOther = other; + final CameraPosition typedOther = other as CameraPosition; return bearing == typedOther.bearing && target == typedOther.target && tilt == typedOther.tilt && diff --git a/lib/src/types/ui.dart b/lib/src/types/ui.dart index b96b02f..7ba0d8a 100644 --- a/lib/src/types/ui.dart +++ b/lib/src/types/ui.dart @@ -40,10 +40,10 @@ class CameraTargetBounds { dynamic toJson() => [bounds?.toJson()]; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) return false; - final CameraTargetBounds typedOther = other; + final CameraTargetBounds typedOther = other as CameraTargetBounds; return bounds == typedOther.bounds; } @@ -86,10 +86,10 @@ class MinMaxZoomPreference { dynamic toJson() => [minZoom, maxZoom]; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) return false; - final MinMaxZoomPreference typedOther = other; + final MinMaxZoomPreference typedOther = other as MinMaxZoomPreference; return minZoom == typedOther.minZoom && maxZoom == typedOther.maxZoom; }