|
|
|
|
@ -41,22 +41,22 @@ 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_rating_bar/flutter_rating_bar.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
|
|
|
|
|
|
class ToDo extends StatefulWidget {
|
|
|
|
|
PatientShareResponse patientShareResponse;
|
|
|
|
|
late PatientShareResponse patientShareResponse;
|
|
|
|
|
List<AppoitmentAllHistoryResultList> appoList = [];
|
|
|
|
|
List<AncillaryOrdersListModel> ancillaryLists = [];
|
|
|
|
|
List<OBGyneProcedureListResponse> obGyneAppoList = [];
|
|
|
|
|
var languageID;
|
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
|
late var languageID;
|
|
|
|
|
late MyInAppBrowser browser;
|
|
|
|
|
|
|
|
|
|
bool isShowAppBar = true;
|
|
|
|
|
Function onBackClick;
|
|
|
|
|
Function? onBackClick;
|
|
|
|
|
|
|
|
|
|
ToDo({@required this.isShowAppBar, this.onBackClick});
|
|
|
|
|
ToDo({required this.isShowAppBar, this.onBackClick});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_ToDoState createState() => _ToDoState();
|
|
|
|
|
@ -66,16 +66,16 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
|
|
|
|
|
List<ImagesInfo> imagesInfo =[];
|
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
|
CountdownTimerController controller;
|
|
|
|
|
late ToDoCountProviderModel toDoProvider;
|
|
|
|
|
late CountdownTimerController controller;
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
late ProjectViewModel projectViewModel;
|
|
|
|
|
late TabController _tabController;
|
|
|
|
|
|
|
|
|
|
String selectedPaymentMethod = "";
|
|
|
|
|
String selectedInstallments = "";
|
|
|
|
|
String tamaraPaymentStatus;
|
|
|
|
|
String tamaraOrderID;
|
|
|
|
|
late String tamaraPaymentStatus;
|
|
|
|
|
late String tamaraOrderID;
|
|
|
|
|
|
|
|
|
|
bool dataLoaded = false;
|
|
|
|
|
|
|
|
|
|
@ -116,7 +116,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
icon: "assets/images/new/bottom_nav/todo.svg",
|
|
|
|
|
description: TranslationBase.of(context).infoTodo,
|
|
|
|
|
onTap: widget.onBackClick,
|
|
|
|
|
onTap: widget!.onBackClick,
|
|
|
|
|
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
@ -192,7 +192,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
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
|
|
|
|
|
: widget.appoList[index].isLiveCareAppointment!
|
|
|
|
|
? SvgPicture.asset("assets/images/new/virtual.svg")
|
|
|
|
|
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
|
|
|
|
|
),
|
|
|
|
|
@ -204,7 +204,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
child: Text(
|
|
|
|
|
widget.appoList[index].clinicID == 265
|
|
|
|
|
? TranslationBase.of(context).covidTestTodo
|
|
|
|
|
: widget.appoList[index].isLiveCareAppointment
|
|
|
|
|
: 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)),
|
|
|
|
|
@ -213,8 +213,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
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) {
|
|
|
|
|
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' +
|
|
|
|
|
@ -256,7 +256,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
|
|
|
|
|
widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -264,7 +264,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
|
|
|
|
|
name: widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
|
|
|
|
|
url: widget.appoList[index].doctorImageURL,
|
|
|
|
|
width: 52,
|
|
|
|
|
height: 52,
|
|
|
|
|
@ -275,39 +275,60 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic),
|
|
|
|
|
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
|
|
|
|
|
widget.appoList[index].isLiveCareAppointment!
|
|
|
|
|
? MyRichText(
|
|
|
|
|
TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) +
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
|
|
|
|
|
" " +
|
|
|
|
|
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
|
|
|
|
|
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)) +
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
|
|
|
|
|
" " +
|
|
|
|
|
widget.appoList[index].startTime.substring(0, 5),
|
|
|
|
|
widget.appoList[index].startTime!.substring(0, 5),
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, 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,
|
|
|
|
|
// 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,
|
|
|
|
|
// ),
|
|
|
|
|
RatingBar(
|
|
|
|
|
initialRating: widget.appoList[index].actualDoctorRate!.toDouble(),
|
|
|
|
|
ratingWidget: RatingWidget(
|
|
|
|
|
full: Icon(
|
|
|
|
|
Icons.star,
|
|
|
|
|
color: Colors.yellow[700],
|
|
|
|
|
),
|
|
|
|
|
half: Icon(
|
|
|
|
|
Icons.star_half,
|
|
|
|
|
color: Colors.yellow[700],
|
|
|
|
|
),
|
|
|
|
|
empty: Icon(
|
|
|
|
|
Icons.star_border,
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onRatingUpdate: (double value) {},
|
|
|
|
|
unratedColor: Colors.grey[500],
|
|
|
|
|
updateOnDrag: false,
|
|
|
|
|
tapOnlyMode: false,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -354,7 +375,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
child: AppExpandableNotifier(
|
|
|
|
|
isExpand: true,
|
|
|
|
|
hasCounter: true,
|
|
|
|
|
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
|
|
|
|
|
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList!.length.toString() : "0",
|
|
|
|
|
title: TranslationBase.of(context).anicllaryOrders,
|
|
|
|
|
bodyWidget: widget.ancillaryLists.length != 0
|
|
|
|
|
? Container(
|
|
|
|
|
@ -365,18 +386,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
reverse: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID),
|
|
|
|
|
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(),
|
|
|
|
|
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),
|
|
|
|
|
date: DateUtil.convertStringToDate(widget.ancillaryLists[0]!.ancillaryOrderList![index].orderDate!),
|
|
|
|
|
isSortByClinic: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length,
|
|
|
|
|
itemCount: widget.ancillaryLists[0].ancillaryOrderList!.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
@ -430,7 +451,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]);
|
|
|
|
|
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID!, widget.obGyneAppoList[index].setupID!, widget.obGyneAppoList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
|
@ -451,7 +472,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
|
|
|
|
|
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -459,7 +480,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
|
|
|
|
|
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
|
|
|
|
|
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
|
|
|
|
|
width: 52,
|
|
|
|
|
height: 52,
|
|
|
|
|
@ -470,12 +491,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
|
|
|
|
|
MyRichText(
|
|
|
|
|
TranslationBase.of(context).orderDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0],
|
|
|
|
|
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate!)).split(" ")[0],
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -781,7 +802,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
|
|
|
|
|
|
|
|
|
|
if (doctorByHospital.length != 0) {
|
|
|
|
|
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
|
|
|
|
|
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
|
|
|
|
|
} else {
|
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
|
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
|
|
|
|
|
@ -848,7 +869,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.checkPatientNphiesEligibility(appo.projectID).then((res) {
|
|
|
|
|
service.checkPatientNphiesEligibility(appo.projectID!).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["isNphiesMatchedWithVida"]) {
|
|
|
|
|
getPatientShare(context, appo);
|
|
|
|
|
@ -878,7 +899,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
void continueAsCash(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.convertPatientToCash(appo.projectID).then((res) {
|
|
|
|
|
service.convertPatientToCash(appo.projectID!).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
getPatientShare(context, appo);
|
|
|
|
|
@ -895,11 +916,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
String errorMsg = "";
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
if (appo.isLiveCareAppointment) {
|
|
|
|
|
if (appo.isLiveCareAppointment!) {
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, service, appo);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
|
|
|
|
|
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID!, appo.projectID!, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
|
|
|
|
|
isInsured = res["IsInsured"];
|
|
|
|
|
@ -938,7 +959,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
|
|
|
|
|
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID!, appo.projectID!, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
|
openPaymentDialog(appo, widget.patientShareResponse);
|
|
|
|
|
@ -1002,7 +1023,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
|
|
|
|
|
child: Opacity(
|
|
|
|
|
opacity: a1.value,
|
|
|
|
|
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse),
|
|
|
|
|
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, onPaymentMethodSelected: (){},),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
@ -1010,10 +1031,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
barrierLabel: '',
|
|
|
|
|
context: context,
|
|
|
|
|
pageBuilder: (context, animation1, animation2) {})
|
|
|
|
|
pageBuilder: (context, animation1, animation2) { return SizedBox();})
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (value != null) {
|
|
|
|
|
navigateToPaymentMethod(context, value, appo);
|
|
|
|
|
navigateToPaymentMethod(context, value as PatientShareResponse, appo);
|
|
|
|
|
projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
|
|
|
|
|
} else {
|
|
|
|
|
projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
|
|
|
|
|
@ -1029,18 +1050,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
widget.browser.openPaymentBrowser(
|
|
|
|
|
amount,
|
|
|
|
|
"Appointment check in",
|
|
|
|
|
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
|
|
|
|
|
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!),
|
|
|
|
|
appo.projectID.toString(),
|
|
|
|
|
authenticatedUser.emailAddress,
|
|
|
|
|
authenticatedUser.emailAddress!,
|
|
|
|
|
paymentMethod[0],
|
|
|
|
|
authenticatedUser.patientType,
|
|
|
|
|
authenticatedUser.firstName,
|
|
|
|
|
authenticatedUser.firstName!,
|
|
|
|
|
authenticatedUser.patientID,
|
|
|
|
|
authenticatedUser,
|
|
|
|
|
widget.browser,
|
|
|
|
|
appo.isLiveCareAppointment,
|
|
|
|
|
appo.isLiveCareAppointment!,
|
|
|
|
|
"2",
|
|
|
|
|
appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
|
|
|
|
|
appo.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "",
|
|
|
|
|
context,
|
|
|
|
|
appo.appointmentDate,
|
|
|
|
|
appo.appointmentNo,
|
|
|
|
|
@ -1056,12 +1077,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
if (selectedPaymentMethod == "TAMARA") {
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
Uri uri = new Uri.dataFromString(url);
|
|
|
|
|
tamaraPaymentStatus = uri.queryParameters['status'];
|
|
|
|
|
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
|
|
|
|
|
tamaraPaymentStatus = uri.queryParameters['status']!;
|
|
|
|
|
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
|
|
|
|
|
} else {
|
|
|
|
|
Uri uri = new Uri.dataFromString(url);
|
|
|
|
|
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
|
|
|
|
|
tamaraOrderID = uri.queryParameters['orderId'];
|
|
|
|
|
tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
|
|
|
|
|
tamaraOrderID = uri.queryParameters['orderId']!;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1089,7 +1110,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
|
|
|
|
|
print("onBrowserExit Called!!!!");
|
|
|
|
|
if (selectedPaymentMethod == "TAMARA") {
|
|
|
|
|
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
|
|
|
|
|
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo);
|
|
|
|
|
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
|
|
|
|
|
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
|
|
|
|
|
// } else {
|
|
|
|
|
@ -1106,10 +1127,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
service.getTamaraPaymentStatus(orderID).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["status"].toString().toLowerCase() == "success") {
|
|
|
|
|
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo);
|
|
|
|
|
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], int.parse(selectedInstallments!), appo);
|
|
|
|
|
} else {
|
|
|
|
|
updateTamaraRequestStatus(
|
|
|
|
|
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
|
|
|
|
|
"Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallments!), appo);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
@ -1158,9 +1179,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
"AppointmentDate": appo.appointmentDate.toString(),
|
|
|
|
|
};
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) {
|
|
|
|
|
service.markAppointmentForTamara(appo.projectID!, appo.appointmentNo.toString()).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (appo.isLiveCareAppointment)
|
|
|
|
|
if (appo.isLiveCareAppointment!)
|
|
|
|
|
addVIDARequestInsert("0", tamaraOrderID, appo);
|
|
|
|
|
else
|
|
|
|
|
getAppoQR(context, appo);
|
|
|
|
|
@ -1173,12 +1194,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
String txn_ref;
|
|
|
|
|
num amount;
|
|
|
|
|
String payment_method;
|
|
|
|
|
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
|
|
|
|
|
num? amount;
|
|
|
|
|
String? payment_method;
|
|
|
|
|
final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) {
|
|
|
|
|
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), false, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
String paymentInfo = res['Response_Message'];
|
|
|
|
|
if (paymentInfo == 'Success') {
|
|
|
|
|
@ -1192,10 +1213,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
AppToast.showErrorToast(message: res['Response_Message']);
|
|
|
|
|
projectViewModel.analytics.appointment.payment_fail(
|
|
|
|
|
appointment_type: 'regular',
|
|
|
|
|
payment_method: payment_method,
|
|
|
|
|
payment_method: payment_method!,
|
|
|
|
|
clinic: appo.clinicName,
|
|
|
|
|
hospital: appo.projectName,
|
|
|
|
|
txn_amount: "$amount",
|
|
|
|
|
txn_amount: "$amount!",
|
|
|
|
|
txn_currency: currency,
|
|
|
|
|
error_type: res['Response_Message']);
|
|
|
|
|
}
|
|
|
|
|
@ -1212,7 +1233,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
addAdvancedNumberRequest(
|
|
|
|
|
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
|
|
|
|
|
Utils.isVidaPlusProject(projectViewModel, appo.projectID!)
|
|
|
|
|
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
|
|
|
|
|
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
|
|
|
|
|
paymentReference,
|
|
|
|
|
@ -1230,7 +1251,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (appo.isLiveCareAppointment)
|
|
|
|
|
if (appo.isLiveCareAppointment!)
|
|
|
|
|
addVIDARequestInsert(advanceNumber, paymentReference, appo);
|
|
|
|
|
else
|
|
|
|
|
getAppoQR(context, appo);
|
|
|
|
|
@ -1244,8 +1265,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
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)
|
|
|
|
|
.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();
|
|
|
|
|
@ -1260,7 +1281,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PaymentMethod(
|
|
|
|
|
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
|
|
|
|
|
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
patientShare: widget.patientShareResponse.patientShareWithTax)))
|
|
|
|
|
@ -1271,8 +1292,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
getPatientAppointmentHistory();
|
|
|
|
|
|
|
|
|
|
if (value != null) {
|
|
|
|
|
final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular';
|
|
|
|
|
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
|
|
|
|
|
final appType = appo.isLiveCareAppointment! ? 'livecare' : 'regular';
|
|
|
|
|
openPayment(value, projectViewModel.user!, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
|
|
|
|
|
projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -1281,11 +1302,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
confirmAppointment(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) {
|
|
|
|
|
service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
if (appo.isLiveCareAppointment) {
|
|
|
|
|
if (appo.isLiveCareAppointment!) {
|
|
|
|
|
insertLiveCareVIDARequest(appo);
|
|
|
|
|
} else {
|
|
|
|
|
getPatientAppointmentHistory();
|
|
|
|
|
@ -1304,8 +1325,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
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)
|
|
|
|
|
.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) {
|
|
|
|
|
|