@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResp
import ' package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.dart ' ;
import ' package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart ' ;
import ' package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart ' ;
import ' package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart ' ;
import ' package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart ' ;
@ -25,14 +27,17 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import ' package:diplomaticquarterapp/uitl/utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/avatar/large_avatar.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart ' ;
import ' package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart ' ;
import ' package:diplomaticquarterapp/widgets/my_rich_text.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_countdown_timer/countdown_timer_controller.dart ' ;
import ' package:flutter_countdown_timer/current_remaining_time.dart ' ;
import ' package:flutter_countdown_timer/flutter_countdown_timer.dart ' ;
import ' package:flutter_nfc_kit/flutter_nfc_kit.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:rating_bar/rating_bar.dart ' ;
@ -40,6 +45,7 @@ import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse ;
List < AppoitmentAllHistoryResultList > appoList = [ ] ;
List < AncillaryOrdersListModel > ancillaryLists = [ ] ;
List < OBGyneProcedureListResponse > obGyneAppoList = [ ] ;
var languageID ;
MyInAppBrowser browser ;
@ -68,6 +74,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String tamaraPaymentStatus ;
String tamaraOrderID ;
bool dataLoaded = false ;
@ override
void initState ( ) {
widget . patientShareResponse = new PatientShareResponse ( ) ;
@ -136,190 +144,239 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
physics: BouncingScrollPhysics ( ) ,
controller: _tabController ,
children: < Widget > [
Container (
child: widget . appoList . length ! = 0
? ListView . builder (
scrollDirection: Axis . vertical ,
shrinkWrap: true ,
physics: ScrollPhysics ( ) ,
padding: EdgeInsets . all ( 0.0 ) ,
itemCount: widget . appoList . length ,
itemBuilder: ( context , index ) {
return Container (
width: double . infinity ,
margin: EdgeInsets . only ( left: 12.0 , right: 12.0 , top: 12.0 ) ,
decoration: cardRadius ( 12 ) ,
padding: EdgeInsets . all ( 16 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Expanded (
flex: 2 ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: const EdgeInsets . only ( top: 4.0 ) ,
child: widget . appoList [ index ] . clinicID = = 265
? Container (
margin: EdgeInsets . only ( left: 5.0 , right: 5.0 ) ,
child: SvgPicture . asset ( " assets/images/new/CoronaIcon.svg " , width: 35.0 , height: 35.0 ) ,
)
: widget . appoList [ index ] . isLiveCareAppointment
? SvgPicture . asset ( " assets/images/new/virtual.svg " )
: SvgPicture . asset ( " assets/images/new/hospital-visit.svg " ) ,
/ / SvgPicture . asset ( " assets/images/new/virtual.svg " ) ,
) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: Text (
widget . appoList [ index ] . clinicID = = 265
? TranslationBase . of ( context ) . covidTestTodo
SingleChildScrollView (
child: Column (
children: [
Container (
margin: EdgeInsets . only ( top: 12 ) ,
child: AppExpandableNotifier (
isExpand: true ,
hasCounter: true ,
counter: widget . appoList . length . toString ( ) ,
title: TranslationBase . of ( context ) . appointments ,
bodyWidget: widget . appoList . length ! = 0
? ListView . builder (
scrollDirection: Axis . vertical ,
shrinkWrap: true ,
physics: ScrollPhysics ( ) ,
padding: EdgeInsets . all ( 0.0 ) ,
itemCount: widget . appoList . length ,
itemBuilder: ( context , index ) {
return Container (
width: double . infinity ,
margin: EdgeInsets . only ( left: 12.0 , right: 12.0 , top: 12.0 ) ,
decoration: cardRadius ( 12 ) ,
padding: EdgeInsets . all ( 16 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Expanded (
flex: 2 ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: const EdgeInsets . only ( top: 4.0 ) ,
child: widget . appoList [ index ] . clinicID = = 265
? Container (
margin: EdgeInsets . only ( left: 5.0 , right: 5.0 ) ,
child: SvgPicture . asset ( " assets/images/new/CoronaIcon.svg " , width: 35.0 , height: 35.0 ) ,
)
: widget . appoList [ index ] . isLiveCareAppointment
? TranslationBase . of ( context ) . liveCareAppo
: TranslationBase . of ( context ) . walkinAppo ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: Color ( 0xff2B353E ) , letterSpacing: - 0.48 ) ) ,
? SvgPicture . asset ( " assets/images/new/virtual.svg " )
: SvgPicture . asset ( " assets/images/new/hospital-visit.svg " ) ,
) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: Text (
widget . appoList [ index ] . clinicID = = 265
? TranslationBase . of ( context ) . covidTestTodo
: widget . appoList [ index ] . isLiveCareAppointment
? TranslationBase . of ( context ) . liveCareAppo
: TranslationBase . of ( context ) . walkinAppo ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: Color ( 0xff2B353E ) , letterSpacing: - 0.48 ) ) ,
) ,
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: CountdownTimer (
controller: new CountdownTimerController (
endTime: DateTime . now ( ) . millisecondsSinceEpoch + ( widget . appoList [ index ] . remaniningHoursTocanPay * 1000 ) * 60 ) ,
widgetBuilder: ( _ , CurrentRemainingTime time ) {
return time ! = null
? Text (
' ${ time . days ! = null ? time . days : " 0 " } : ${ time . hours ! = null ? time . hours . toString ( ) . length = = 1 ? " 0 " + time . hours . toString ( ) : time . hours : " 00 " } : ${ time . min } : ${ time . sec } \n ' +
TranslationBase . of ( context ) . upcomingTimeLeft ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: CustomColors . accentColor , letterSpacing: - 0.48 ) )
: Container ( ) ;
} ,
) ,
) ,
] ,
) ,
] ,
) ,
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: CountdownTimer (
controller:
new CountdownTimerController ( endTime: DateTime . now ( ) . millisecondsSinceEpoch + ( widget . appoList [ index ] . remaniningHoursTocanPay * 1000 ) * 60 ) ,
widgetBuilder: ( _ , CurrentRemainingTime time ) {
return time ! = null
? Text (
' ${ time . days ! = null ? time . days : " 0 " } : ${ time . hours ! = null ? time . hours . toString ( ) . length = = 1 ? " 0 " + time . hours . toString ( ) : time . hours : " 00 " } : ${ time . min } : ${ time . sec } \n ' +
TranslationBase . of ( context ) . upcomingTimeLeft ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: CustomColors . accentColor , letterSpacing: - 0.48 ) )
: Container ( ) ;
) ,
Expanded (
child: Container (
child: InkWell (
onTap: ( ) {
performNextAction ( widget . appoList [ index ] ) ;
} ,
child: Container (
padding: EdgeInsets . symmetric ( vertical: 8 , horizontal: 14 ) ,
decoration: BoxDecoration (
color: getNextActionButtonColor ( widget . appoList [ index ] . nextAction ) ,
border: Border . all ( color: Colors . white , width: 1 ) ,
borderRadius: BorderRadius . circular ( 6 ) ,
) ,
child: Text (
getNextActionText ( widget . appoList [ index ] . nextAction ) ,
textAlign: TextAlign . center ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: Colors . white , letterSpacing: - 0.4 ) ,
) ,
) ,
) ,
) ,
] ,
) ,
] ,
) ,
Padding (
padding: const EdgeInsets . only ( top: 8.0 ) ,
child: Text (
widget . appoList [ index ] . doctorTitle + " " + widget . appoList [ index ] . doctorNameObj ,
style: TextStyle ( fontSize: 16 , fontWeight: FontWeight . w600 , color: Color ( 0xff2E303A ) , letterSpacing: - 0.64 , height: 25 / 16 ) ,
) ,
] ,
) ,
) ,
Expanded (
child: Container (
child: InkWell (
) ,
Row (
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
LargeAvatar (
name: widget . appoList [ index ] . doctorTitle + " " + widget . appoList [ index ] . doctorNameObj ,
url: widget . appoList [ index ] . doctorImageURL ,
width: 52 ,
height: 52 ,
) ,
SizedBox ( width: 11 ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
MyRichText ( TranslationBase . of ( context ) . clinic + " : " , widget . appoList [ index ] . clinicName , projectViewModel . isArabic ) ,
/ / MyRichText ( TranslationBase . of ( context ) . appointmentDate + " : " ,
/ / DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) + " " + widget . appoList [ index ] . startTime . substring ( 0 , 5 ) , projectViewModel . isArabic ) ,
/ / Timezone changes
widget . appoList [ index ] . isLiveCareAppointment
? MyRichText (
TranslationBase . of ( context ) . appointmentDate + " : " ,
DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) +
" " +
DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) . toString ( ) . split ( " " ) [ 1 ] . substring ( 0 , 5 ) ,
projectViewModel . isArabic )
: MyRichText (
TranslationBase . of ( context ) . appointmentDate + " : " ,
DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) +
" " +
widget . appoList [ index ] . startTime . substring ( 0 , 5 ) ,
projectViewModel . isArabic ) ,
MyRichText ( TranslationBase . of ( context ) . branch , widget . appoList [ index ] . projectName , projectViewModel . isArabic ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
mainAxisSize: MainAxisSize . max ,
children: < Widget > [
RatingBar . readOnly (
initialRating: widget . appoList [ index ] . actualDoctorRate . toDouble ( ) ,
size: 16.0 ,
filledColor: Color ( 0XFFD02127 ) ,
emptyColor: Color ( 0XFFD02127 ) ,
isHalfAllowed: true ,
halfFilledIcon: Icons . star_half ,
filledIcon: Icons . star ,
emptyIcon: Icons . star_border ,
) ,
] ,
) ,
] ,
) ,
) ,
] ,
) ,
Padding (
padding: const EdgeInsets . only ( top: 12.0 ) ,
child: Text (
getNextActionDescription ( widget . appoList [ index ] . nextAction ) ,
style: TextStyle ( fontSize: 10 , fontWeight: FontWeight . w600 , color: Color ( 0xff2E303A ) , letterSpacing: - 0.48 , height: 25 / 16 ) ,
) ,
) ,
InkWell (
onTap: ( ) {
performNextAction ( widget . appoList [ index ] ) ;
navigateToAppointmentDetails( context , widget . appoList [ index ] ) ;
} ,
child: Container (
padding: EdgeInsets . symmetric ( vertical: 8 , horizontal: 14 ) ,
decoration: BoxDecoration (
color: getNextActionButtonColor ( widget . appoList [ index ] . nextAction ) ,
border: Border . all ( color: Colors . white , width: 1 ) ,
borderRadius: BorderRadius . circular ( 6 ) ,
) ,
child: Padding (
padding: const EdgeInsets . only ( top: 0.0 ) ,
child: Text (
getNextActionText ( widget . appoList [ index ] . nextAction ) ,
textAlign: TextAlign . center ,
style: TextStyle ( fontSize: 12 , fontWeight: FontWeight . w600 , color: Colors . white , letterSpacing: - 0.4 ) ,
TranslationBase . of ( context ) . moreDetails ,
style: TextStyle (
fontSize: 10 ,
fontWeight: FontWeight . w600 ,
color: CustomColors . accentColor ,
letterSpacing: - 0.48 ,
height: 25 / 16 ,
decoration: TextDecoration . underline ) ,
) ,
) ,
) ,
) ,
) ,
] ,
) ,
Padding (
padding: const EdgeInsets . only ( top: 8.0 ) ,
child: Text (
widget . appoList [ index ] . doctorTitle + " " + widget . appoList [ index ] . doctorNameObj ,
style: TextStyle ( fontSize: 16 , fontWeight: FontWeight . w600 , color: Color ( 0xff2E303A ) , letterSpacing: - 0.64 , height: 25 / 16 ) ,
) ,
) ,
Row (
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
LargeAvatar (
name: widget . appoList [ index ] . doctorTitle + " " + widget . appoList [ index ] . doctorNameObj ,
url: widget . appoList [ index ] . doctorImageURL ,
width: 52 ,
height: 52 ,
) ,
SizedBox ( width: 11 ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
MyRichText ( TranslationBase . of ( context ) . clinic + " : " , widget . appoList [ index ] . clinicName , projectViewModel . isArabic ) ,
/ / MyRichText ( TranslationBase . of ( context ) . appointmentDate + " : " ,
/ / DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) + " " + widget . appoList [ index ] . startTime . substring ( 0 , 5 ) , projectViewModel . isArabic ) ,
/ / Timezone changes
widget . appoList [ index ] . isLiveCareAppointment
? MyRichText (
TranslationBase . of ( context ) . appointmentDate + " : " ,
DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) +
" " +
DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) . toString ( ) . split ( " " ) [ 1 ] . substring ( 0 , 5 ) ,
projectViewModel . isArabic )
: MyRichText (
TranslationBase . of ( context ) . appointmentDate + " : " ,
DateUtil . getDayMonthYearDateFormatted ( DateUtil . convertStringToDate ( widget . appoList [ index ] . appointmentDate ) ) +
" " +
widget . appoList [ index ] . startTime . substring ( 0 , 5 ) ,
projectViewModel . isArabic ) ,
MyRichText ( TranslationBase . of ( context ) . branch , widget . appoList [ index ] . projectName , projectViewModel . isArabic ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
mainAxisSize: MainAxisSize . max ,
children: < Widget > [
RatingBar . readOnly (
initialRating: widget . appoList [ index ] . actualDoctorRate . toDouble ( ) ,
size: 16.0 ,
filledColor: Color ( 0XFFD02127 ) ,
emptyColor: Color ( 0XFFD02127 ) ,
isHalfAllowed: true ,
halfFilledIcon: Icons . star_half ,
filledIcon: Icons . star ,
emptyIcon: Icons . star_border ,
) ,
] ,
) ,
] ,
) ,
) ,
] ,
) ,
Padding (
padding: const EdgeInsets . only ( top: 12.0 ) ,
child: Text (
getNextActionDescription ( widget . appoList [ index ] . nextAction ) ,
style: TextStyle ( fontSize: 10 , fontWeight: FontWeight . w600 , color: Color ( 0xff2E303A ) , letterSpacing: - 0.48 , height: 25 / 16 ) ,
) ,
) ,
InkWell (
onTap: ( ) {
navigateToAppointmentDetails ( context , widget . appoList [ index ] ) ;
} ,
child: Padding (
padding: const EdgeInsets . only ( top: 0.0 ) ,
child: Text (
TranslationBase . of ( context ) . moreDetails ,
style: TextStyle (
fontSize: 10 , fontWeight: FontWeight . w600 , color: CustomColors . accentColor , letterSpacing: - 0.48 , height: 25 / 16 , decoration: TextDecoration . underline ) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ;
} ,
)
: getNoDataWidget ( context ) ,
) ;
} ,
)
: getNoDataWidget ( context ) ,
) ,
) ,
Container (
margin: EdgeInsets . only ( top: 12 ) ,
child: AppExpandableNotifier (
isExpand: true ,
hasCounter: true ,
counter: ( widget . ancillaryLists . isNotEmpty ) ? widget . ancillaryLists [ 0 ] . ancillaryOrderList . length . toString ( ) : " 0 " ,
title: TranslationBase . of ( context ) . anicllaryOrders ,
bodyWidget: widget . ancillaryLists . length ! = 0
? Container (
padding: EdgeInsets . all ( 12 ) ,
child: ListView . separated (
shrinkWrap: true ,
physics: NeverScrollableScrollPhysics ( ) ,
reverse: true ,
itemBuilder: ( context , index ) {
return DoctorCard (
onTap: ( ) = > ancillaryOrdersDetails ( widget . ancillaryLists [ 0 ] . ancillaryOrderList [ index ] , widget . ancillaryLists [ 0 ] . projectID ) ,
isInOutPatient: true ,
name: TranslationBase . of ( context ) . dr . toString ( ) + " " + ( widget . ancillaryLists [ 0 ] . ancillaryOrderList [ index ] . doctorName ) ,
billNo: widget . ancillaryLists [ 0 ] . ancillaryOrderList [ index ] . orderNo . toString ( ) ,
profileUrl: " https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png " ,
subName: widget . ancillaryLists [ 0 ] . projectName ,
isLiveCareAppointment: false ,
date: DateUtil . convertStringToDate ( widget . ancillaryLists [ 0 ] . ancillaryOrderList [ index ] . orderDate ) ,
isSortByClinic: true ,
) ;
} ,
itemCount: widget . ancillaryLists [ 0 ] . ancillaryOrderList . length ,
separatorBuilder: ( context , index ) = > SizedBox ( height: 14 ) ,
) ,
)
: getNoDataWidget ( context ) ,
) ) ,
] ,
) ,
) ,
Container (
child: widget . obGyneAppoList . length ! = 0
@ -428,7 +485,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
) ,
) ,
SizedBox (
height: 1 20.0,
height: 20.0,
) ,
] ,
) ,
@ -761,9 +818,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
res [ ' AppoimentAllHistoryResultList ' ] . forEach ( ( v ) {
widget . appoList . add ( new AppoitmentAllHistoryResultList . fromJson ( v ) ) ;
} ) ;
} else {
/ / Navigator . of ( context ) . popAndPushNamed ( HOME ) ;
}
if ( res [ ' AncillaryOrderList ' ] . length ! = 0 ) {
res [ ' AncillaryOrderList ' ] . forEach ( ( item ) {
widget . ancillaryLists . add ( AncillaryOrdersListModel . fromJson ( item ) ) ;
} ) ;
}
dataLoaded = true ;
} ) ;
} else {
AppToast . showErrorToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
@ -773,6 +834,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils . hideDialog ( context ) ;
err ! = null ? ? AppToast . showErrorToast ( message: err ) ;
} ) ;
/ / getAncillaryOrders ( ) ;
}
getPatientShare ( context , AppoitmentAllHistoryResultList appo ) {
@ -807,27 +869,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
getAppoQR ( context , AppoitmentAllHistoryResultList appo ) {
/ / GifLoaderDialogUtils . showMyDialog ( context ) ;
PatientShareResponse patientShareResponse = new PatientShareResponse ( ) ;
patientShareResponse . doctorNameObj = appo . doctorNameObj ;
patientShareResponse . doctorSpeciality = appo . doctorSpeciality ;
patientShareResponse . projectName = appo . projectName ;
patientShareResponse . appointmentDate = appo . appointmentDate ;
patientShareResponse . appointmentNo = appo . appointmentNo ;
patientShareResponse . clinicID = appo . clinicID ;
patientShareResponse . projectID = appo . projectID ;
patientShareResponse . isFollowup = appo . isFollowup ;
/ / DoctorsListService service = new DoctorsListService ( ) ;
/ / service . generateAppointmentQR ( patientShareResponse , context ) . then ( ( res ) {
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
navigateToQR ( context , " " , patientShareResponse , appo ) ;
projectViewModel . analytics . todoList . to_do_list_check_in ( appo ) ;
/ / } ) . catchError ( ( err ) {
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
/ / print ( err ) ;
/ / } ) ;
FlutterNfcKit . nfcAvailability . then ( ( value ) {
if ( value = = NFCAvailability . available ) {
PatientShareResponse patientShareResponse = new PatientShareResponse ( ) ;
patientShareResponse . doctorNameObj = appo . doctorNameObj ;
patientShareResponse . doctorSpeciality = appo . doctorSpeciality ;
patientShareResponse . projectName = appo . projectName ;
patientShareResponse . appointmentDate = appo . appointmentDate ;
patientShareResponse . appointmentNo = appo . appointmentNo ;
patientShareResponse . clinicID = appo . clinicID ;
patientShareResponse . projectID = appo . projectID ;
patientShareResponse . isFollowup = appo . isFollowup ;
navigateToQR ( context , " " , patientShareResponse , appo ) ;
projectViewModel . analytics . todoList . to_do_list_check_in ( appo ) ;
} else {
Utils . showErrorToast ( TranslationBase . of ( context ) . NFCNotSupported ) ;
}
} ) ;
}
Future navigateToQR ( context , String appoQR , PatientShareResponse patientShareResponse , AppoitmentAllHistoryResultList appintment ) async {
@ -882,8 +940,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser ,
widget . browser ,
appo . isLiveCareAppointment ,
" 2 " ,
" " ,
appo . isLiveCareAppointment ? widget . patientShareResponse . serviceID . toString ( ) : " 2 " ,
appo . isLiveCareAppointment ? widget . patientShareResponse . clinicID . toString ( ) : " " ,
appo . appointmentDate ,
appo . appointmentNo ,
appo . clinicID ,
@ -908,23 +966,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
/ / if ( selectedPaymentMethod ! = " TAMARA " ) {
MyInAppBrowser . successURLS . forEach ( ( element ) {
if ( url . contains ( element ) ) {
if ( widget . browser . isOpened ( ) ) widget . browser . close ( ) ;
MyInAppBrowser . isPaymentDone = true ;
return ;
}
} ) ;
MyInAppBrowser . successURLS . forEach ( ( element ) {
if ( url . contains ( element ) ) {
if ( widget . browser . isOpened ( ) ) widget . browser . close ( ) ;
MyInAppBrowser . isPaymentDone = true ;
return ;
}
} ) ;
/ / }
/ / if ( selectedPaymentMethod ! = " TAMARA " ) {
MyInAppBrowser . errorURLS . forEach ( ( element ) {
if ( url . contains ( element ) ) {
if ( widget . browser . isOpened ( ) ) widget . browser . close ( ) ;
MyInAppBrowser . isPaymentDone = false ;
return ;
}
} ) ;
MyInAppBrowser . errorURLS . forEach ( ( element ) {
if ( url . contains ( element ) ) {
if ( widget . browser . isOpened ( ) ) widget . browser . close ( ) ;
MyInAppBrowser . isPaymentDone = false ;
return ;
}
} ) ;
/ / }
}
@ -943,8 +1001,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addAdvancedNumberRequestTamara ( String advanceNumber , String paymentReference , String appointmentID , AppoitmentAllHistoryResultList appo ) {
DoctorsListService service = new DoctorsListService ( ) ;
service . addAdvancedNumberRequest ( advanceNumber , paymentReference , appointmentID , context ) . then ( ( res ) {
} ) . catchError ( ( err ) {
service . addAdvancedNumberRequest ( advanceNumber , paymentReference , appointmentID , context ) . then ( ( res ) { } ) . catchError ( ( err ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
AppToast . showErrorToast ( message: err ) ;
print ( err ) ;
@ -1085,7 +1142,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert ( String advanceNumber , String paymentReference , AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
service . insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate , Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , context ) . then ( ( res ) {
service
. insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate ,
Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , context )
. then ( ( res ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
getPatientAppointmentHistory ( ) ;
} ) . catchError ( ( err ) {
@ -1142,7 +1202,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
insertLiveCareVIDARequest ( AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
service . insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate , Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , context ) . then ( ( res ) {
service
. insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate ,
Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , context )
. then ( ( res ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
if ( res [ ' MessageStatus ' ] = = 1 ) {
AppToast . showSuccessToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
@ -1155,4 +1218,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils . hideDialog ( context ) ;
} ) ;
}
ancillaryOrdersDetails ( item , projectId ) {
Navigator . push (
context ,
FadePage (
page: AnicllaryOrdersDetails ( item . appointmentNo , item . orderNo , projectId ) ,
) ,
) ;
}
}