Updates & enhancements

pull/107/head
haroon amjad 5 months ago
parent f142ff90be
commit 1e5744cf44

@ -711,7 +711,7 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
@ -852,7 +852,7 @@ class ApiConsts {
static final String addHHCOrder = 'api/HHC/add'; static final String addHHCOrder = 'api/HHC/add';
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 19.3; static final double appVersionID = 50.3;
static final int appChannelId = 3; static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20"; static final String appIpAddress = "10.20.10.20";
static final String appGeneralId = "Cs2020@2016\$2958"; static final String appGeneralId = "Cs2020@2016\$2958";

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart';
@ -36,6 +38,10 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
late AppState _appState; late AppState _appState;
Duration countdownDuration = Duration(minutes: 1, seconds: 0);
late ValueNotifier<Duration> durationNotifier;
late Timer timer;
initImmediateLiveCare() { initImmediateLiveCare() {
_appState = getIt<AppState>(); _appState = getIt<AppState>();
immediateLiveCareClinicsList = []; immediateLiveCareClinicsList = [];
@ -144,12 +150,19 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
patientLiveCareHistoryList = apiResponse.data!; patientLiveCareHistoryList = apiResponse.data!;
if (patientLiveCareHistoryList.isNotEmpty) { if (patientLiveCareHistoryList.isNotEmpty) {
if (patientLiveCareHistoryList[0].callStatus! < 4) { if (patientLiveCareHistoryList[0].callStatus! < 4) {
countdownDuration = Duration(seconds: 0);
durationNotifier.dispose();
patientHasPendingLiveCareRequest = true; patientHasPendingLiveCareRequest = true;
countdownDuration = Duration(minutes: patientLiveCareHistoryList.first.watingtimeInteger!, seconds: 0);
durationNotifier = ValueNotifier<Duration>(countdownDuration);
startTimer();
} else { } else {
patientHasPendingLiveCareRequest = false; patientHasPendingLiveCareRequest = false;
timer.cancel();
} }
} else { } else {
patientHasPendingLiveCareRequest = false; patientHasPendingLiveCareRequest = false;
timer.cancel();
} }
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
@ -159,4 +172,20 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
}, },
); );
} }
void startTimer() {
timer = Timer.periodic(const Duration(seconds: 1), (_) => addTime());
notifyListeners();
}
void addTime() {
final seconds = durationNotifier.value.inSeconds - 1;
if (seconds < 0) {
timer?.cancel();
// Handle end of timer here
// showEndMessage();
} else {
durationNotifier.value = Duration(seconds: seconds);
}
}
} }

@ -77,14 +77,14 @@ class LabViewModel extends ChangeNotifier {
required this.navigationService}); required this.navigationService});
initLabProvider() { initLabProvider() {
// if (isLabNeedToLoad) { if (isLabNeedToLoad) {
patientLabOrders.clear(); patientLabOrders.clear();
filteredLabOrders.clear(); filteredLabOrders.clear();
labOrderTests.clear(); labOrderTests.clear();
isLabOrdersLoading = true; isLabOrdersLoading = true;
isLabResultsLoading = true; isLabResultsLoading = true;
getPatientLabOrders(); getPatientLabOrders();
// } }
notifyListeners(); notifyListeners();
} }
@ -94,7 +94,7 @@ class LabViewModel extends ChangeNotifier {
} }
Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// if (!isLabNeedToLoad) return; if (!isLabNeedToLoad) return;
isLabOrdersLoading = true; isLabOrdersLoading = true;
patientLabOrders.clear(); patientLabOrders.clear();

@ -63,10 +63,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
@override @override
void initState() { void initState() {
scheduleMicrotask(() { scheduleMicrotask(() {
// if (AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) { if (AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) {
// prescriptionsViewModel.setPrescriptionsDetailsLoading();
// prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); }
// }
}); });
super.initState(); super.initState();
} }

@ -144,9 +144,7 @@ class AppointmentCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(isLoading (isLoading ? 'John Doe' : "${patientAppointmentHistoryResponseModel.doctorTitle} ${patientAppointmentHistoryResponseModel.doctorNameObj!}")
? 'https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png'
: patientAppointmentHistoryResponseModel.doctorNameObj!)
.toText16(isBold: true, maxlines: 1) .toText16(isBold: true, maxlines: 1)
.toShimmer2(isShow: isLoading), .toShimmer2(isShow: isLoading),
SizedBox(height: 8.h), SizedBox(height: 8.h),

@ -41,6 +41,8 @@ class AppointmentDoctorCard extends StatelessWidget {
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [ children: [
Image.network( Image.network(
patientAppointmentHistoryResponseModel.doctorImageURL!, patientAppointmentHistoryResponseModel.doctorImageURL!,
@ -48,6 +50,10 @@ class AppointmentDoctorCard extends StatelessWidget {
height: 63.h, height: 63.h,
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100.r), ).circle(100.r),
SizedBox(height: 12.h),
AppCustomChipWidget(icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"),
],
),
SizedBox(width: 16.w), SizedBox(width: 16.w),
Expanded( Expanded(
child: Column( child: Column(
@ -87,10 +93,6 @@ class AppointmentDoctorCard extends StatelessWidget {
!patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor, !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor,
textColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor, textColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor,
), ),
AppCustomChipWidget(
icon: AppAssets.rating_icon,
iconColor: AppColors.ratingColorYellow,
labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"),
], ],
), ),
], ],

@ -16,6 +16,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/countdown_timer.dart';
import 'package:lottie/lottie.dart'; import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -32,24 +33,24 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
late AppState appState; late AppState appState;
static Duration countdownDuration = Duration(minutes: 1, seconds: 0); // static Duration countdownDuration = Duration(minutes: 1, seconds: 0);
ValueNotifier<Duration> durationNotifier = ValueNotifier<Duration>(countdownDuration); // late ValueNotifier<Duration> durationNotifier = ValueNotifier<Duration>(immediateLiveCareViewModel.countdownDuration);
Timer? timer; // Timer? timer;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
scheduleMicrotask(() { scheduleMicrotask(() {
countdownDuration = Duration(minutes: immediateLiveCareViewModel.patientLiveCareHistoryList[0].watingtimeInteger!, seconds: 0); // countdownDuration = Duration(minutes: immediateLiveCareViewModel.patientLiveCareHistoryList[0].watingtimeInteger!, seconds: 0);
durationNotifier = ValueNotifier<Duration>(countdownDuration); // durationNotifier = ValueNotifier<Duration>(immediateLiveCareViewModel.countdownDuration);
startTimer(); // startTimer();
}); });
} }
@override @override
void dispose() { void dispose() {
timer?.cancel(); // timer?.cancel();
durationNotifier.dispose(); // durationNotifier.dispose();
super.dispose(); super.dispose();
} }
@ -85,7 +86,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
"Expected waiting time: ".toText16(isBold: true), "Expected waiting time: ".toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
ValueListenableBuilder<Duration>( ValueListenableBuilder<Duration>(
valueListenable: durationNotifier, valueListenable: immediateLiveCareVM.durationNotifier,
builder: (context, duration, child) { builder: (context, duration, child) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -173,133 +174,133 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
); );
} }
void startTimer() { // void startTimer() {
timer = Timer.periodic(const Duration(seconds: 1), (_) => addTime()); // // timer = Timer.periodic(const Duration(seconds: 1), (_) => addTime());
setState(() {}); // // setState(() {});
} // }
//
void addTime() { // void addTime() {
final seconds = durationNotifier.value.inSeconds - 1; // final seconds = durationNotifier.value.inSeconds - 1;
if (seconds < 0) { // if (seconds < 0) {
timer?.cancel(); // timer?.cancel();
// Handle end of timer here // // Handle end of timer here
// showEndMessage(); // // showEndMessage();
} else { // } else {
durationNotifier.value = Duration(seconds: seconds); // durationNotifier.value = Duration(seconds: seconds);
} // }
} // }
//
Future<bool> _onWillPop() async { // Future<bool> _onWillPop() async {
timer?.cancel(); // timer?.cancel();
Navigator.of(context).pop(); // Navigator.of(context).pop();
return true; // return true;
} // }
//
Widget buildTime(Duration duration) { // Widget buildTime(Duration duration) {
String twoDigits(int n) => n.toString().padLeft(2, '0'); // String twoDigits(int n) => n.toString().padLeft(2, '0');
final hours = twoDigits(duration.inHours); // final hours = twoDigits(duration.inHours);
final minutes = twoDigits(duration.inMinutes.remainder(60)); // final minutes = twoDigits(duration.inMinutes.remainder(60));
final seconds = twoDigits(duration.inSeconds.remainder(60)); // final seconds = twoDigits(duration.inSeconds.remainder(60));
//
return Row( // return Row(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: [ // children: [
buildTimeColumn(hours, "Hours".needTranslation), // buildTimeColumn(hours, "Hours".needTranslation),
buildTimeColumn(minutes, "Mins".needTranslation), // buildTimeColumn(minutes, "Mins".needTranslation),
buildTimeColumn(seconds, "Secs".needTranslation, isLast: true), // buildTimeColumn(seconds, "Secs".needTranslation, isLast: true),
], // ],
); // );
} // }
//
Widget buildTimeColumn(String time, String label, {bool isLast = false}) { // Widget buildTimeColumn(String time, String label, {bool isLast = false}) {
return Column( // return Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: [ // children: [
Row( // Row(
children: [ // children: [
buildDigit(time[0]), // buildDigit(time[0]),
buildDigit(time[1]), // buildDigit(time[1]),
if (!isLast) buildTimeSeparator(), // if (!isLast) buildTimeSeparator(),
], // ],
), // ),
buildLabel(label), // buildLabel(label),
], // ],
); // );
} // }
//
Widget buildDigit(String digit) { // Widget buildDigit(String digit) {
return Container( // return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), // padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
// margin: const EdgeInsets.symmetric(horizontal: 2), // // margin: const EdgeInsets.symmetric(horizontal: 2),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.circular(8), // borderRadius: BorderRadius.circular(8),
), // ),
child: ClipRect( // child: ClipRect(
child: AnimatedSwitcher( // child: AnimatedSwitcher(
duration: const Duration(milliseconds: 600), // duration: const Duration(milliseconds: 600),
switchInCurve: Curves.easeOutExpo, // switchInCurve: Curves.easeOutExpo,
switchOutCurve: Curves.easeInExpo, // switchOutCurve: Curves.easeInExpo,
transitionBuilder: (Widget child, Animation<double> animation) { // transitionBuilder: (Widget child, Animation<double> animation) {
return Stack( // return Stack(
children: <Widget>[ // children: <Widget>[
SlideTransition( // SlideTransition(
position: Tween<Offset>( // position: Tween<Offset>(
begin: const Offset(0, -1), // begin: const Offset(0, -1),
end: const Offset(0, 1), // end: const Offset(0, 1),
).animate(CurvedAnimation( // ).animate(CurvedAnimation(
parent: animation, // parent: animation,
curve: Curves.easeOutCubic, // curve: Curves.easeOutCubic,
)), // )),
child: FadeTransition( // child: FadeTransition(
opacity: animation, // opacity: animation,
child: child, // child: child,
), // ),
), // ),
SlideTransition( // SlideTransition(
position: Tween<Offset>( // position: Tween<Offset>(
begin: const Offset(0, -1), // begin: const Offset(0, -1),
end: const Offset(0, 0), // end: const Offset(0, 0),
).animate(CurvedAnimation( // ).animate(CurvedAnimation(
parent: animation, // parent: animation,
curve: Curves.bounceIn, // curve: Curves.bounceIn,
)), // )),
child: FadeTransition( // child: FadeTransition(
opacity: animation, // opacity: animation,
child: child, // child: child,
), // ),
), // ),
], // ],
); // );
}, // },
child: Text( // child: Text(
digit, // digit,
key: ValueKey<String>(digit), // key: ValueKey<String>(digit),
style: TextStyle( // style: TextStyle(
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.black, // color: Colors.black,
fontSize: 20.f, // fontSize: 20.f,
), // ),
), // ),
), // ),
), // ),
); // );
} // }
//
Widget buildLabel(String label) { // Widget buildLabel(String label) {
return label.toText14(isBold: true); // return label.toText14(isBold: true);
} // }
//
Widget buildTimeSeparator() { // Widget buildTimeSeparator() {
return const Padding( // return const Padding(
padding: EdgeInsets.symmetric(horizontal: 2.0), // padding: EdgeInsets.symmetric(horizontal: 2.0),
child: Text( // child: Text(
":", // ":",
style: TextStyle( // style: TextStyle(
color: Colors.black, // color: Colors.black,
fontSize: 20, // fontSize: 20,
), // ),
), // ),
); // );
} // }
} }

@ -9,6 +9,7 @@ import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
@ -44,6 +45,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/countdown_timer.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:provider/provider.dart'; import 'package:provider/provider.dart';
@ -253,14 +255,101 @@ class _LandingPageState extends State<LandingPage> {
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor), builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
), ),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return (immediateLiveCareViewModel.patientHasPendingLiveCareRequest && index == 0)
? Column(
children: [
SizedBox(height: 12.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: true,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Immediate LiveCare Request".needTranslation.toText16(isBold: true),
SizedBox(height: 10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppCustomChipWidget(
labelText: immediateLiveCareViewModel.patientLiveCareHistoryList[0].stringCallStatus,
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
textColor: AppColors.alertColor,
),
SizedBox(width: 8.w),
AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon,
labelText: DateUtil.formatDateToDate(
DateUtil.convertStringToDate(immediateLiveCareViewModel.patientLiveCareHistoryList[0].arrivalTime), false)),
],
),
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
// Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.cover),
],
),
SizedBox(height: 10.h),
"Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true),
SizedBox(height: 8.h),
"Your turn is after ${immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount} patients.".toText14(isBold: true),
SizedBox(height: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Expected waiting time: ".toText12(isBold: true),
SizedBox(height: 8.h),
ValueListenableBuilder<Duration>(
valueListenable: immediateLiveCareViewModel.durationNotifier,
builder: (context, duration, child) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildTime(duration),
],
);
},
),
SizedBox(height: 12.h),
],
),
// CustomButton(
// text: "View Details".needTranslation,
// onPressed: () async {
// Navigator.of(context).push(CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()));
// },
// backgroundColor: Color(0xffFEE9EA),
// borderColor: Color(0xffFEE9EA),
// textColor: Color(0xffED1C2B),
// fontSize: 14.f,
// fontWeight: FontWeight.w500,
// borderRadius: 12.r,
// padding: EdgeInsets.fromLTRB(10.h, 0, 10.h, 0),
// height: 40.h,
// ),
],
),
),
).paddingSymmetrical(0.h, 0.h).onPress(() {
Navigator.of(context).push(CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()));
}),
SizedBox(height: 12.h),
],
)
: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 24.r, borderRadius: 24.r,
hasShadow: true, hasShadow: true,
), ),
child: AppointmentCard( child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index], patientAppointmentHistoryResponseModel:
myAppointmentsVM.patientAppointmentsHistoryList[immediateLiveCareViewModel.patientHasPendingLiveCareRequest ? --index : index],
myAppointmentsViewModel: myAppointmentsViewModel, myAppointmentsViewModel: myAppointmentsViewModel,
bookAppointmentsViewModel: bookAppointmentsViewModel, bookAppointmentsViewModel: bookAppointmentsViewModel,
isLoading: false, isLoading: false,
@ -304,64 +393,6 @@ class _LandingPageState extends State<LandingPage> {
).paddingSymmetrical(24.h, 0.h); ).paddingSymmetrical(24.h, 0.h);
}, },
), ),
// Consumer for LiveCare pending request
Consumer<ImmediateLiveCareViewModel>(
builder: (context, immediateLiveCareVM, child) {
return immediateLiveCareVM.patientHasPendingLiveCareRequest
? Column(
children: [
SizedBox(height: 12.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: true,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.all(16.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppCustomChipWidget(
labelText: immediateLiveCareViewModel.patientLiveCareHistoryList[0].stringCallStatus,
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
textColor: AppColors.alertColor,
),
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
// Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 40.h, height: 40.h, fit: BoxFit.contain),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"You have a pending LiveCare request".needTranslation.toText12(isBold: true),
Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 20.h,
height: 15.h,
fit: BoxFit.contain,
),
],
),
],
),
),
).paddingSymmetrical(24.h, 0.h).onPress(() {
Navigator.of(context).push(CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()));
}),
SizedBox(height: 12.h),
],
)
: SizedBox(height: 12.h);
},
),
// Consumer for ER Online Check-In pending request // Consumer for ER Online Check-In pending request
Consumer<EmergencyServicesViewModel>( Consumer<EmergencyServicesViewModel>(
@ -421,6 +452,7 @@ class _LandingPageState extends State<LandingPage> {
: SizedBox(height: 12.h); : SizedBox(height: 12.h);
}, },
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -576,10 +608,13 @@ class _LandingPageState extends State<LandingPage> {
isDone: isDone, isDone: isDone,
onPressed: () { onPressed: () {
// sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, true); // sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, true);
authVM.loginWithFingerPrintFace(() { authVM.loginWithFingerPrintFace(() async {
isDone = true; isDone = true;
cacheService.saveBool(key: CacheConst.quickLoginEnabled, value: true); cacheService.saveBool(key: CacheConst.quickLoginEnabled, value: true);
setState(() {}); setState(() {});
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
Navigator.pop(context);
});
}); });
}, },
); );

@ -118,7 +118,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),
child: Column( child: insuranceApprovalResponseModel.apporvalDetails != null ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Approval Details".toText16(isBold: true), "Approval Details".toText16(isBold: true),
@ -128,7 +128,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
children: [ children: [
LocaleKeys.procedureName.tr(context: context).toText14(isBold: true), LocaleKeys.procedureName.tr(context: context).toText14(isBold: true),
Expanded( Expanded(
child: insuranceApprovalResponseModel.apporvalDetails!.procedureName! child: (insuranceApprovalResponseModel.apporvalDetails!.procedureName ?? "")
.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2), .toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2),
), ),
], ],
@ -150,7 +150,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
], ],
), ),
], ],
), ) : SizedBox.shrink(),
), ),
) )
], ],

@ -68,7 +68,7 @@ class InsuranceHistory extends StatelessWidget {
Row( Row(
children: [ children: [
CustomButton( CustomButton(
text: insuranceVM.patientInsuranceCardHistoryList[index].statusDescription!, text: insuranceVM.patientInsuranceCardHistoryList[index].statusDescription ?? "",
onPressed: () {}, onPressed: () {},
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
borderColor: AppColors.primaryRedColor.withOpacity(0.0), borderColor: AppColors.primaryRedColor.withOpacity(0.0),

File diff suppressed because one or more lines are too long

@ -85,7 +85,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
appState = getIt.get<AppState>(); appState = getIt.get<AppState>();
scheduleMicrotask(() { scheduleMicrotask(() {
if (appState.isAuthenticated) { if (appState.isAuthenticated) {
labViewModel.initLabProvider();
insuranceViewModel.initInsuranceProvider(); insuranceViewModel.initInsuranceProvider();
medicalFileViewModel.setIsPatientSickLeaveListLoading(true); medicalFileViewModel.setIsPatientSickLeaveListLoading(true);
medicalFileViewModel.getPatientSickLeaveList(); medicalFileViewModel.getPatientSickLeaveList();
@ -458,6 +457,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
labOrderTests: labViewModel.isLabOrdersLoading ? [] : labViewModel.labOrderTests, labOrderTests: labViewModel.isLabOrdersLoading ? [] : labViewModel.labOrderTests,
isLoading: labViewModel.isLabOrdersLoading, isLoading: labViewModel.isLabOrdersLoading,
).onPress(() { ).onPress(() {
labViewModel.initLabProvider();
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: LabOrdersPage(), page: LabOrdersPage(),

@ -43,29 +43,29 @@ class LabRadCard extends StatelessWidget {
Flexible(child: labelText.toText14(isBold: true).toShimmer2(isShow: false, radius: 6.r, height: 32.h)), Flexible(child: labelText.toText14(isBold: true).toShimmer2(isShow: false, radius: 6.r, height: 32.h)),
], ],
), ),
SizedBox(height: 16.h), // SizedBox(height: 16.h),
labOrderTests.isNotEmpty // labOrderTests.isNotEmpty
? ListView.separated( // ? ListView.separated(
scrollDirection: Axis.vertical, // scrollDirection: Axis.vertical,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, // shrinkWrap: true,
itemBuilder: (cxt, index) { // itemBuilder: (cxt, index) {
return labOrderTests[index] // return labOrderTests[index]
.toText12(isBold: true, maxLine: 1) // .toText12(isBold: true, maxLine: 1)
.toShimmer2(isShow: false, radius: 6.r, height: 24.h, width: 120.w) // .toShimmer2(isShow: false, radius: 6.r, height: 24.h, width: 120.w)
.toShimmer2(isShow: isLoading); // .toShimmer2(isShow: isLoading);
}, // },
separatorBuilder: (cxt, index) => SizedBox(height: 8.h), // separatorBuilder: (cxt, index) => SizedBox(height: 8.h),
itemCount: 3, // itemCount: 3,
) // )
: "You don't have any records yet".needTranslation.toText13( // : "You don't have any records yet".needTranslation.toText13(
color: AppColors.greyTextColor, isCenter: true), // color: AppColors.greyTextColor, isCenter: true),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SizedBox.shrink(), "View All".toText12(isBold: true),
Transform.flip( Transform.flip(
flipX: appState.isArabic(), flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets( child: Utils.buildSvgWithAssets(

@ -0,0 +1,111 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
Widget buildTime(Duration duration, {bool isHomePage = false}) {
String twoDigits(int n) => n.toString().padLeft(2, '0');
final hours = twoDigits(duration.inHours);
final minutes = twoDigits(duration.inMinutes.remainder(60));
final seconds = twoDigits(duration.inSeconds.remainder(60));
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildTimeColumn(hours, "Hours".needTranslation),
buildTimeColumn(minutes, "Mins".needTranslation),
buildTimeColumn(seconds, "Secs".needTranslation, isLast: true),
],
);
}
Widget buildTimeColumn(String time, String label, {bool isLast = false}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
buildDigit(time[0]),
buildDigit(time[1]),
if (!isLast) buildTimeSeparator(),
],
),
buildLabel(label),
],
);
}
Widget buildDigit(String digit) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
// margin: const EdgeInsets.symmetric(horizontal: 2),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: ClipRect(
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 600),
switchInCurve: Curves.easeOutExpo,
switchOutCurve: Curves.easeInExpo,
transitionBuilder: (Widget child, Animation<double> animation) {
return Stack(
children: <Widget>[
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: const Offset(0, 1),
).animate(CurvedAnimation(
parent: animation,
curve: Curves.easeOutCubic,
)),
child: FadeTransition(
opacity: animation,
child: child,
),
),
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: const Offset(0, 0),
).animate(CurvedAnimation(
parent: animation,
curve: Curves.bounceIn,
)),
child: FadeTransition(
opacity: animation,
child: child,
),
),
],
);
},
child: Text(
digit,
key: ValueKey<String>(digit),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 14.f,
),
),
),
),
);
}
Widget buildLabel(String label) {
return label.toText12(isBold: true);
}
Widget buildTimeSeparator() {
return const Padding(
padding: EdgeInsets.symmetric(horizontal: 2.0),
child: Text(
":",
style: TextStyle(
color: Colors.black,
fontSize: 20,
),
),
);
}
Loading…
Cancel
Save