|
|
|
@ -55,6 +55,7 @@ import 'package:provider/provider.dart';
|
|
|
|
|
class ToDo extends StatefulWidget {
|
|
|
|
|
PatientShareResponse? patientShareResponse;
|
|
|
|
|
var languageID;
|
|
|
|
|
|
|
|
|
|
// MyInAppBrowser? browser;
|
|
|
|
|
bool? isShowAppBar = true;
|
|
|
|
|
Function()? onBackClick;
|
|
|
|
@ -176,189 +177,206 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
title: TranslationBase.of(context).appointments,
|
|
|
|
|
bodyWidget: appoList.length != 0
|
|
|
|
|
? ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
|
itemCount: 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,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
|
itemCount: 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: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
|
|
|
child: 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),
|
|
|
|
|
)
|
|
|
|
|
: appoList[index].isLiveCareAppointment!
|
|
|
|
|
? SvgPicture.asset("assets/images/new/virtual.svg")
|
|
|
|
|
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
|
|
|
child: 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),
|
|
|
|
|
)
|
|
|
|
|
: appoList[index].isLiveCareAppointment!
|
|
|
|
|
? 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(
|
|
|
|
|
appoList[index].clinicID == 265
|
|
|
|
|
? TranslationBase.of(context).covidTestTodo
|
|
|
|
|
: 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 + (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();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
appoList[index].clinicID == 265
|
|
|
|
|
? TranslationBase.of(context).covidTestTodo
|
|
|
|
|
: 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 + (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(appoList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: getNextActionButtonColor(appoList[index].nextAction),
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
getNextActionText(appoList[index].nextAction),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
performNextAction(appoList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: getNextActionButtonColor(appoList[index].nextAction),
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
getNextActionText(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(
|
|
|
|
|
appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
appoList[index].doctorTitle! + " " + 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: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
|
|
|
|
|
url: appoList[index].doctorImageURL,
|
|
|
|
|
width: 52,
|
|
|
|
|
height: 52,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 11),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName!, projectViewModel.isArabic),
|
|
|
|
|
// MyRichText(TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
|
|
|
|
|
|
|
|
|
|
// Timezone changes
|
|
|
|
|
appoList[index].isLiveCareAppointment!
|
|
|
|
|
? MyRichText(
|
|
|
|
|
TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
|
|
|
|
|
" " +
|
|
|
|
|
DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
|
|
|
|
|
projectViewModel.isArabic)
|
|
|
|
|
: MyRichText(
|
|
|
|
|
TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
|
|
|
|
|
" " +
|
|
|
|
|
appoList[index].startTime!.substring(0, 5),
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, appoList[index].projectName!, projectViewModel.isArabic),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RatingBar(
|
|
|
|
|
initialRating: appoList[index].actualDoctorRate.toDouble(),
|
|
|
|
|
itemSize: 16.0,
|
|
|
|
|
glowColor: Color(0XFFD02127),
|
|
|
|
|
unratedColor: Color(0XFFD02127),
|
|
|
|
|
allowHalfRating: true, ratingWidget: RatingWidget(full:Icon(Icons.star), half: Icon(Icons.star_half), empty: Icon( Icons.star_border)), onRatingUpdate: (double value) { },
|
|
|
|
|
// : Icons.star_half,
|
|
|
|
|
// ic: Icons.star,
|
|
|
|
|
// emptyIcon: Icons.star_border, itemBuilder: (BuildContext context, int index) { },
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
|
|
|
|
|
url: 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 + ": ", appoList[index].clinicName!, projectViewModel.isArabic),
|
|
|
|
|
// MyRichText(TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
|
|
|
|
|
|
|
|
|
|
// Timezone changes
|
|
|
|
|
appoList[index].isLiveCareAppointment!
|
|
|
|
|
? MyRichText(
|
|
|
|
|
TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
|
|
|
|
|
" " +
|
|
|
|
|
DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
|
|
|
|
|
projectViewModel.isArabic)
|
|
|
|
|
: MyRichText(
|
|
|
|
|
TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
|
|
|
|
|
" " +
|
|
|
|
|
appoList[index].startTime!.substring(0, 5),
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, appoList[index].projectName!, projectViewModel.isArabic),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RatingBar(
|
|
|
|
|
initialRating: appoList[index].actualDoctorRate.toDouble(),
|
|
|
|
|
itemSize: 16.0,
|
|
|
|
|
glowColor: Color(0XFFD02127),
|
|
|
|
|
unratedColor: Color(0XFFD02127),
|
|
|
|
|
ignoreGestures: true,
|
|
|
|
|
ratingWidget: RatingWidget(
|
|
|
|
|
full: Icon(
|
|
|
|
|
Icons.star,
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
),
|
|
|
|
|
half: Icon(
|
|
|
|
|
Icons.star_half,
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
),
|
|
|
|
|
empty: Icon(
|
|
|
|
|
Icons.star,
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
tapOnlyMode: true,
|
|
|
|
|
allowHalfRating: true,
|
|
|
|
|
onRatingUpdate: (double value) {},
|
|
|
|
|
// : Icons.star_half,
|
|
|
|
|
// ic: Icons.star,
|
|
|
|
|
// emptyIcon: Icons.star_border, itemBuilder: (BuildContext context, int index) { },
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 12.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getNextActionDescription(appoList[index].nextAction),
|
|
|
|
|
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
navigateToAppointmentDetails(context, 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),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 12.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getNextActionDescription(appoList[index].nextAction),
|
|
|
|
|
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
navigateToAppointmentDetails(context, 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),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -371,28 +389,28 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
title: TranslationBase.of(context).anicllaryOrders,
|
|
|
|
|
bodyWidget: ancillaryLists.length != 0
|
|
|
|
|
? Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
reverse: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList![index], ancillaryLists[0].projectID),
|
|
|
|
|
isInOutPatient: true,
|
|
|
|
|
name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
|
|
|
|
|
billNo: ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
|
|
|
|
|
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
|
|
|
|
|
subName: ancillaryLists[0].projectName,
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
|
|
|
|
|
isSortByClinic: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
reverse: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList![index], ancillaryLists[0].projectID),
|
|
|
|
|
isInOutPatient: true,
|
|
|
|
|
name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
|
|
|
|
|
billNo: ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
|
|
|
|
|
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
|
|
|
|
|
subName: ancillaryLists[0].projectName,
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
|
|
|
|
|
isSortByClinic: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: getNoDataWidget(context),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
@ -401,104 +419,104 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
Container(
|
|
|
|
|
child: obGyneAppoList.length != 0
|
|
|
|
|
? ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
|
itemCount: obGyneAppoList.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: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 0.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5.0, right: 5.0),
|
|
|
|
|
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
|
itemCount: obGyneAppoList.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: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 0.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5.0, right: 5.0),
|
|
|
|
|
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).walkinAppo,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).walkinAppo,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
|
|
|
|
|
Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getOBGyneDoctorsList(obGyneAppoList[index].projectID!, obGyneAppoList[index].setupID!, obGyneAppoList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: CustomColors.green,
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).bookNow,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getOBGyneDoctorsList(obGyneAppoList[index].projectID!, obGyneAppoList[index].setupID!, obGyneAppoList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: CustomColors.green,
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).bookNow,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
|
|
|
|
|
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
|
|
|
|
|
width: 52,
|
|
|
|
|
height: 52,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 11),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
|
|
|
|
|
MyRichText(
|
|
|
|
|
TranslationBase.of(context).orderDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
|
|
|
|
|
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
|
|
|
|
|
width: 52,
|
|
|
|
|
height: 52,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 11),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
|
|
|
|
|
MyRichText(
|
|
|
|
|
TranslationBase.of(context).orderDate + ": ",
|
|
|
|
|
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: getNoDataWidget(context),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -552,7 +570,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
performNextAction(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
switch (appo.nextAction) {
|
|
|
|
|
case 0:
|
|
|
|
|
// getAppoQR(context, appo);
|
|
|
|
|
// getAppoQR(context, appo);
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
confirmAppointment(appo);
|
|
|
|
@ -1075,7 +1093,12 @@ 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, isCashPatient: isCash, onPaymentMethodSelected: (){},),
|
|
|
|
|
child: PaymentDialog(
|
|
|
|
|
appo: appo,
|
|
|
|
|
patientShareResponse: patientShareResponse,
|
|
|
|
|
isCashPatient: isCash,
|
|
|
|
|
onPaymentMethodSelected: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
@ -1083,8 +1106,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
barrierLabel: '',
|
|
|
|
|
context: context,
|
|
|
|
|
pageBuilder: (context, animation1, animation2) =>SizedBox())
|
|
|
|
|
.then((value) {
|
|
|
|
|
pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) {
|
|
|
|
|
if (value != null) {
|
|
|
|
|
navigateToPaymentMethod(context, value as PatientShareResponse, appo);
|
|
|
|
|
projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
|
|
|
|
@ -1328,13 +1350,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PaymentMethod(
|
|
|
|
|
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
patientShare: widget.patientShareResponse!.patientShareWithTax)))
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PaymentMethod(
|
|
|
|
|
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
patientShare: widget.patientShareResponse!.patientShareWithTax)))
|
|
|
|
|
.then((value) {
|
|
|
|
|
print(value);
|
|
|
|
|
selectedPaymentMethod = value[0] ?? "";
|
|
|
|
@ -1414,26 +1436,26 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
|
|
|
|
|
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
|
|
|
|
|
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
|
|
|
|
|
orderDescription: "Appointment Payment",
|
|
|
|
|
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
|
|
|
|
|
merchantReference: transID,
|
|
|
|
|
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
|
|
|
|
|
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
onFailed: (failureResult) async {
|
|
|
|
|
log("failureResult: ${failureResult.toString()}");
|
|
|
|
|
AppToast.showErrorToast(message: failureResult.toString());
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (successResult) async {
|
|
|
|
|
log("Payfort: ${successResult.responseMessage}");
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
|
|
|
|
|
checkPaymentStatus(appo);
|
|
|
|
|
},
|
|
|
|
|
projectId: appo.projectID,
|
|
|
|
|
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
|
|
|
|
|
);
|
|
|
|
|
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
|
|
|
|
|
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
|
|
|
|
|
orderDescription: "Appointment Payment",
|
|
|
|
|
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
|
|
|
|
|
merchantReference: transID,
|
|
|
|
|
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
|
|
|
|
|
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
onFailed: (failureResult) async {
|
|
|
|
|
log("failureResult: ${failureResult.toString()}");
|
|
|
|
|
AppToast.showErrorToast(message: failureResult.toString());
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (successResult) async {
|
|
|
|
|
log("Payfort: ${successResult.responseMessage}");
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
|
|
|
|
|
checkPaymentStatus(appo);
|
|
|
|
|
},
|
|
|
|
|
projectId: appo.projectID,
|
|
|
|
|
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: "An error occurred while processing your request");
|
|
|
|
@ -1472,7 +1494,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
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), projectViewModel.isArabic ? 1 : 2, context)
|
|
|
|
|
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|