mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
part of 'routine_bloc.dart';
|
|
|
|
class RoutineState extends Equatable {
|
|
final List<Map<String, dynamic>> ifItems;
|
|
final List<Map<String, dynamic>> thenItems;
|
|
final List<Map<String, String>> availableCards;
|
|
final List<ScenesModel> scenes;
|
|
final List<ScenesModel> automations;
|
|
final Map<String, List<DeviceFunctionData>> selectedFunctions;
|
|
final bool isLoading;
|
|
final String? errorMessage;
|
|
|
|
const RoutineState({
|
|
this.ifItems = const [],
|
|
this.thenItems = const [],
|
|
this.availableCards = const [],
|
|
this.scenes = const [],
|
|
this.automations = const [],
|
|
this.selectedFunctions = const {},
|
|
this.isLoading = false,
|
|
this.errorMessage,
|
|
});
|
|
|
|
RoutineState copyWith({
|
|
List<Map<String, dynamic>>? ifItems,
|
|
List<Map<String, dynamic>>? thenItems,
|
|
List<ScenesModel>? scenes,
|
|
List<ScenesModel>? automations,
|
|
Map<String, List<DeviceFunctionData>>? selectedFunctions,
|
|
bool? isLoading,
|
|
String? errorMessage,
|
|
}) {
|
|
return RoutineState(
|
|
ifItems: ifItems ?? this.ifItems,
|
|
thenItems: thenItems ?? this.thenItems,
|
|
scenes: scenes ?? this.scenes,
|
|
automations: automations ?? this.automations,
|
|
selectedFunctions: selectedFunctions ?? this.selectedFunctions,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
errorMessage: errorMessage ?? this.errorMessage,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
ifItems,
|
|
thenItems,
|
|
scenes,
|
|
automations,
|
|
selectedFunctions,
|
|
isLoading,
|
|
errorMessage,
|
|
];
|
|
}
|