Flutter web app replacing legacy WPF CCTV surveillance keyboard controller. Includes wall overview, section view with monitor grid, camera input, PTZ control, alarm/lock/sequence BLoCs, and legacy-matching UI styling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
952 B
Dart
38 lines
952 B
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class CameraState extends Equatable {
|
|
final int? selectedCameraId;
|
|
final bool isConnecting;
|
|
final String? error;
|
|
final List<int> availableCameras;
|
|
|
|
const CameraState({
|
|
this.selectedCameraId,
|
|
this.isConnecting = false,
|
|
this.error,
|
|
this.availableCameras = const [],
|
|
});
|
|
|
|
bool get hasSelection => selectedCameraId != null;
|
|
|
|
CameraState copyWith({
|
|
int? selectedCameraId,
|
|
bool? isConnecting,
|
|
String? error,
|
|
List<int>? availableCameras,
|
|
bool clearSelection = false,
|
|
}) {
|
|
return CameraState(
|
|
selectedCameraId:
|
|
clearSelection ? null : (selectedCameraId ?? this.selectedCameraId),
|
|
isConnecting: isConnecting ?? this.isConnecting,
|
|
error: error,
|
|
availableCameras: availableCameras ?? this.availableCameras,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props =>
|
|
[selectedCameraId, isConnecting, error, availableCameras];
|
|
}
|