Skip to content

Commit

Permalink
fix operator==
Browse files Browse the repository at this point in the history
  • Loading branch information
guidezpl committed Feb 6, 2024
1 parent e32cc8e commit 559da1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/google_fonts/lib/src/google_fonts_variant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ class GoogleFontsVariant {
int get hashCode => Object.hash(fontWeight, fontStyle);

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other.runtimeType != runtimeType) {
return false;
}
return other.fontWeight == fontWeight && other.fontStyle == fontStyle;
return other is GoogleFontsVariant &&
other.fontWeight == fontWeight &&
other.fontStyle == fontStyle;
}
}

Expand Down

0 comments on commit 559da1b

Please sign in to comment.