forked from eatvio/eatvio_app
fix(diet): diet states
This commit is contained in:
@@ -58,9 +58,9 @@ class _StatusDropDownWidgetState extends State<StatusDropDownWidget> {
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
if (value == s.public_diet_state) {
|
||||
context.read<CreateDietCubit>().setDietState(DietState.active, 0);
|
||||
context.read<CreateDietCubit>().setDietState(DietState.active);
|
||||
} else {
|
||||
context.read<CreateDietCubit>().setDietState(DietState.personal, 1);
|
||||
context.read<CreateDietCubit>().setDietState(DietState.personal);
|
||||
}
|
||||
// final index = dietStates.indexOf(value);
|
||||
// context.read<CreateDietCubit>().setDietState(value, index);
|
||||
@@ -77,7 +77,7 @@ class _StatusDropDownWidgetState extends State<StatusDropDownWidget> {
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
value: state.dietStateIndex == null ? null : dietStateTitles[state.dietStateIndex ?? 0],
|
||||
value: state.dietState == DietState.active ? dietStateTitles[0] : state.dietState == DietState.personal ? dietStateTitles[1] : null,
|
||||
),
|
||||
if (state.dietStateError != null) ...[
|
||||
const SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user