@@ -5,14 +5,16 @@ import 'package:flutter/foundation.dart';
55import '../api/model/events.dart' ;
66import '../api/model/initial_snapshot.dart' ;
77import '../api/model/model.dart' ;
8+ import 'store.dart' ;
9+ import 'user.dart' ;
810
911/// The portion of [PerAccountStore] for channels, topics, and stuff about them.
1012///
1113/// This type is useful for expressing the needs of other parts of the
1214/// implementation of [PerAccountStore] , to avoid circularity.
1315///
1416/// The data structures described here are implemented at [ChannelStoreImpl] .
15- mixin ChannelStore {
17+ mixin ChannelStore on UserStore {
1618 /// All known channels/streams, indexed by [ZulipStream.streamId] .
1719 ///
1820 /// The same [ZulipStream] objects also appear in [streamsByName] .
@@ -165,8 +167,11 @@ enum UserTopicVisibilityEffect {
165167/// Generally the only code that should need this class is [PerAccountStore]
166168/// itself. Other code accesses this functionality through [PerAccountStore] ,
167169/// or through the mixin [ChannelStore] which describes its interface.
168- class ChannelStoreImpl with ChannelStore {
169- factory ChannelStoreImpl ({required InitialSnapshot initialSnapshot}) {
170+ class ChannelStoreImpl extends HasUserStore with ChannelStore {
171+ factory ChannelStoreImpl ({
172+ required UserStore users,
173+ required InitialSnapshot initialSnapshot,
174+ }) {
170175 final subscriptions = Map .fromEntries (initialSnapshot.subscriptions.map (
171176 (subscription) => MapEntry (subscription.streamId, subscription)));
172177
@@ -186,6 +191,7 @@ class ChannelStoreImpl with ChannelStore {
186191 }
187192
188193 return ChannelStoreImpl ._(
194+ users: users,
189195 streams: streams,
190196 streamsByName: streams.map ((_, stream) => MapEntry (stream.name, stream)),
191197 subscriptions: subscriptions,
@@ -194,6 +200,7 @@ class ChannelStoreImpl with ChannelStore {
194200 }
195201
196202 ChannelStoreImpl ._({
203+ required super .users,
197204 required this .streams,
198205 required this .streamsByName,
199206 required this .subscriptions,
0 commit comments