Splash screen loading

This commit is contained in:
2025-03-22 16:36:10 +08:00
parent 7052b5b635
commit 71b41d470a
11 changed files with 305 additions and 51 deletions

View File

@ -28,6 +28,19 @@ class ChatChannelProvider extends ChangeNotifier {
_rels = context.read<SnRealmProvider>();
}
final List<SnChannel> _availableChannels = List.empty(growable: true);
List<SnChannel> get availableChannels => _availableChannels;
Future<void> refreshAvailableChannels() async {
final stream = fetchChannels();
stream.listen((ele) {
_availableChannels.clear();
_availableChannels.addAll(ele);
notifyListeners();
});
}
Future<void> _saveChannelToLocal(Iterable<SnChannel> channels) async {
await Future.wait(
channels.map(