diff --git a/moor/lib/src/runtime/data_class.dart b/moor/lib/src/runtime/data_class.dart index 1dcd45b6..17d6999b 100644 --- a/moor/lib/src/runtime/data_class.dart +++ b/moor/lib/src/runtime/data_class.dart @@ -125,6 +125,17 @@ class Value { @override String toString() => present ? 'Value($value)' : 'Value.absent()'; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Value && + runtimeType == other.runtimeType && + present == other.present && + value == other.value; + + @override + int get hashCode => present.hashCode ^ value.hashCode; } /// Serializer responsible for mapping atomic types from and to json.