|
|
|
@ -69,6 +69,7 @@ import 'package:hmg_patient_app_new/widgets/countdown_timer.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
|
|
|
|
|
|
|
|
import 'package:lottie/lottie.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:smooth_corner/smooth_corner.dart';
|
|
|
|
import 'package:smooth_corner/smooth_corner.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -264,8 +265,8 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
borderRadius: 12.r,
|
|
|
|
borderRadius: 12.r,
|
|
|
|
padding: EdgeInsets.fromLTRB(12.h, 0, 12.h, 0),
|
|
|
|
padding: EdgeInsets.fromLTRB(12.h, 0, 12.h, 0),
|
|
|
|
height: 40.h,
|
|
|
|
height: 40.h,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -483,29 +484,37 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SizedBox(
|
|
|
|
: SizedBox(
|
|
|
|
height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
|
|
|
|
height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
|
|
|
|
child: Swiper(
|
|
|
|
child: Builder(
|
|
|
|
itemCount: myAppointmentsVM.isMyAppointmentsLoading
|
|
|
|
builder: (context) {
|
|
|
|
? 3
|
|
|
|
final int swiperItemCount = myAppointmentsVM.isMyAppointmentsLoading
|
|
|
|
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
|
|
|
|
? 3
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length
|
|
|
|
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
|
|
|
|
: 3,
|
|
|
|
? myAppointmentsVM.patientAppointmentsHistoryList.length
|
|
|
|
layout: SwiperLayout.STACK,
|
|
|
|
: 3;
|
|
|
|
loop: false,
|
|
|
|
final bool isArabic = appState.isArabic();
|
|
|
|
itemWidth: MediaQuery.of(context).size.width - 48.h,
|
|
|
|
return Swiper(
|
|
|
|
indicatorLayout: PageIndicatorLayout.COLOR,
|
|
|
|
itemCount: swiperItemCount,
|
|
|
|
axisDirection: appState.isArabic() ? AxisDirection.right : AxisDirection.left,
|
|
|
|
layout: SwiperLayout.STACK,
|
|
|
|
controller: _controller,
|
|
|
|
loop: false,
|
|
|
|
itemHeight: 255.h + 20,
|
|
|
|
itemWidth: MediaQuery.of(context).size.width - 48.h,
|
|
|
|
// extra space for shadow
|
|
|
|
indicatorLayout: PageIndicatorLayout.COLOR,
|
|
|
|
pagination: SwiperPagination(
|
|
|
|
axisDirection: isArabic ? AxisDirection.right : AxisDirection.left,
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
controller: _controller,
|
|
|
|
margin: EdgeInsets.only(top: 220.h + 20 + 8 + 24),
|
|
|
|
index: isArabic ? swiperItemCount - 1 : 0,
|
|
|
|
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
|
|
|
|
itemHeight: 255.h + 20,
|
|
|
|
),
|
|
|
|
// extra space for shadow
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
pagination: SwiperPagination(
|
|
|
|
return Padding(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
|
|
|
margin: EdgeInsets.only(top: 220.h + 20 + 8 + 24),
|
|
|
|
child: getIndexSwiperCard(index),
|
|
|
|
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
|
|
|
final int actualIndex = isArabic ? (swiperItemCount - 1 - index) : index;
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
|
|
|
|
|
|
|
child: getIndexSwiperCard(actualIndex),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1004,17 +1013,21 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
Widget _buildQueueHeader(int currentStatus) {
|
|
|
|
Widget _buildQueueHeader(int currentStatus) {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppCustomChipWidget(
|
|
|
|
AppCustomChipWidget(
|
|
|
|
labelText: currentStatus == 0 ? LocaleKeys.inQueue.tr() : LocaleKeys.yourTurn.tr(),
|
|
|
|
labelText: currentStatus == 0 ? LocaleKeys.inQueue.tr() : LocaleKeys.yourTurn.tr(),
|
|
|
|
backgroundColor: Utils.getCardBorderColor(currentStatus).withValues(alpha: 0.20),
|
|
|
|
backgroundColor: Utils.getCardBorderColor(currentStatus).withValues(alpha: 0.20),
|
|
|
|
textColor: Utils.getCardBorderColor(currentStatus),
|
|
|
|
textColor: Utils.getCardBorderColor(currentStatus),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
Container(
|
|
|
|
icon: AppAssets.waiting_icon,
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
width: 24.h,
|
|
|
|
color: AppColors.greyColor,
|
|
|
|
height: 24.h,
|
|
|
|
borderRadius: 10.h,
|
|
|
|
),
|
|
|
|
hasShadow: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(6.h),
|
|
|
|
|
|
|
|
child: Lottie.asset(AppAnimations.hourGlass, repeat: true, reverse: false, frameRate: FrameRate(60), width: 40.h, height: 40.h, fit: BoxFit.fill)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1148,6 +1161,7 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppCustomChipWidget(
|
|
|
|
AppCustomChipWidget(
|
|
|
|
labelText: liveCareData.stringCallStatus,
|
|
|
|
labelText: liveCareData.stringCallStatus,
|
|
|
|
@ -1162,13 +1176,42 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(width: 8.w),
|
|
|
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
|
|
|
richText: ValueListenableBuilder<Duration>(
|
|
|
|
|
|
|
|
valueListenable: immediateLiveCareViewModel.durationNotifier,
|
|
|
|
|
|
|
|
builder: (context, duration, child) {
|
|
|
|
|
|
|
|
final hours = duration.inHours.toString().padLeft(2, '0');
|
|
|
|
|
|
|
|
final minutes = duration.inMinutes.remainder(60).toString().padLeft(2, '0');
|
|
|
|
|
|
|
|
final seconds = duration.inSeconds.remainder(60).toString().padLeft(2, '0');
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
'$hours:$minutes:$seconds'.toText10(isBold: true),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// labelText: DateUtil.formatDateToDate(
|
|
|
|
|
|
|
|
// DateUtil.convertStringToDate(liveCareData.arrivalTime),
|
|
|
|
|
|
|
|
// false,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
Container(
|
|
|
|
icon: AppAssets.waiting_icon,
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
width: 24.h,
|
|
|
|
color: AppColors.greyColor,
|
|
|
|
height: 24.h,
|
|
|
|
borderRadius: 10.h,
|
|
|
|
),
|
|
|
|
hasShadow: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(6.h),
|
|
|
|
|
|
|
|
child: Lottie.asset(AppAnimations.hourGlass, repeat: true, reverse: false, frameRate: FrameRate(60), width: 40.h, height: 40.h, fit: BoxFit.fill)),
|
|
|
|
|
|
|
|
// Utils.buildSvgWithAssets(
|
|
|
|
|
|
|
|
// icon: AppAssets.waiting_icon,
|
|
|
|
|
|
|
|
// width: 24.h,
|
|
|
|
|
|
|
|
// height: 24.h,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|