forked from Nexus/nexus
Now this feature is stable, we should use it. I might have missed some usecases, but these can be added in future commits.
16 lines
568 B
Dart
16 lines
568 B
Dart
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
|
import "package:nexus/models/space_edge.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);
|
|
|
|
static final provider =
|
|
NotifierProvider<SpaceEdgesController, IMap<String, IList<SpaceEdge>>>(
|
|
SpaceEdgesController.new,
|
|
);
|
|
}
|