@ -34,7 +34,7 @@ class ImmediateLiveCarePendingRequestPage extends StatefulWidget {
}
class _ImmediateLiveCarePendingRequestPageState extends State < ImmediateLiveCarePendingRequestPage > {
late ImmediateLiveCareViewModel immediateLiveCareViewModel ;
/ / late ImmediateLiveCareViewModel immediateLiveCareViewModel ;
late AppState appState ;
String chatURL = " " ;
@ -83,7 +83,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
@ override
Widget build ( BuildContext context ) {
immediateLiveCareViewModel = Provider . of < ImmediateLiveCareViewModel > ( context , listen: false ) ;
/ / immediateLiveCareViewModel = Provider . of < ImmediateLiveCareViewModel > ( context , listen: false ) ;
appState = getIt . get < AppState > ( ) ;
return Scaffold (
backgroundColor: AppColors . bgScaffoldColor ,
@ -118,7 +118,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
Wrap (
children: [
AppCustomChipWidget (
labelText: immediateLiveCareV iew Model . patientLiveCareHistoryList . isNotEmpty ? immediateLiveCareV iew Model . patientLiveCareHistoryList [ 0 ] . stringCallStatus : " " ,
labelText: immediateLiveCareV M. patientLiveCareHistoryList . isNotEmpty ? immediateLiveCareV M. patientLiveCareHistoryList [ 0 ] . stringCallStatus : " " ,
backgroundColor: AppColors . warningColorYellow . withValues ( alpha: 0.20 ) ,
textColor: AppColors . alertColor ,
) ,
@ -127,7 +127,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
icon: AppAssets . appointment_calendar_icon ,
labelText: DateUtil . formatDateToDate (
DateUtil . convertStringToDate (
immediateLiveCareV iew Model . patientLiveCareHistoryList . isNotEmpty ? immediateLiveCareV iew Model . patientLiveCareHistoryList [ 0 ] . arrivalTime : " " ) ,
immediateLiveCareV M. patientLiveCareHistoryList . isNotEmpty ? immediateLiveCareV M. patientLiveCareHistoryList [ 0 ] . arrivalTime : " " ) ,
false ) ) ,
] ,
) ,
@ -146,9 +146,11 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
SizedBox ( height: 8. h ) ,
LocaleKeys . liveCarePendingRequestText . tr ( context: context ) . toText14 ( isBold: true ) ,
SizedBox ( height: 16. h ) ,
( immediateLiveCareViewModel . patientLiveCareHistoryList . first . callType ? ? " " ) . toLowerCase ( ) = = " video "
? CustomButton (
text: LocaleKeys . testConnection . tr ( context: context ) ,
immediateLiveCareVM . isLiveCareHistoryLoading
? SizedBox . shrink ( )
: ( immediateLiveCareVM . patientLiveCareHistoryList . first . callType ? ? " " ) . toLowerCase ( ) = = " video "
? CustomButton (
text: LocaleKeys . testConnection . tr ( context: context ) ,
onPressed: ( ) {
showCommonBottomSheetWithoutHeight ( context ,
child: ZoomConnectionTestSheet ( ) ,
@ -201,15 +203,17 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
} ,
) ,
SizedBox ( height: 16. h ) ,
CustomButton (
text: LocaleKeys . cantWaitLiveCare . tr ( context: context ) ,
onPressed: ( ) {
showCommonBottomSheetWithoutHeight ( context ,
child: LiveCareRescheduleWidget (
immediateLiveCareViewModel: immediateLiveCareVM ,
) , callBackFunc: ( ) async {
if ( immediateLiveCareVM . selectedRescheduleTime ! = 0 ) {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . reschedulingAppo . tr ( context: context ) ) ;
immediateLiveCareVM . patientLiveCareHistoryList . first . callStatus ! = 15
? CustomButton (
text: LocaleKeys . cantWaitLiveCare . tr ( context: context ) ,
onPressed: ( ) {
immediateLiveCareVM . setSelectedRescheduleTime ( 0 ) ;
showCommonBottomSheetWithoutHeight ( context ,
child: LiveCareRescheduleWidget (
immediateLiveCareViewModel: immediateLiveCareVM ,
) , callBackFunc: ( ) async {
if ( immediateLiveCareVM . selectedRescheduleTime ! = 0 ) {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . reschedulingAppo . tr ( context: context ) ) ;
String rescheduleDateTime = " " ;
if ( immediateLiveCareVM . selectedRescheduleTime = = 1 ) {
rescheduleDateTime = DateUtil . convertDateToString ( DateTime . now ( ) . add ( Duration ( minutes: 30 ) ) ) ;
@ -218,18 +222,19 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
rescheduleDateTime = DateUtil . convertDateToString ( DateTime . now ( ) . add ( Duration ( minutes: 60 ) ) ) ;
}
immediateLiveCareVM . rescheduleLiveCareCallRequest (
callID: immediateLiveCareViewModel . patientLiveCareHistoryList . first . vCID ,
serviceID: immediateLiveCareViewModel . patientLiveCareHistoryList . first . serviceID ,
consultationTime: rescheduleDateTime ,
isRescheduledForOneHourLater: immediateLiveCareVM . selectedRescheduleTime = = 1 ? false : true ,
onSuccess: ( val ) {
LoaderBottomSheet . hideLoader ( ) ;
} ,
onError: ( err ) {
LoaderBottomSheet . hideLoader ( ) ;
showCommonBottomSheetWithoutHeight ( context ,
child: Utils . getErrorWidget ( loadingText: err . toString ( ) ) ,
callBackFunc: ( ) { } ,
callID: immediateLiveCareVM . patientLiveCareHistoryList . first . vCID ,
serviceID: immediateLiveCareVM . patientLiveCareHistoryList . first . serviceID ,
consultationTime: rescheduleDateTime ,
isRescheduledForOneHourLater: immediateLiveCareVM . selectedRescheduleTime = = 1 ? false : true ,
onSuccess: ( val ) {
LoaderBottomSheet . hideLoader ( ) ;
immediateLiveCareVM . getPatientLiveCareHistory ( ) ;
} ,
onError: ( err ) {
LoaderBottomSheet . hideLoader ( ) ;
showCommonBottomSheetWithoutHeight ( context ,
child: Utils . getErrorWidget ( loadingText: err . toString ( ) ) ,
callBackFunc: ( ) { } ,
title: " " ,
isCloseButtonVisible: true ,
isDismissible: true ,
@ -249,7 +254,31 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
iconColor: AppColors . alertColor ,
iconSize: 18. h ,
icon: AppAssets . calendar ,
) ,
)
: Column (
children: [
" Your callback request has been successfully submitted! A doctor will contact you within ${ immediateLiveCareVM . selectedRescheduleTime = = 1 ? ' 30 ' : ' 60 ' } Mins "
. toText14 ( isBold: true ) ,
SizedBox ( height: 12. h ) ,
CustomButton (
text: LocaleKeys . backToHome . tr ( context: context ) ,
onPressed: ( ) {
Navigator . of ( context ) . pop ( ) ;
} ,
backgroundColor: AppColors . warningColorYellow . withValues ( alpha: 0.20 ) ,
borderColor: AppColors . warningColorYellow . withValues ( alpha: 0.01 ) ,
textColor: AppColors . alertColor ,
fontSize: 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
height: 40. h ,
iconColor: AppColors . alertColor ,
iconSize: 18. h ,
icon: AppAssets . homeBottom ,
)
] ,
) ,
SizedBox ( height: 8. h ) ,
] ,
) ,