Updates & fixes

merge-update-with-lab-changes
haroon amjad 2 years ago
parent e1718270eb
commit 63621b5fed

@ -48,9 +48,6 @@ import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID; var languageID;
bool isShowAppBar = true; bool isShowAppBar = true;
@ -86,6 +83,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isCash = false; bool isCash = false;
MyInAppBrowser browser; MyInAppBrowser browser;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -103,6 +104,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
// getToDoCount();
_tabController.dispose(); _tabController.dispose();
} }
@ -162,15 +164,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: widget.appoList.length.toString(), counter: appoList.length.toString(),
title: TranslationBase.of(context).appointments, title: TranslationBase.of(context).appointments,
bodyWidget: widget.appoList.length != 0 bodyWidget: appoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -190,12 +192,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 4.0), padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265 child: appoList[index].clinicID == 265
? Container( ? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
) )
: widget.appoList[index].isLiveCareAppointment : 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"),
), ),
@ -205,9 +207,9 @@ 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: Text( child: Text(
widget.appoList[index].clinicID == 265 appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo ? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment : appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo ? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo, : TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
@ -215,8 +217,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: new CountdownTimerController( controller:
endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime time) {
return time != null return time != null
? Text( ? Text(
@ -236,17 +238,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Container( child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
performNextAction(widget.appoList[index]); performNextAction(appoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction), color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1), border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
child: Text( child: Text(
getNextActionText(widget.appoList[index].nextAction), getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
), ),
@ -259,7 +261,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -267,8 +269,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL, url: appoList[index].doctorImageURL,
width: 52, width: 52,
height: 52, height: 52,
), ),
@ -278,32 +280,32 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ", // MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes // Timezone changes
widget.appoList[index].isLiveCareAppointment appoList[index].isLiveCareAppointment
? MyRichText( ? MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic) projectViewModel.isArabic)
: MyRichText( : MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), appoList[index].startTime.substring(0, 5),
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(), initialRating: appoList[index].actualDoctorRate.toDouble(),
size: 16.0, size: 16.0,
filledColor: Color(0XFFD02127), filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127),
@ -322,13 +324,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 12.0), padding: const EdgeInsets.only(top: 12.0),
child: Text( child: Text(
getNextActionDescription(widget.appoList[index].nextAction), getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]); navigateToAppointmentDetails(context, appoList[index]);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 0.0), padding: const EdgeInsets.only(top: 0.0),
@ -357,9 +359,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", counter: (ancillaryLists.isNotEmpty) ? ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders, title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0 bodyWidget: ancillaryLists.length != 0
? Container( ? Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: ListView.separated( child: ListView.separated(
@ -368,18 +370,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
reverse: true, reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID),
isInOutPatient: true, isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName, subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, itemCount: ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
), ),
) )
@ -389,13 +391,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
), ),
), ),
Container( Container(
child: widget.obGyneAppoList.length != 0 child: obGyneAppoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length, itemCount: obGyneAppoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -433,7 +435,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]); getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -454,7 +456,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -462,7 +464,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52, width: 52,
height: 52, height: 52,
@ -473,12 +475,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
MyRichText( MyRichText(
TranslationBase.of(context).orderDate + ": ", TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
], ],
), ),
), ),
@ -749,14 +751,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getOBGyneOrdersList(context).then((res) { service.getOBGyneOrdersList(context).then((res) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['HIS_OBGYNEProcedureGet_List'].length != 0) { if (res['HIS_OBGYNEProcedureGet_List'].length != 0) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
res['HIS_OBGYNEProcedureGet_List'].forEach((v) { res['HIS_OBGYNEProcedureGet_List'].forEach((v) {
widget.obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v)); obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v));
}); });
} else { } else {
// Navigator.of(context).popAndPushNamed(HOME); // Navigator.of(context).popAndPushNamed(HOME);
@ -822,24 +824,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse))); obGyneProcedureListResponse: obGyneProcedureListResponse)));
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2; int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, languageID, context).then((res) { service.getPatientAppointmentHistory(true, languageID, context).then((res) {
widget.appoList.clear(); appoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
widget.appoList.clear(); appoList.clear();
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
}); });
} }
if (res['AncillaryOrderList'].length != 0) { if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((item) { res['AncillaryOrderList'].forEach((item) {
widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
}); });
} }
dataLoaded = true; dataLoaded = true;
@ -847,7 +848,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
performNextAction(widget.appointment); performNextAction(widget.appointment);
widget.isFromMyAppointments = false; widget.isFromMyAppointments = false;
} }
}); setState(() {});
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.5.78+1 version: 4.5.79+1
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save