Skip to content

Commit e14d8d0

Browse files
authored
Make operator == override parameters non-nullable (#677)
* Make operator == override parameters no-nullable. See dart-lang/linter#3441 Work towards dart-lang/sdk#51038.
1 parent dd4ac5b commit e14d8d0

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/reactive_ble_platform_interface/lib/src/model/discovered_characteristic.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class DiscoveredCharacteristic {
3838
(((17 * 37) + characteristicId.hashCode) * 37 + serviceId.hashCode) * 37;
3939

4040
@override
41-
bool operator ==(dynamic other) =>
41+
bool operator ==(Object other) =>
42+
other is DiscoveredCharacteristic &&
4243
runtimeType == other.runtimeType &&
4344
characteristicId == other.characteristicId &&
4445
serviceId == other.serviceId;

packages/reactive_ble_platform_interface/lib/src/model/qualified_characteristic.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class QualifiedCharacteristic {
3131
deviceId.hashCode;
3232

3333
@override
34-
bool operator ==(dynamic other) =>
34+
bool operator ==(Object other) =>
35+
other is QualifiedCharacteristic &&
3536
runtimeType == other.runtimeType &&
3637
characteristicId == other.characteristicId &&
3738
serviceId == other.serviceId &&

packages/reactive_ble_platform_interface/lib/src/model/unit.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Unit {
55
const Unit();
66

77
@override
8-
bool operator ==(dynamic other) => other.runtimeType == runtimeType;
8+
bool operator ==(Object other) => other.runtimeType == runtimeType;
99

1010
@override
1111
int get hashCode => 1;

packages/reactive_ble_platform_interface/lib/src/model/uuid.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ class Uuid {
6868
data.fold(17, (hash, octet) => 37 * hash + octet.hashCode);
6969

7070
@override
71-
bool operator ==(dynamic other) =>
71+
bool operator ==(Object other) =>
72+
other is Uuid &&
7273
other.runtimeType == runtimeType &&
7374
const DeepCollectionEquality().equals(other.data, data);
7475
}

0 commit comments

Comments
 (0)