feature: consultant registration

This commit is contained in:
mso7nueh
2024-10-14 15:07:07 +03:00
parent 1462334155
commit 78be72372c
12 changed files with 244 additions and 143 deletions

View File

@@ -56,8 +56,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
const SizedBox(height: 12),
_aboutEatvio(state),
const SizedBox(height: 12),
_becomeConsultantButton(state),
const SizedBox(height: 8),
if (state.profile.role != 'consultant')
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: _becomeConsultantButton(state),
),
_deleteAccountButton(state),
],
),
@@ -213,10 +216,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
updatesNotificationsSwitchState = !updatesNotificationsSwitchState;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
newUpdatesNotifications: updatesNotificationsSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
newUpdatesNotifications: updatesNotificationsSwitchState,
),
);
},
title: 'Уведомление о новых обновлениях',
trailing: CupertinoSwitch(
@@ -227,10 +230,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
updatesNotificationsSwitchState = newValue;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
newUpdatesNotifications: updatesNotificationsSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
newUpdatesNotifications: updatesNotificationsSwitchState,
),
);
},
),
),
@@ -242,10 +245,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
diaryReminderNotifications: fillDiaryNotificationsSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
diaryReminderNotifications: fillDiaryNotificationsSwitchState,
),
);
},
title: 'Напоминание о заполнении дневника',
trailing: CupertinoSwitch(
@@ -256,10 +259,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
fillDiaryNotificationsSwitchState = newValue;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
diaryReminderNotifications: fillDiaryNotificationsSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
diaryReminderNotifications: fillDiaryNotificationsSwitchState,
),
);
},
),
),
@@ -271,10 +274,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
moodSwitchState = !moodSwitchState;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
isMoodFillable: moodSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
isMoodFillable: moodSwitchState,
),
);
},
title: 'Указывать “настроение” в заполнение дневника',
trailing: CupertinoSwitch(
@@ -285,10 +288,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
moodSwitchState = newValue;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
isMoodFillable: moodSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
isMoodFillable: moodSwitchState,
),
);
},
),
),
@@ -300,10 +303,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
bedTimeSwitchState = !bedTimeSwitchState;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
isBedtimeFillable: bedTimeSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
isBedtimeFillable: bedTimeSwitchState,
),
);
},
title: 'Указывать “отход ко сну” в заполнение дневника',
trailing: CupertinoSwitch(
@@ -314,10 +317,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
bedTimeSwitchState = newValue;
});
settingsCubit.updateProfileSettings(
profileSettingsModel: state.profileSettings.copyWith(
isBedtimeFillable: bedTimeSwitchState,
),
);
profileSettingsModel: state.profileSettings.copyWith(
isBedtimeFillable: bedTimeSwitchState,
),
);
},
),
),