mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
push ac function state selection
This commit is contained in:
54
lib/pages/routiens/bloc/routine_bloc/routine_state.dart
Normal file
54
lib/pages/routiens/bloc/routine_bloc/routine_state.dart
Normal file
@ -0,0 +1,54 @@
|
||||
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 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,
|
||||
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,
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user