|
|
|
|
@ -448,31 +448,31 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
|
|
|
|
|
// Offers And Discounts Carousel - Auto-scrolling from right to left
|
|
|
|
|
appState.isAuthenticated && appState.isEnabledOffersAndDiscountsCarousel
|
|
|
|
|
? 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),
|
|
|
|
|
OffersAndDiscountsCarousel().paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
SizedBox(height: 18.h),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
// appState.isAuthenticated && appState.isEnabledOffersAndDiscountsCarousel
|
|
|
|
|
// ? 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),
|
|
|
|
|
// OffersAndDiscountsCarousel().paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
// SizedBox(height: 18.h),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// : SizedBox.shrink(),
|
|
|
|
|
|
|
|
|
|
appState.isAuthenticated
|
|
|
|
|
? Column(
|
|
|
|
|
@ -516,7 +516,7 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 16.h)
|
|
|
|
|
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
|
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length == 1
|
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length == 1 && !immediateLiveCareVM.patientHasPendingLiveCareRequest
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
@ -536,9 +536,11 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
height: isTablet ? 290.h : 255.h,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
itemCount: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
|
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length
|
|
|
|
|
: 3,
|
|
|
|
|
itemCount: () {
|
|
|
|
|
final int baseCount =
|
|
|
|
|
myAppointmentsVM.patientAppointmentsHistoryList.length + (immediateLiveCareVM.patientHasPendingLiveCareRequest ? 1 : 0);
|
|
|
|
|
return baseCount < 3 ? baseCount : 3;
|
|
|
|
|
}(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.only(left: 16.h, right: 16.h),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
@ -571,10 +573,14 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
|
|
|
|
|
child: Builder(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
final int baseAppointmentCount = myAppointmentsVM.patientAppointmentsHistoryList.length;
|
|
|
|
|
final int liveCareCount = immediateLiveCareVM.patientHasPendingLiveCareRequest ? 1 : 0;
|
|
|
|
|
final int totalCount = baseAppointmentCount + liveCareCount;
|
|
|
|
|
|
|
|
|
|
final int swiperItemCount = myAppointmentsVM.isMyAppointmentsLoading
|
|
|
|
|
? 3
|
|
|
|
|
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
|
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length
|
|
|
|
|
: totalCount < 3
|
|
|
|
|
? totalCount
|
|
|
|
|
: 3;
|
|
|
|
|
final bool isArabic = appState.isArabic();
|
|
|
|
|
return Swiper(
|
|
|
|
|
|