@@ -172,26 +172,6 @@ abstract class GlobalStore extends ChangeNotifier {
172
172
String toString () => '${objectRuntimeType (this , 'GlobalStore' )}#${shortHash (this )}' ;
173
173
}
174
174
175
- /// A wrapper class for `Map<K, V>` .
176
- ///
177
- /// This can be listened to for any modifications done to `Map<K, V>` .
178
- class MapNotifier <K , V > extends ValueNotifier <Map <K , V >> {
179
- MapNotifier (super ._value);
180
-
181
- Iterable <V > get values => value.values;
182
-
183
- V ? operator [](Object ? key) => value[key];
184
-
185
- void operator []= (K key, V value) {
186
- this .value[key] = value;
187
- notifyListeners ();
188
- }
189
-
190
- V ? remove (Object ? key) {
191
- return value.remove (key);
192
- }
193
- }
194
-
195
175
/// Store for the user's data for a given Zulip account.
196
176
///
197
177
/// This should always have a consistent snapshot of the state on the server,
@@ -256,15 +236,14 @@ class PerAccountStore extends ChangeNotifier with StreamStore {
256
236
required this .accountId,
257
237
required this .selfUserId,
258
238
required this .userSettings,
259
- required Map < int , User > users,
239
+ required this . users,
260
240
required streams,
261
241
required this .unreads,
262
242
required this .recentDmConversationsView,
263
243
}) : assert (selfUserId == globalStore.getAccount (accountId)! .userId),
264
244
assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
265
245
assert (realmUrl == connection.realmUrl),
266
246
_globalStore = globalStore,
267
- users = MapNotifier (users),
268
247
_streams = streams;
269
248
270
249
////////////////////////////////////////////////////////////////
@@ -307,7 +286,7 @@ class PerAccountStore extends ChangeNotifier with StreamStore {
307
286
////////////////////////////////
308
287
// Users and data about them.
309
288
310
- final MapNotifier <int , User > users;
289
+ final Map <int , User > users;
311
290
312
291
final RecentSenders recentSenders = RecentSenders ();
313
292
0 commit comments