mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +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<ChangeAutomationOperator>(_changeOperatorOperator);
|
||||||
on<EffectiveTimePeriodEvent>(_onEffectiveTimeEvent);
|
on<EffectiveTimePeriodEvent>(_onEffectiveTimeEvent);
|
||||||
on<CreateAutomationEvent>(_onCreateAutomation);
|
on<CreateAutomationEvent>(_onCreateAutomation);
|
||||||
|
on<SetRoutineName>(_onSetRoutineName);
|
||||||
// on<RemoveFunction>(_onRemoveFunction);
|
// on<RemoveFunction>(_onRemoveFunction);
|
||||||
// on<ClearFunctions>(_onClearFunctions);
|
// on<ClearFunctions>(_onClearFunctions);
|
||||||
}
|
}
|
||||||
@ -350,4 +351,9 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
|||||||
EffectiveTimePeriodEvent event, Emitter<RoutineState> emit) {
|
EffectiveTimePeriodEvent event, Emitter<RoutineState> emit) {
|
||||||
emit(state.copyWith(effectiveTime: event.effectiveTime));
|
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 => [];
|
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 {}
|
class ClearFunctions extends RoutineEvent {}
|
||||||
|
@ -45,7 +45,9 @@ class RoutineSearchAndButtons extends StatelessWidget {
|
|||||||
isRequired: true,
|
isRequired: true,
|
||||||
width: 450,
|
width: 450,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
// context.read<RoutineBloc>().add(SearchRoutines(value));
|
context
|
||||||
|
.read<RoutineBloc>()
|
||||||
|
.add(SetRoutineName(value));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user