feat: implement tag CRUD UI
This commit is contained in:
@@ -145,6 +145,19 @@ final sensorProvider =
|
||||
return ref.watch(sensorRepositoryProvider).getSensor(id);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tag data
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
final tagsProvider = FutureProvider.autoDispose<List<Tag>>((ref) {
|
||||
return ref.watch(tagRepositoryProvider).getTags();
|
||||
});
|
||||
|
||||
final tagProvider =
|
||||
FutureProvider.autoDispose.family<Tag, int>((ref, id) {
|
||||
return ref.watch(tagRepositoryProvider).getTag(id);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Cross-tab UI state
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -171,6 +184,12 @@ final tagPositionsProvider = StreamProvider<List<TagPosition>>((ref) {
|
||||
return repo.watchPositions();
|
||||
});
|
||||
|
||||
/// Accumulated room occupancy: room_id → [tag_id, ...].
|
||||
/// Updated incrementally as `occupancy_changed` events arrive on rooms:occupancy.
|
||||
final roomOccupancyProvider = StreamProvider<Map<int, List<String>>>((ref) {
|
||||
return ref.watch(tagRepositoryProvider).watchRoomOccupancy();
|
||||
});
|
||||
|
||||
final particleCloudProvider = StreamProvider<List<Particle>>((ref) {
|
||||
final repo = ref.watch(tagRepositoryProvider);
|
||||
return repo.watchParticleCloud();
|
||||
|
||||
Reference in New Issue
Block a user