forked from Nexus/nexus
add GomuksEvent model
This commit is contained in:
parent
b4d5a632dd
commit
b154b4ee2e
1 changed files with 114 additions and 93 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/models/space_edge.dart";
|
||||
import "package:nexus/models/sync_data.dart";
|
||||
|
||||
class SpaceEdgesController extends Notifier<IMap<String, IList<SpaceEdge>>> {
|
||||
@override
|
||||
IMap<String, IList<SpaceEdge>> build() => .new();
|
||||
|
||||
void set(IMap<String, IList<SpaceEdge>> newEdges) =>
|
||||
state = state.addAll(newEdges);
|
||||
void handleSync(SyncData sync) => state = sync.spaceEdges ?? state;
|
||||
|
||||
static final provider =
|
||||
NotifierProvider<SpaceEdgesController, IMap<String, IList<SpaceEdge>>>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue