mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 21:47:54 +00:00
change string value to enum
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_app/features/scene/enum/effective_period_options.dart';
|
||||
|
||||
abstract class EffectPeriodEvent extends Equatable {
|
||||
const EffectPeriodEvent();
|
||||
@@ -8,7 +9,7 @@ abstract class EffectPeriodEvent extends Equatable {
|
||||
}
|
||||
|
||||
class SetPeriod extends EffectPeriodEvent {
|
||||
final String period;
|
||||
final EnumEffectivePeriodOptions period;
|
||||
|
||||
const SetPeriod(this.period);
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_app/features/scene/enum/effective_period_options.dart';
|
||||
|
||||
class EffectPeriodState extends Equatable {
|
||||
final String selectedPeriod;
|
||||
final EnumEffectivePeriodOptions selectedPeriod;
|
||||
final List<String> selectedDays;
|
||||
final String? customStartTime;
|
||||
final String? customEndTime;
|
||||
@@ -15,7 +16,7 @@ class EffectPeriodState extends Equatable {
|
||||
|
||||
factory EffectPeriodState.initial() {
|
||||
return const EffectPeriodState(
|
||||
selectedPeriod: 'All Day',
|
||||
selectedPeriod: EnumEffectivePeriodOptions.allDay,
|
||||
selectedDays: [],
|
||||
customStartTime: null,
|
||||
customEndTime: null,
|
||||
@@ -23,7 +24,7 @@ class EffectPeriodState extends Equatable {
|
||||
}
|
||||
|
||||
EffectPeriodState copyWith({
|
||||
String? selectedPeriod,
|
||||
EnumEffectivePeriodOptions? selectedPeriod,
|
||||
List<String>? selectedDays,
|
||||
String? customStartTime,
|
||||
String? customEndTime,
|
||||
|
||||
Reference in New Issue
Block a user