feat: add Control Room with containers and stacks management
- 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>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
dd6bcbdbda
commit
3b89ed8c18
@@ -0,0 +1,62 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'data_grid_state.freezed.dart';
|
||||
|
||||
/// State for a DataGrid instance.
|
||||
@freezed
|
||||
class DataGridState<T> with _$DataGridState<T> {
|
||||
const factory DataGridState({
|
||||
/// Current items being displayed.
|
||||
@Default([]) List<T> items,
|
||||
|
||||
/// Total count of items (may differ from items.length for pagination).
|
||||
@Default(0) int totalCount,
|
||||
|
||||
/// Whether data is currently loading.
|
||||
@Default(false) bool isLoading,
|
||||
|
||||
/// Whether initial load is in progress.
|
||||
@Default(true) bool isInitialLoad,
|
||||
|
||||
/// Error that occurred during loading.
|
||||
Object? error,
|
||||
|
||||
/// Current search query.
|
||||
@Default('') String searchQuery,
|
||||
|
||||
/// Index of the column currently sorted by.
|
||||
int? sortColumnIndex,
|
||||
|
||||
/// Whether sort is descending.
|
||||
@Default(false) bool sortDescending,
|
||||
|
||||
/// Currently selected item IDs (if selectable).
|
||||
@Default({}) Set<Object> selectedIds,
|
||||
|
||||
/// Current page (for paginated mode).
|
||||
@Default(0) int currentPage,
|
||||
|
||||
/// Whether more items can be loaded (for infinite scroll).
|
||||
@Default(false) bool hasMore,
|
||||
}) = _DataGridState<T>;
|
||||
}
|
||||
|
||||
/// Extension methods for DataGridState.
|
||||
extension DataGridStateX<T> on DataGridState<T> {
|
||||
/// Whether the grid has an error.
|
||||
bool get hasError => error != null;
|
||||
|
||||
/// Whether the grid is empty (no items and not loading).
|
||||
bool get isEmpty => items.isEmpty && !isLoading && !hasError;
|
||||
|
||||
/// Whether all visible items are selected.
|
||||
bool get allSelected =>
|
||||
items.isNotEmpty && selectedIds.length == items.length;
|
||||
|
||||
/// Whether some (but not all) items are selected.
|
||||
bool get someSelected =>
|
||||
selectedIds.isNotEmpty && selectedIds.length < items.length;
|
||||
|
||||
/// Number of selected items.
|
||||
int get selectedCount => selectedIds.length;
|
||||
}
|
||||
Reference in New Issue
Block a user