add GomuksEvent model
This commit is contained in:
parent
b4d5a632dd
commit
b154b4ee2e
1 changed files with 114 additions and 93 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/models/sync_data.dart";
|
||||
import "package:nexus/models/typing.dart";
|
||||
|
||||
class TypingController extends Notifier<IMap<String, IList<String>>> {
|
||||
|
|
@ -8,6 +9,10 @@ class TypingController extends Notifier<IMap<String, IList<String>>> {
|
|||
|
||||
void set(Typing typing) => state = state.add(typing.roomId, typing.userIds);
|
||||
|
||||
void handleSync(SyncData sync) {
|
||||
if (sync.clearState) state = .new();
|
||||
}
|
||||
|
||||
static final provider =
|
||||
NotifierProvider<TypingController, IMap<String, IList<String>>>(
|
||||
TypingController.new,
|
||||
|
|
|
|||
Loading…
Reference in a new issue