mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
push routine name field
This commit is contained in:
@ -31,6 +31,7 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
||||
on<ChangeAutomationOperator>(_changeOperatorOperator);
|
||||
on<EffectiveTimePeriodEvent>(_onEffectiveTimeEvent);
|
||||
on<CreateAutomationEvent>(_onCreateAutomation);
|
||||
on<SetRoutineName>(_onSetRoutineName);
|
||||
// on<RemoveFunction>(_onRemoveFunction);
|
||||
// on<ClearFunctions>(_onClearFunctions);
|
||||
}
|
||||
@ -350,4 +351,9 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
||||
EffectiveTimePeriodEvent event, Emitter<RoutineState> emit) {
|
||||
emit(state.copyWith(effectiveTime: event.effectiveTime));
|
||||
}
|
||||
|
||||
FutureOr<void> _onSetRoutineName(
|
||||
SetRoutineName event, Emitter<RoutineState> emit) {
|
||||
emit(state.copyWith(routineName: event.name));
|
||||
}
|
||||
}
|
||||
|
@ -115,4 +115,10 @@ class CreateAutomationEvent extends RoutineEvent {
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class SetRoutineName extends RoutineEvent {
|
||||
final String name;
|
||||
const SetRoutineName(this.name);
|
||||
@override
|
||||
List<Object> get props => [name];
|
||||
}
|
||||
class ClearFunctions extends RoutineEvent {}
|
||||
|
@ -45,7 +45,9 @@ class RoutineSearchAndButtons extends StatelessWidget {
|
||||
isRequired: true,
|
||||
width: 450,
|
||||
onChanged: (value) {
|
||||
// context.read<RoutineBloc>().add(SearchRoutines(value));
|
||||
context
|
||||
.read<RoutineBloc>()
|
||||
.add(SetRoutineName(value));
|
||||
},
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user