|
|
|
@ -53,11 +53,17 @@ class ProfileSettingsState extends State<ProfileSettings> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
_loadPermissions();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load data after first frame
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
|
|
|
if (mounted) {
|
|
|
|
insuranceViewModel.initInsuranceProvider();
|
|
|
|
insuranceViewModel.initInsuranceProvider();
|
|
|
|
|
|
|
|
// Load profile settings for preferred language
|
|
|
|
|
|
|
|
profileSettingsViewModel.getProfileSettings();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
_loadPermissions();
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -96,12 +102,14 @@ class ProfileSettingsState extends State<ProfileSettings> {
|
|
|
|
final SwiperController _controller = SwiperController();
|
|
|
|
final SwiperController _controller = SwiperController();
|
|
|
|
late InsuranceViewModel insuranceViewModel;
|
|
|
|
late InsuranceViewModel insuranceViewModel;
|
|
|
|
late ContactUsViewModel contactUsViewModel;
|
|
|
|
late ContactUsViewModel contactUsViewModel;
|
|
|
|
|
|
|
|
late ProfileSettingsViewModel profileSettingsViewModel;
|
|
|
|
String _permissionsLabel = "";
|
|
|
|
String _permissionsLabel = "";
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
insuranceViewModel = Provider.of<InsuranceViewModel>(context, listen: false);
|
|
|
|
insuranceViewModel = Provider.of<InsuranceViewModel>(context, listen: false);
|
|
|
|
contactUsViewModel = Provider.of<ContactUsViewModel>(context, listen: false);
|
|
|
|
contactUsViewModel = Provider.of<ContactUsViewModel>(context, listen: false);
|
|
|
|
|
|
|
|
profileSettingsViewModel = Provider.of<ProfileSettingsViewModel>(context, listen: false);
|
|
|
|
return CollapsingListView(
|
|
|
|
return CollapsingListView(
|
|
|
|
title: LocaleKeys.profileAndSettings.tr(context: context),
|
|
|
|
title: LocaleKeys.profileAndSettings.tr(context: context),
|
|
|
|
logout: () {
|
|
|
|
logout: () {
|
|
|
|
@ -268,9 +276,9 @@ class ProfileSettingsState extends State<ProfileSettings> {
|
|
|
|
actionItem(AppAssets.language, LocaleKeys.communicationLanguage.tr(context: context), () {
|
|
|
|
actionItem(AppAssets.language, LocaleKeys.communicationLanguage.tr(context: context), () {
|
|
|
|
profileVm.openPreferredLanguageBottomSheet();
|
|
|
|
profileVm.openPreferredLanguageBottomSheet();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
trailingLabel: profileVm.isPatientProfileLoading
|
|
|
|
trailingLabel: profileVm.isPatientProfileLoading || profileVm.getPatientInfoForUpdate == null
|
|
|
|
? "English"
|
|
|
|
? "English"
|
|
|
|
: (profileVm.getPatientInfoForUpdate.preferredLanguage! == "1" ? LocaleKeys.arabic.tr(context: context) : LocaleKeys.english.tr(context: context)),
|
|
|
|
: (profileVm.getPatientInfoForUpdate!.preferredLanguage! == "1" ? LocaleKeys.arabic.tr(context: context) : LocaleKeys.english.tr(context: context)),
|
|
|
|
isShowLoading: profileVm.isPatientProfileLoading),
|
|
|
|
isShowLoading: profileVm.isPatientProfileLoading),
|
|
|
|
1.divider,
|
|
|
|
1.divider,
|
|
|
|
actionItem(AppAssets.smart_phone_fill, LocaleKeys.emrgNo.tr(context: context), () {
|
|
|
|
actionItem(AppAssets.smart_phone_fill, LocaleKeys.emrgNo.tr(context: context), () {
|
|
|
|
|