From 559da1b6cba2cbc1e750b6fcba460872fbf2a97e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Tue, 6 Feb 2024 18:14:03 -0500 Subject: [PATCH] fix operator== --- packages/google_fonts/lib/src/google_fonts_variant.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google_fonts/lib/src/google_fonts_variant.dart b/packages/google_fonts/lib/src/google_fonts_variant.dart index 7a4e7724..abb3db14 100644 --- a/packages/google_fonts/lib/src/google_fonts_variant.dart +++ b/packages/google_fonts/lib/src/google_fonts_variant.dart @@ -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; } }