hot fixes

dq_and_master
Haroon Amjad 5 years ago
parent c67d41701d
commit b9269f525a

@ -84,17 +84,19 @@ class _MyAppointmentsState extends State<MyAppointments>
color: Colors.grey[600], color: Colors.grey[600],
thickness: 0.5, thickness: 0.5,
), ),
Expanded( isDataLoaded
child: new TabBarView( ? Expanded(
physics: NeverScrollableScrollPhysics(), child: new TabBarView(
children: [ physics: NeverScrollableScrollPhysics(),
isDataLoaded ? getBookedAppointments() : Container(), children: [
isDataLoaded ? getConfirmedAppointments() : Container(), getBookedAppointments(),
isDataLoaded ? getArrivedAppointments() : Container() getConfirmedAppointments(),
], getArrivedAppointments()
controller: _tabController, ],
), controller: _tabController,
), ),
)
: Container(),
]), ]),
), ),
); );
@ -114,19 +116,17 @@ class _MyAppointmentsState extends State<MyAppointments>
service.getPatientAppointmentHistory(false, context).then((res) { service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length); print(res['AppoimentAllHistoryResultList'].length);
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context); // setState(() {
setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) {
isDataLoaded = true; // isDataLoaded = true;
if (res['AppoimentAllHistoryResultList'].length != 0) { res['AppoimentAllHistoryResultList'].forEach((v) {
isDataLoaded = true; widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
res['AppoimentAllHistoryResultList'].forEach((v) { });
widget.appoList sortAppointmentList();
.add(new AppoitmentAllHistoryResultList.fromJson(v)); } else {}
}); // });
sortAppointmentList();
} else {}
});
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -256,6 +256,9 @@ class _MyAppointmentsState extends State<MyAppointments>
return; return;
} }
} }
setState(() {
isDataLoaded = true;
});
} }
Widget getBookedAppointments() { Widget getBookedAppointments() {
@ -419,6 +422,4 @@ class _MyAppointmentsState extends State<MyAppointments>
), ),
); );
} }
} }

@ -54,7 +54,6 @@ class _ToDoState extends State<ToDo> {
@override @override
void initState() { void initState() {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientData(); if (authenticatedUserObject.isLogin) getPatientData();
@ -69,6 +68,7 @@ class _ToDoState extends State<ToDo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList, appBarTitle: TranslationBase.of(context).todoList,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,

@ -256,6 +256,7 @@ class _Login extends State<Login> {
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
@ -268,7 +269,6 @@ class _Login extends State<Login> {
} }
else else
{ {
getToDoCount(),
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
FadePage( FadePage(

@ -1,11 +1,14 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class PatientSickLeavePage extends StatefulWidget { class PatientSickLeavePage extends StatefulWidget {
@override @override
@ -14,9 +17,14 @@ class PatientSickLeavePage extends StatefulWidget {
class _PatientSickLeavePageState extends State<PatientSickLeavePage> { class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png'));
return BaseView<PatientSickLeaveViewMode>( return BaseView<PatientSickLeaveViewMode>(
onModelReady: (model) => model.getSickLeave(), onModelReady: (model) => model.getSickLeave(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -37,16 +45,16 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
profileUrl: model.sickLeaveList[index].doctorImageURL, profileUrl: model.sickLeaveList[index].doctorImageURL,
rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), rat: model.sickLeaveList[index].actualDoctorRate.toDouble(),
subName: model.sickLeaveList[index].projectName, subName: model.sickLeaveList[index].projectName,
isInOutPatient: isInOutPatient: model.sickLeaveList[index].isInOutPatient,
model.sickLeaveList[index].isInOutPatient,
onEmailTap: () { onEmailTap: () {
model.sendSickLeaveEmail( showConfirmMessage(model, index);
message: TranslationBase.of(context).emailSentSuccessfully, // model.sendSickLeaveEmail(
requestNo: model.sickLeaveList[index].requestNo, // message: TranslationBase.of(context).emailSentSuccessfully,
doctorName: model.sickLeaveList[index].doctorName, // requestNo: model.sickLeaveList[index].requestNo,
projectName: model.sickLeaveList[index].projectName, // doctorName: model.sickLeaveList[index].doctorName,
setupID: model.sickLeaveList[index].setupID, // projectName: model.sickLeaveList[index].projectName,
projectID: model.sickLeaveList[index].projectID); // setupID: model.sickLeaveList[index].setupID,
// projectID: model.sickLeaveList[index].projectID);
}, },
), ),
), ),
@ -54,4 +62,22 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
), ),
); );
} }
void showConfirmMessage(PatientSickLeaveViewMode model, int index) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () {
model.sendSickLeaveEmail(
message: TranslationBase.of(context).emailSentSuccessfully,
requestNo: model.sickLeaveList[index].requestNo,
doctorName: model.sickLeaveList[index].doctorName,
projectName: model.sickLeaveList[index].projectName,
setupID: model.sickLeaveList[index].setupID,
projectID: model.sickLeaveList[index].projectID);
},
),
);
}
} }

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -51,29 +53,32 @@ class RadiologyDetailsPage extends StatelessWidget {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.infinity, width: double.infinity,
height: model.radImageURL.isNotEmpty ? MediaQuery.of(context).size.height * 0.2:MediaQuery.of(context).size.height * 0.15, height: finalRadiology.dIAPACSURL != ""
? MediaQuery.of(context).size.height * 0.2
: MediaQuery.of(context).size.height * 0.15,
color: Colors.grey[100], color: Colors.grey[100],
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Divider(), Divider(),
if(model.radImageURL.isNotEmpty) if (finalRadiology.dIAPACSURL != "")
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
launch(model.radImageURL);
},
label: TranslationBase.of(context).openRad,
backgroundColor: Colors.grey[800],
),
),
Container( Container(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(
onTap: () { onTap: () {
launch(model.radImageURL); showConfirmMessage(
finalRadiology: finalRadiology, model: model);
}, },
label: TranslationBase.of(context).openRad,
backgroundColor: Colors.grey[800],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () => model.sendRadReportEmail(
mes: TranslationBase.of(context).sendSuc,
finalRadiology: finalRadiology),
label: TranslationBase.of(context).sendCopyRad, label: TranslationBase.of(context).sendCopyRad,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
@ -84,4 +89,19 @@ class RadiologyDetailsPage extends StatelessWidget {
)), )),
); );
} }
void showConfirmMessage(
{FinalRadiology finalRadiology, RadiologyViewModel model}) {
showDialog(
context: AppGlobal.context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () {
model.sendRadReportEmail(
mes: TranslationBase.of(AppGlobal.context).sendSuc,
finalRadiology: finalRadiology);
},
),
);
}
} }

@ -145,16 +145,20 @@ class _HomeReportPageState extends State<HomeReportPage>
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderRequestList reportList: model.reportsOrderRequestList,
emailAddress: model.user.emailAddress
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderReadyList reportList: model.reportsOrderReadyList,
emailAddress: model.user.emailAddress
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderCompletedList reportList: model.reportsOrderCompletedList,
emailAddress: model.user.emailAddress
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderCanceledList reportList: model.reportsOrderCanceledList,
emailAddress: model.user.emailAddress
), ),
], ],
), ),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -13,9 +14,9 @@ import 'package:flutter/material.dart';
class ReportListWidget extends StatelessWidget { class ReportListWidget extends StatelessWidget {
final List<Reports> reportList; final List<Reports> reportList;
final Function onEmailTap; final String emailAddress;
ReportListWidget({@required this.reportList, this.onEmailTap}); ReportListWidget({@required this.reportList, this.emailAddress});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -67,10 +68,12 @@ class ReportListWidget extends StatelessWidget {
), ),
reportList[index].status == 2 reportList[index].status == 2
? Container( ? Container(
margin: EdgeInsets.only(left: 15.0, right: 15.0), margin:
EdgeInsets.only(left: 15.0, right: 15.0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
sendReportEmail(reportList[index]); showConfirmMessage(reportList[index]);
// sendReportEmail(reportList[index]);
}, },
child: Icon( child: Icon(
Icons.email, Icons.email,
@ -93,6 +96,18 @@ class ReportListWidget extends StatelessWidget {
); );
} }
void showConfirmMessage(Reports report) {
showDialog(
context: AppGlobal.context,
child: ConfirmSendEmailDialog(
email: emailAddress,
onTapSendEmail: () {
sendReportEmail(report);
},
),
);
}
sendReportEmail(Reports report) { sendReportEmail(Reports report) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
@ -108,7 +123,6 @@ class ReportListWidget extends StatelessWidget {
report.setupId) report.setupId)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(value["IsSent"]);
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);
}).catchError((err) { }).catchError((err) {

@ -162,15 +162,15 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
Form( Form(
key: formKey, key: formKey,
child: TextFields( child: TextFields(
hintText: "Notes", hintText: TranslationBase.of(context).notes,
minLines: 4, minLines: 4,
maxLines: 4, maxLines: 4,
validator: (value) { // validator: (value) {
if (value.isEmpty) // if (value.isEmpty)
return 'Please enter your note'; // return 'Please enter your note';
else if (rating == 0) return 'Rating cannot be \"0\"'; // else if (rating == 0) return 'Rating cannot be \"0\"';
return null; // return null;
}, // },
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
note = value; note = value;

@ -23,8 +23,9 @@ class DateUtil {
if (date != null) { if (date != null) {
try { try {
var dateT = date.split('/'); var dateT = date.split('/');
var year = dateT[2].substring(0,4); var year = dateT[2].substring(0, 4);
var dateP = DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); var dateP =
DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0]));
return dateP; return dateP;
} catch (e) { } catch (e) {
print(e); print(e);
@ -277,6 +278,24 @@ class DateUtil {
return ""; return "";
} }
static String getMonthDayYearLangDateFormatted(
DateTime dateTime, String lang) {
if (dateTime != null)
return lang == 'en'
? getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
" " +
dateTime.year.toString()
: dateTime.day.toString() +
" " +
getMonthArabic(dateTime.month) +
" " +
dateTime.year.toString();
else
return "";
}
/// get data formatted like 26/4/2020 /// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDateFormatted(DateTime dateTime) { static String getDayMonthYearDateFormatted(DateTime dateTime) {

@ -51,8 +51,12 @@ class TimeLineWidget extends StatelessWidget {
LargeAvatar( LargeAvatar(
onTap: () { onTap: () {
//AppointmentDetails //AppointmentDetails
Navigator.push(context, Navigator.push(
FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); context,
FadePage(
page: AppointmentDetails(
appo: appoitmentAllHistoryResul,
)));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul.doctorNameObj,
url: appoitmentAllHistoryResul.doctorImageURL, url: appoitmentAllHistoryResul.doctorImageURL,
@ -69,7 +73,8 @@ class TimeLineWidget extends StatelessWidget {
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
border: Border.all(color: Theme.of(context).primaryColor, width: 2), border: Border.all(
color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -80,7 +85,10 @@ class TimeLineWidget extends StatelessWidget {
height: 4, height: 4,
), ),
Texts( Texts(
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate)), DateUtil.getMonthDayYearLangDateFormatted(
DateUtil.convertStringToDate(
appoitmentAllHistoryResul.appointmentDate),
projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -97,7 +105,7 @@ class TimeLineWidget extends StatelessWidget {
) )
else else
Positioned( Positioned(
top:projectViewModel.isArabic ? 35 : 50, top: projectViewModel.isArabic ? 35 : 50,
child: Container( child: Container(
margin: EdgeInsets.only(left: 2, right: 2), margin: EdgeInsets.only(left: 2, right: 2),
child: Column( child: Column(
@ -109,9 +117,10 @@ class TimeLineWidget extends StatelessWidget {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
DateUtil.getMonthDayYearDateFormatted( DateUtil.getMonthDayYearLangDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(
appoitmentAllHistoryResul.appointmentDate)), appoitmentAllHistoryResul.appointmentDate),
projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -124,7 +133,8 @@ class TimeLineWidget extends StatelessWidget {
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
border: Border.all(color: Theme.of(context).primaryColor, width: 2), border: Border.all(
color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -137,9 +147,13 @@ class TimeLineWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
LargeAvatar( LargeAvatar(
onTap: (){ onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); context,
FadePage(
page: AppointmentDetails(
appo: appoitmentAllHistoryResul,
)));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul.doctorNameObj,
url: appoitmentAllHistoryResul.doctorImageURL, url: appoitmentAllHistoryResul.doctorImageURL,

Loading…
Cancel
Save