|
|
|
|
@ -58,68 +58,68 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
trailing: CustomButton(
|
|
|
|
|
text: "Book",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// if (bloodDonationVM.isUserAuthanticated()) {
|
|
|
|
|
bloodDonationVM.fetchHospitalsList().then((value) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(context, title: "Select Hospital", isDismissible: false, child: Consumer<BloodDonationViewModel>(builder: (_, data, __) {
|
|
|
|
|
return HospitalBottomSheetBodySelection(
|
|
|
|
|
onUserHospitalSelection: (BdGetProjectsHaveBdClinic userChoice) {
|
|
|
|
|
bloodDonationVM.getFreeBloodDonationSlots(request: {"ClinicID": 134, "ProjectID": userChoice.projectId});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}), callBackFunc: () {});
|
|
|
|
|
});
|
|
|
|
|
// } else {
|
|
|
|
|
// return showCommonBottomSheetWithoutHeight(
|
|
|
|
|
// context,
|
|
|
|
|
// title: LocaleKeys.notice.tr(context: context),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
// children: [
|
|
|
|
|
// Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
|
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
|
// (LocaleKeys.loginToUseService.tr()).toText16(color: AppColors.blackColor),
|
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: CustomButton(
|
|
|
|
|
// text: LocaleKeys.cancel.tr(),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
// borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
// textColor: AppColors.primaryRedColor,
|
|
|
|
|
// icon: AppAssets.cancel,
|
|
|
|
|
// iconColor: AppColors.primaryRedColor,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(width: 8.h),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: CustomButton(
|
|
|
|
|
// text: LocaleKeys.confirm.tr(),
|
|
|
|
|
// onPressed: () async {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// // Navigator.pushAndRemoveUntil(context, CustomPageRoute(page: LandingNavigation()), (r) => false);
|
|
|
|
|
// await getIt<AuthenticationViewModel>().onLoginPressed();
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: AppColors.bgGreenColor,
|
|
|
|
|
// borderColor: AppColors.bgGreenColor,
|
|
|
|
|
// textColor: Colors.white,
|
|
|
|
|
// icon: AppAssets.confirm,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
|
// ],
|
|
|
|
|
// ).center,
|
|
|
|
|
// callBackFunc: () {},
|
|
|
|
|
// isFullScreen: false,
|
|
|
|
|
// isCloseButtonVisible: true,
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
if (bloodDonationVM.isUserAuthanticated()) {
|
|
|
|
|
bloodDonationVM.fetchHospitalsList().then((value) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(context, title: "Select Hospital", isDismissible: false, child: Consumer<BloodDonationViewModel>(builder: (_, data, __) {
|
|
|
|
|
return HospitalBottomSheetBodySelection(
|
|
|
|
|
onUserHospitalSelection: (BdGetProjectsHaveBdClinic userChoice) {
|
|
|
|
|
bloodDonationVM.getFreeBloodDonationSlots(request: {"ClinicID": 134, "ProjectID": userChoice.projectId});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}), callBackFunc: () {});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
return showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
title: LocaleKeys.notice.tr(context: context),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
(LocaleKeys.loginToUseService.tr()).toText16(color: AppColors.blackColor),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.cancel.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
icon: AppAssets.cancel,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.confirm.tr(),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
// Navigator.pushAndRemoveUntil(context, CustomPageRoute(page: LandingNavigation()), (r) => false);
|
|
|
|
|
await getIt<AuthenticationViewModel>().onLoginPressed();
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.bgGreenColor,
|
|
|
|
|
borderColor: AppColors.bgGreenColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
icon: AppAssets.confirm,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
],
|
|
|
|
|
).center,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.bgRedLightColor,
|
|
|
|
|
borderColor: AppColors.bgRedLightColor,
|
|
|
|
|
@ -297,7 +297,60 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
DialogService dialogService = getIt.get<DialogService>();
|
|
|
|
|
if (await bloodDonationVM.validateSelections()) {
|
|
|
|
|
bloodDonationVM.updateBloodGroup();
|
|
|
|
|
if (bloodDonationVM.isUserAuthanticated()) {
|
|
|
|
|
bloodDonationVM.updateBloodGroup();
|
|
|
|
|
} else {
|
|
|
|
|
return showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
title: LocaleKeys.notice.tr(context: context),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
(LocaleKeys.loginToUseService.tr()).toText16(color: AppColors.blackColor),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.cancel.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
icon: AppAssets.cancel,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.confirm.tr(),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
// Navigator.pushAndRemoveUntil(context, CustomPageRoute(page: LandingNavigation()), (r) => false);
|
|
|
|
|
await getIt<AuthenticationViewModel>().onLoginPressed();
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.bgGreenColor,
|
|
|
|
|
borderColor: AppColors.bgGreenColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
icon: AppAssets.confirm,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
],
|
|
|
|
|
).center,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
|