- Add Control Room page with stacks sidebar and containers list - Implement container actions (start/stop/restart) with snackbars - Add container logs viewer dialog - Add search/filter for both stacks and containers lists - Add external links for Portainer and Netdata (url_launcher) - Add VS Code launch configuration for Flutter web debugging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
836 B
Dart
36 lines
836 B
Dart
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
import '../../data/repositories/stack_repository_impl.dart';
|
|
import '../../domain/entities/stack.dart';
|
|
|
|
part 'stacks_provider.g.dart';
|
|
|
|
/// Provides the list of all stacks.
|
|
@riverpod
|
|
Future<List<Stack>> stacks(StacksRef ref) async {
|
|
final repository = ref.watch(stackRepositoryProvider);
|
|
return repository.getStacks();
|
|
}
|
|
|
|
/// Provides a single stack by ID.
|
|
@riverpod
|
|
Future<Stack> stack(StackRef ref, String id) async {
|
|
final repository = ref.watch(stackRepositoryProvider);
|
|
return repository.getStack(id);
|
|
}
|
|
|
|
/// Currently selected stack ID (null = all containers).
|
|
@riverpod
|
|
class SelectedStack extends _$SelectedStack {
|
|
@override
|
|
String? build() => null;
|
|
|
|
void select(String? stackId) {
|
|
state = stackId;
|
|
}
|
|
|
|
void clear() {
|
|
state = null;
|
|
}
|
|
}
|