|
|
|
|
@ -146,6 +146,9 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
await authVM.handleNewImeiRegistration(isNavigate: false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load offers and discounts for all users (authenticated or not)
|
|
|
|
|
offersAndDiscountsViewModel.initOffersAndDiscounts();
|
|
|
|
|
|
|
|
|
|
if (appState.isAuthenticated) {
|
|
|
|
|
Clarity.setCustomUserId(appState.getAuthenticatedUser()!.patientId.toString());
|
|
|
|
|
|
|
|
|
|
@ -161,7 +164,6 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
// myAppointmentsViewModel.getPatientAppointmentQueueDetails();
|
|
|
|
|
notificationsViewModel.initNotificationsViewModel();
|
|
|
|
|
insuranceViewModel.initInsuranceProvider();
|
|
|
|
|
offersAndDiscountsViewModel.initOffersAndDiscounts();
|
|
|
|
|
|
|
|
|
|
if (!appState.isRatedVisible) {
|
|
|
|
|
appointmentRatingViewModel.getLastRatingAppointment(
|
|
|
|
|
@ -212,13 +214,17 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
RefreshIndicator(
|
|
|
|
|
color: AppColors.primaryRedColor,
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
// Refresh Offers and Discounts for all users
|
|
|
|
|
offersAndDiscountsViewModel.setIsoffersListLoading(true);
|
|
|
|
|
offersAndDiscountsViewModel.initOffersAndDiscounts(forceRefresh: true);
|
|
|
|
|
|
|
|
|
|
if (appState.isAuthenticated) {
|
|
|
|
|
// Refresh Appointments Data
|
|
|
|
|
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
|
|
|
|
|
// Refresh Appointments Data
|
|
|
|
|
// Refresh Wallet Data
|
|
|
|
|
habibWalletVM.initHabibWalletProvider();
|
|
|
|
|
habibWalletVM.getPatientBalanceAmount();
|
|
|
|
|
habibWalletVM.getLakumAccountInformation();
|
|
|
|
|
@ -230,8 +236,6 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
// Refresh Immediate LiveCare Data
|
|
|
|
|
immediateLiveCareViewModel.initImmediateLiveCare();
|
|
|
|
|
immediateLiveCareViewModel.getPatientLiveCareHistory();
|
|
|
|
|
offersAndDiscountsViewModel.setIsoffersListLoading(true);
|
|
|
|
|
offersAndDiscountsViewModel.initOffersAndDiscounts(forceRefresh: true);
|
|
|
|
|
|
|
|
|
|
// appointmentRatingViewModel.getLastRatingAppointment(
|
|
|
|
|
// onSuccess: (response) {
|
|
|
|
|
@ -406,54 +410,7 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
!appState.isAuthenticated
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: false,
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
|
width: 50.w,
|
|
|
|
|
height: 60.h,
|
|
|
|
|
icon: AppAssets.symptomCheckerIcon,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 12.w),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.howAreYouFeelingToday.tr(context: context).toText14(isBold: true),
|
|
|
|
|
LocaleKeys.checkYourSymptomsWithScale.tr(context: context).toText12(isBold: true),
|
|
|
|
|
SizedBox(height: 14.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.checkYourSymptoms.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
context.navigateWithName(AppRoutes.userInfoSelection);
|
|
|
|
|
},
|
|
|
|
|
padding: EdgeInsetsGeometry.zero,
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
fontSize: 14.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).expanded
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.w, 0.h)
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
|
|
|
|
|
// Offers And Discounts Carousel - Auto-scrolling from right to left
|
|
|
|
|
//appState.isAuthenticated &&
|
|
|
|
|
appState.isEnabledOffersAndDiscountsCarousel
|
|
|
|
|
? Consumer<OffersAndDiscountsViewModel>(
|
|
|
|
|
builder: (context, offersVM, child) {
|
|
|
|
|
@ -506,45 +463,6 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(width: 12.w),
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h);
|
|
|
|
|
|
|
|
|
|
/////////
|
|
|
|
|
|
|
|
|
|
////////////
|
|
|
|
|
// return Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// ("${LocaleKeys.offers.tr(context: context)} & ${LocaleKeys.discount.tr(context: context)}").toText16(isBold: true),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// LocaleKeys.viewAll.tr(context: context).toText14(color: AppColors.primaryRedColor, isBold: true),
|
|
|
|
|
// SizedBox(width: 2.h),
|
|
|
|
|
// Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 14.h),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ).paddingSymmetrical(24.h, 0.h).onPress(() {
|
|
|
|
|
// Navigator.of(context).push(CustomPageRoute(page: OffersAndDiscountsPage()));
|
|
|
|
|
// }),
|
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: 150.h,
|
|
|
|
|
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
// color: AppColors.whiteColor,
|
|
|
|
|
// borderRadius: 16.r,
|
|
|
|
|
// hasShadow: false,
|
|
|
|
|
// ),
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: CircularProgressIndicator(
|
|
|
|
|
// valueColor: AlwaysStoppedAnimation<Color>(AppColors.primaryRedColor),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
// SizedBox(height: 18.h),
|
|
|
|
|
// ],
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Show offers if available
|
|
|
|
|
@ -568,8 +486,7 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
Navigator.of(context).push(CustomPageRoute(page: OffersAndDiscountsPage()));
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
OffersAndDiscountsCarousel().paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
SizedBox(height: 18.h),
|
|
|
|
|
OffersAndDiscountsCarousel().paddingOnly(left: 24.w),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -580,10 +497,58 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
)
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
|
|
|
|
|
!appState.isAuthenticated
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: false,
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
|
width: 50.w,
|
|
|
|
|
height: 60.h,
|
|
|
|
|
icon: AppAssets.symptomCheckerIcon,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 12.w),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.howAreYouFeelingToday.tr(context: context).toText14(isBold: true),
|
|
|
|
|
LocaleKeys.checkYourSymptomsWithScale.tr(context: context).toText12(isBold: true),
|
|
|
|
|
SizedBox(height: 14.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.checkYourSymptoms.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
context.navigateWithName(AppRoutes.userInfoSelection);
|
|
|
|
|
},
|
|
|
|
|
padding: EdgeInsetsGeometry.zero,
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
fontSize: 14.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).expanded
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.w, 0.h)
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
|
|
|
|
|
// Offers And Discounts Carousel - Auto-scrolling from right to left
|
|
|
|
|
//appState.isAuthenticated &&
|
|
|
|
|
|
|
|
|
|
appState.isAuthenticated
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
|