diff --git a/lib/src/async/observable_list.dart b/lib/src/async/observable_list.dart index 593bf30..a0da268 100644 --- a/lib/src/async/observable_list.dart +++ b/lib/src/async/observable_list.dart @@ -119,6 +119,21 @@ class ObservableList extends ListBase _list.length = value; } + @override + bool operator ==(Object other) { + if (other is ObservableList) { + return _list == other._list; + } else if (other is List) { + return _list == other; + } + return false; + } + + @override + int get hashCode { + return _list.hashCode; + } + @override E operator [](int index) => _list[index]; diff --git a/lib/src/async/observable_map.dart b/lib/src/async/observable_map.dart index 7e0be98..21ea9bd 100644 --- a/lib/src/async/observable_map.dart +++ b/lib/src/async/observable_map.dart @@ -108,6 +108,21 @@ class ObservableMap @override bool containsKey(Object? key) => _map.containsKey(key); + @override + bool operator ==(Object other) { + if (other is ObservableMap) { + return _map == other._map; + } else if (other is Map) { + return _map == other; + } + return false; + } + + @override + int get hashCode { + return _map.hashCode; + } + @override V? operator [](Object? key) => _map[key];