Skip to content

Commit c5e1d23

Browse files
committed
realm [nfc]: Introduce RealmStore, initially vacuous
1 parent d4afa40 commit c5e1d23

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/model/realm.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import '../api/model/initial_snapshot.dart';
2+
import 'store.dart';
3+
4+
/// The portion of [PerAccountStore] for realm settings, server settings,
5+
/// and similar data about the whole realm or server.
6+
///
7+
/// See also:
8+
/// * [RealmStoreImpl] for the implementation of this that does the work.
9+
mixin RealmStore {
10+
}
11+
12+
/// The implementation of [RealmStore] that does the work.
13+
class RealmStoreImpl extends PerAccountStoreBase with RealmStore {
14+
RealmStoreImpl({
15+
required super.core,
16+
required InitialSnapshot initialSnapshot,
17+
});
18+
}

lib/model/store.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import 'localizations.dart';
2727
import 'message.dart';
2828
import 'message_list.dart';
2929
import 'presence.dart';
30+
import 'realm.dart';
3031
import 'recent_dm_conversations.dart';
3132
import 'recent_senders.dart';
3233
import 'channel.dart';
@@ -437,6 +438,7 @@ Uri? tryResolveUrl(Uri baseUrl, String reference) {
437438
class PerAccountStore extends PerAccountStoreBase with
438439
ChangeNotifier,
439440
UserGroupStore, ProxyUserGroupStore,
441+
RealmStore,
440442
EmojiStore,
441443
SavedSnippetStore,
442444
UserStore,
@@ -498,6 +500,7 @@ class PerAccountStore extends PerAccountStoreBase with
498500
realmDefaultExternalAccounts: initialSnapshot.realmDefaultExternalAccounts,
499501
customProfileFields: _sortCustomProfileFields(initialSnapshot.customProfileFields),
500502
emailAddressVisibility: initialSnapshot.emailAddressVisibility,
503+
realm: RealmStoreImpl(core: core, initialSnapshot: initialSnapshot),
501504
emoji: EmojiStoreImpl(
502505
core: core, allRealmEmoji: initialSnapshot.realmEmoji),
503506
userSettings: initialSnapshot.userSettings,
@@ -548,6 +551,7 @@ class PerAccountStore extends PerAccountStoreBase with
548551
required this.realmDefaultExternalAccounts,
549552
required this.customProfileFields,
550553
required this.emailAddressVisibility,
554+
required RealmStoreImpl realm,
551555
required EmojiStoreImpl emoji,
552556
required this.userSettings,
553557
required SavedSnippetStoreImpl savedSnippets,
@@ -562,6 +566,7 @@ class PerAccountStore extends PerAccountStoreBase with
562566
required this.recentSenders,
563567
}) : _groups = groups,
564568
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
569+
_realm = realm,
565570
_emoji = emoji,
566571
_savedSnippets = savedSnippets,
567572
_users = users,
@@ -630,6 +635,8 @@ class PerAccountStore extends PerAccountStoreBase with
630635
/// For docs, please see [InitialSnapshot.emailAddressVisibility].
631636
final EmailAddressVisibility? emailAddressVisibility; // TODO(#668): update this realm setting
632637

638+
final RealmStoreImpl _realm; // ignore: unused_field // TODO
639+
633640
////////////////////////////////
634641
// The realm's repertoire of available emoji.
635642

0 commit comments

Comments
 (0)