Skip to content

Commit

Permalink
Isolate support (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
saibotma authored Jul 1, 2024
1 parent 9ac8cda commit 8fbb87d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/src/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@ class Location {

@override
String toString() => name;

// Override equals and hashCode to support comparing
// Locations created in different isolates.

@override
bool operator ==(Object other) {
return identical(this, other) ||
other is Location &&
runtimeType == other.runtimeType &&
name == other.name;
}

@override
int get hashCode {
return name.hashCode;
}
}

/// A [TimeZone] represents a single time zone such as CEST or CET.
Expand Down

0 comments on commit 8fbb87d

Please sign in to comment.