@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResp
import ' package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.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/QRCode.dart ' ;
import ' package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart ' ;
import ' package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart ' ;
import ' package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.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.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/avatar/large_avatar.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/in_app_browser/InAppBrowser.dart ' ;
import ' package:diplomaticquarterapp/widgets/my_rich_text.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/others/app_scaffold_widget.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_countdown_timer/countdown_timer_controller.dart ' ;
import ' package:flutter_countdown_timer/countdown_timer_controller.dart ' ;
import ' package:flutter_countdown_timer/current_remaining_time.dart ' ;
import ' package:flutter_countdown_timer/current_remaining_time.dart ' ;
import ' package:flutter_countdown_timer/flutter_countdown_timer.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:flutter_svg/flutter_svg.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:rating_bar/rating_bar.dart ' ;
import ' package:rating_bar/rating_bar.dart ' ;
@ -40,6 +45,7 @@ import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget {
class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse ;
PatientShareResponse patientShareResponse ;
List < AppoitmentAllHistoryResultList > appoList = [ ] ;
List < AppoitmentAllHistoryResultList > appoList = [ ] ;
List < AncillaryOrdersListModel > ancillaryLists = [ ] ;
List < OBGyneProcedureListResponse > obGyneAppoList = [ ] ;
List < OBGyneProcedureListResponse > obGyneAppoList = [ ] ;
var languageID ;
var languageID ;
MyInAppBrowser browser ;
MyInAppBrowser browser ;
@ -68,6 +74,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String tamaraPaymentStatus ;
String tamaraPaymentStatus ;
String tamaraOrderID ;
String tamaraOrderID ;
bool dataLoaded = false ;
@ override
@ override
void initState ( ) {
void initState ( ) {
widget . patientShareResponse = new PatientShareResponse ( ) ;
widget . patientShareResponse = new PatientShareResponse ( ) ;
@ -136,8 +144,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
physics: BouncingScrollPhysics ( ) ,
physics: BouncingScrollPhysics ( ) ,
controller: _tabController ,
controller: _tabController ,
children: < Widget > [
children: < Widget > [
SingleChildScrollView (
child: Column (
children: [
Container (
Container (
child: widget . appoList . length ! = 0
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 (
? ListView . builder (
scrollDirection: Axis . vertical ,
scrollDirection: Axis . vertical ,
shrinkWrap: true ,
shrinkWrap: true ,
@ -171,8 +188,6 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
: widget . appoList [ index ] . isLiveCareAppointment
: widget . appoList [ index ] . isLiveCareAppointment
? SvgPicture . asset ( " assets/images/new/virtual.svg " )
? SvgPicture . asset ( " assets/images/new/virtual.svg " )
: SvgPicture . asset ( " assets/images/new/hospital-visit.svg " ) ,
: SvgPicture . asset ( " assets/images/new/hospital-visit.svg " ) ,
/ / SvgPicture . asset ( " assets/images/new/virtual.svg " ) ,
) ,
) ,
Column (
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
@ -190,8 +205,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding (
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: CountdownTimer (
child: CountdownTimer (
controller:
controller: new CountdownTimerController (
new CountdownTimerController ( endTime: DateTime . now ( ) . millisecondsSinceEpoch + ( widget . appoList [ index ] . remaniningHoursTocanPay * 1000 ) * 60 ) ,
endTime: DateTime . now ( ) . millisecondsSinceEpoch + ( widget . appoList [ index ] . remaniningHoursTocanPay * 1000 ) * 60 ) ,
widgetBuilder: ( _ , CurrentRemainingTime time ) {
widgetBuilder: ( _ , CurrentRemainingTime time ) {
return time ! = null
return time ! = null
? Text (
? Text (
@ -310,7 +325,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Text (
child: Text (
TranslationBase . of ( context ) . moreDetails ,
TranslationBase . of ( context ) . moreDetails ,
style: TextStyle (
style: TextStyle (
fontSize: 10 , fontWeight: FontWeight . w600 , color: CustomColors . accentColor , letterSpacing: - 0.48 , height: 25 / 16 , decoration: TextDecoration . underline ) ,
fontSize: 10 ,
fontWeight: FontWeight . w600 ,
color: CustomColors . accentColor ,
letterSpacing: - 0.48 ,
height: 25 / 16 ,
decoration: TextDecoration . underline ) ,
) ,
) ,
) ,
) ,
) ,
) ,
@ -321,6 +341,43 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
)
)
: 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 (
Container (
child: widget . obGyneAppoList . length ! = 0
child: widget . obGyneAppoList . length ! = 0
? ListView . builder (
? ListView . builder (
@ -428,7 +485,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
) ,
) ,
) ,
) ,
SizedBox (
SizedBox (
height: 1 20.0,
height: 20.0,
) ,
) ,
] ,
] ,
) ,
) ,
@ -761,9 +818,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
res [ ' AppoimentAllHistoryResultList ' ] . forEach ( ( v ) {
res [ ' AppoimentAllHistoryResultList ' ] . forEach ( ( v ) {
widget . appoList . add ( new AppoitmentAllHistoryResultList . fromJson ( 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 {
} else {
AppToast . showErrorToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
AppToast . showErrorToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
@ -773,6 +834,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
err ! = null ? ? AppToast . showErrorToast ( message: err ) ;
err ! = null ? ? AppToast . showErrorToast ( message: err ) ;
} ) ;
} ) ;
/ / getAncillaryOrders ( ) ;
}
}
getPatientShare ( context , AppoitmentAllHistoryResultList appo ) {
getPatientShare ( context , AppoitmentAllHistoryResultList appo ) {
@ -807,9 +869,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
}
getAppoQR ( context , AppoitmentAllHistoryResultList appo ) {
getAppoQR ( context , AppoitmentAllHistoryResultList appo ) {
/ / GifLoaderDialogUtils . showMyDialog ( context ) ;
FlutterNfcKit . nfcAvailability . then ( ( value ) {
if ( value = = NFCAvailability . available ) {
PatientShareResponse patientShareResponse = new PatientShareResponse ( ) ;
PatientShareResponse patientShareResponse = new PatientShareResponse ( ) ;
patientShareResponse . doctorNameObj = appo . doctorNameObj ;
patientShareResponse . doctorNameObj = appo . doctorNameObj ;
patientShareResponse . doctorSpeciality = appo . doctorSpeciality ;
patientShareResponse . doctorSpeciality = appo . doctorSpeciality ;
patientShareResponse . projectName = appo . projectName ;
patientShareResponse . projectName = appo . projectName ;
@ -818,16 +880,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
patientShareResponse . clinicID = appo . clinicID ;
patientShareResponse . clinicID = appo . clinicID ;
patientShareResponse . projectID = appo . projectID ;
patientShareResponse . projectID = appo . projectID ;
patientShareResponse . isFollowup = appo . isFollowup ;
patientShareResponse . isFollowup = appo . isFollowup ;
/ / DoctorsListService service = new DoctorsListService ( ) ;
/ / service . generateAppointmentQR ( patientShareResponse , context ) . then ( ( res ) {
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
navigateToQR ( context , " " , patientShareResponse , appo ) ;
navigateToQR ( context , " " , patientShareResponse , appo ) ;
projectViewModel . analytics . todoList . to_do_list_check_in ( appo ) ;
projectViewModel . analytics . todoList . to_do_list_check_in ( appo ) ;
/ / } ) . catchError ( ( err ) {
} else {
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
Utils . showErrorToast ( TranslationBase . of ( context ) . NFCNotSupported ) ;
/ / print ( err ) ;
}
/ / } ) ;
} ) ;
}
}
Future navigateToQR ( context , String appoQR , PatientShareResponse patientShareResponse , AppoitmentAllHistoryResultList appintment ) async {
Future navigateToQR ( context , String appoQR , PatientShareResponse patientShareResponse , AppoitmentAllHistoryResultList appintment ) async {
@ -882,8 +940,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser ,
authenticatedUser ,
widget . browser ,
widget . browser ,
appo . isLiveCareAppointment ,
appo . isLiveCareAppointment ,
" 2 " ,
appo . isLiveCareAppointment ? widget . patientShareResponse . serviceID . toString ( ) : " 2 " ,
" " ,
appo . isLiveCareAppointment ? widget . patientShareResponse . clinicID . toString ( ) : " " ,
appo . appointmentDate ,
appo . appointmentDate ,
appo . appointmentNo ,
appo . appointmentNo ,
appo . clinicID ,
appo . clinicID ,
@ -943,8 +1001,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addAdvancedNumberRequestTamara ( String advanceNumber , String paymentReference , String appointmentID , AppoitmentAllHistoryResultList appo ) {
addAdvancedNumberRequestTamara ( String advanceNumber , String paymentReference , String appointmentID , AppoitmentAllHistoryResultList appo ) {
DoctorsListService service = new DoctorsListService ( ) ;
DoctorsListService service = new DoctorsListService ( ) ;
service . addAdvancedNumberRequest ( advanceNumber , paymentReference , appointmentID , context ) . then ( ( res ) {
service . addAdvancedNumberRequest ( advanceNumber , paymentReference , appointmentID , context ) . then ( ( res ) { } ) . catchError ( ( err ) {
} ) . catchError ( ( err ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
AppToast . showErrorToast ( message: err ) ;
AppToast . showErrorToast ( message: err ) ;
print ( err ) ;
print ( err ) ;
@ -1085,7 +1142,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert ( String advanceNumber , String paymentReference , AppoitmentAllHistoryResultList appo ) {
addVIDARequestInsert ( String advanceNumber , String paymentReference , AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
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 ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
getPatientAppointmentHistory ( ) ;
getPatientAppointmentHistory ( ) ;
} ) . catchError ( ( err ) {
} ) . catchError ( ( err ) {
@ -1142,7 +1202,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
insertLiveCareVIDARequest ( AppoitmentAllHistoryResultList appo ) {
insertLiveCareVIDARequest ( AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
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 ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
if ( res [ ' MessageStatus ' ] = = 1 ) {
if ( res [ ' MessageStatus ' ] = = 1 ) {
AppToast . showSuccessToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
AppToast . showSuccessToast ( message: res [ ' ErrorEndUserMessage ' ] ) ;
@ -1155,4 +1218,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
} ) ;
} ) ;
}
}
ancillaryOrdersDetails ( item , projectId ) {
Navigator . push (
context ,
FadePage (
page: AnicllaryOrdersDetails ( item . appointmentNo , item . orderNo , projectId ) ,
) ,
) ;
}
}
}