hot fixes

dq_and_master
Haroon Amjad 5 years ago
parent 81b51bef51
commit 5606c88715

@ -1162,4 +1162,8 @@ const Map localizedValues = {
"en": "Please rate the clinic", "en": "Please rate the clinic",
"ar": "يرجى تقييم العيادة" "ar": "يرجى تقييم العيادة"
}, },
"fetch-data": {
"en": "Fetch Data",
"ar": "تحديث الان"
},
}; };

@ -100,8 +100,6 @@ class ReportsService extends BaseService {
String requestDate, String requestDate,
String invoiceNo, String invoiceNo,
int projectID, int projectID,
String printID,
String procedureID,
String stamp, String stamp,
String setupID) async { String setupID) async {
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
@ -114,19 +112,24 @@ class ReportsService extends BaseService {
body['DateofBirth'] = user.dateofBirth; body['DateofBirth'] = user.dateofBirth;
body['PatientIditificationNum'] = user.patientIdentificationNo; body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientMobileNumber'] = user.mobileNumber; body['PatientMobileNumber'] = user.mobileNumber;
body['PatientName'] = user.firstName + " " + user.firstName; body['PatientName'] = user.firstName + " " + user.lastName;
body['ProjectName'] = projectName; body['ProjectName'] = projectName;
body['ClinicName'] = clinicName; body['ClinicName'] = clinicName;
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['PrintedByName'] = user.firstName + " " + user.firstName; body['PrintedByName'] = user.firstName + " " + user.lastName;
dynamic response;
hasError = false; hasError = false;
await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL,
onSuccess: (dynamic response, int statusCode) {}, onSuccess: (dynamic res, int statusCode) {
response = res;
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return response;
} }
} }

@ -167,7 +167,8 @@ class _InsuranceCardState extends State<InsuranceCard> {
onTap: () => { onTap: () => {
getDetails(model.insurance[index]) getDetails(model.insurance[index])
}, },
label: TranslationBase.of(context).seeDetails, label: TranslationBase.of(context)
.seeDetails,
textColor: Colors.white, textColor: Colors.white,
), ),
width: double.infinity, width: double.infinity,

@ -1,5 +1,10 @@
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
@ -15,6 +20,7 @@ class InsuranceUpdate extends StatefulWidget {
class _InsuranceUpdateState extends State<InsuranceUpdate> class _InsuranceUpdateState extends State<InsuranceUpdate>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
@override @override
void initState() { void initState() {
@ -103,94 +109,109 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
itemCount: model.getAllSharedRecordsByStatusResponse itemCount: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length, .getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return model
margin: EdgeInsets.all(10.0), .getAllSharedRecordsByStatusResponse
child: Card( .getAllSharedRecordsByStatusList[
margin: index]
EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), .status ==
color: Colors.white, 3
shape: RoundedRectangleBorder( ? Container(
borderRadius: BorderRadius.circular(10), margin: EdgeInsets.all(10.0),
), child: Card(
child: Container( margin: EdgeInsets.fromLTRB(
width: MediaQuery.of(context).size.width, 8.0, 16.0, 8.0, 8.0),
padding: EdgeInsets.all(10.0), color: Colors.white,
child: Row( shape: RoundedRectangleBorder(
crossAxisAlignment: borderRadius:
CrossAxisAlignment.start, BorderRadius.circular(10),
mainAxisSize: MainAxisSize.max, ),
children: <Widget>[ child: Container(
Expanded( width:
flex: 3, MediaQuery.of(context).size.width,
child: Container( padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only( child: Row(
top: 2.0, crossAxisAlignment:
left: 10.0, CrossAxisAlignment.start,
right: 20.0), mainAxisSize: MainAxisSize.max,
child: Column( children: <Widget>[
crossAxisAlignment: Expanded(
CrossAxisAlignment.start, flex: 3,
children: <Widget>[ child: Container(
Texts( margin: EdgeInsets.only(
model top: 2.0,
.getAllSharedRecordsByStatusResponse left: 10.0,
.getAllSharedRecordsByStatusList[ right: 20.0),
index] child: Column(
.patientName, crossAxisAlignment:
fontSize: 14, CrossAxisAlignment
color: Colors.black, .start,
fontWeight: FontWeight.w500, children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
), ),
SizedBox( ),
height: 8, if (false)
Expanded(
flex: 2,
child: Container(
margin:
EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase
.of(context)
.fetchData,
small: true,
textColor:
Colors.white,
onTap: () {
getDetails(
model);
},
),
),
],
),
), ),
Texts( )
TranslationBase.of(context) ],
.fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
)
],
),
), ),
), ),
if (false) ),
Expanded( )
flex: 2, : Container();
child: Container(
// height: MediaQuery.of(context).size.height * 0.12,
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase.of(
context)
.updateInsurance,
small: true,
textColor: Colors.white,
// color: Colors.grey,
),
//height: 45,
// width:90
),
],
),
),
)
],
),
),
),
);
}) })
: Container(), : Container(),
), ),
@ -309,4 +330,13 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
), ),
); );
} }
getDetails(data) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceDetails(data).then((value) => {
GifLoaderDialogUtils.hideDialog(context),
Navigator.push(context,
FadePage(page: InsuranceCardDetails(data: value[0]['CheckList'])))
});
}
} }

@ -37,9 +37,21 @@ class _HomeReportPageState extends State<HomeReportPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); imagesInfo.add(ImagesInfo(
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); imageEn:
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
return BaseView<ReportsViewModel>( return BaseView<ReportsViewModel>(
onModelReady: (model) => model.getReports(), //model.getPrescriptions(), onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -93,7 +105,8 @@ class _HomeReportPageState extends State<HomeReportPage>
Container( Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).requested), child:
Texts(TranslationBase.of(context).requested),
), ),
), ),
Container( Container(
@ -105,13 +118,15 @@ class _HomeReportPageState extends State<HomeReportPage>
Container( Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).completed), child:
Texts(TranslationBase.of(context).completed),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).cancelled), child:
Texts(TranslationBase.of(context).cancelled),
), ),
), ),
], ],
@ -130,21 +145,23 @@ class _HomeReportPageState extends State<HomeReportPage>
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderRequestList, reportList: model.reportsOrderRequestList
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderReadyList, reportList: model.reportsOrderReadyList
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderCompletedList, reportList: model.reportsOrderCompletedList
), ),
ReportListWidget( ReportListWidget(
reportList: model.reportsOrderCanceledList, reportList: model.reportsOrderCanceledList
), ),
], ],
), ),
), ),
SizedBox(height: 110,) SizedBox(
height: 110,
)
], ],
), ),
bottomSheet: Container( bottomSheet: Container(

@ -1,7 +1,10 @@
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/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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -10,8 +13,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;
ReportListWidget({@required this.reportList}); ReportListWidget({@required this.reportList, this.onEmailTap});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -48,17 +52,6 @@ class ReportListWidget extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
reportList[index].status == 2
? Container(
child: InkWell(
onTap: sendReportEmail(),
child: Icon(
Icons.email,
color: Colors.red,
),
),
)
: Container(),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -72,6 +65,21 @@ class ReportListWidget extends StatelessWidget {
SizedBox(height: 12), SizedBox(height: 12),
], ],
), ),
reportList[index].status == 2
? Container(
margin: EdgeInsets.only(left: 15.0, right: 15.0),
child: InkWell(
onTap: () {
sendReportEmail(reportList[index]);
},
child: Icon(
Icons.email,
color: Theme.of(context).primaryColor,
size: 35.0,
),
),
)
: Container(),
], ],
), ),
), ),
@ -86,21 +94,26 @@ class ReportListWidget extends StatelessWidget {
} }
sendReportEmail(Reports report) { sendReportEmail(Reports report) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
_reportsService _reportsService
.sendEmailForMedicalReport( .sendEmailForMedicalReport(
report.projectName, report.projectName,
report.clinicDescription, report.clinicDescription,
report.doctorName, report.doctorName,
DateUtil.convertDateToString(report.requestDate), DateUtil.convertDateToString(report.requestDate),
report.invoiceNo.toString(), report.invoiceNo.toString(),
report.projectID, report.projectID,
report.printID, DateUtil.convertDateToString(report.requestDate),
procedureID, report.setupId)
stamp, .then((value) {
setupID) GifLoaderDialogUtils.hideDialog(AppGlobal.context);
.then((value) {}) print(value["IsSent"]);
.catchError(() {}); AppToast.showSuccessToast(
message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(err);
});
} }
} }

@ -1018,6 +1018,7 @@ class TranslationBase {
String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get lastAppointment => localizedValues['last-appointment'][locale.languageCode];
String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode];
String get fetchData => localizedValues['fetch-data'][locale.languageCode];
} }

@ -236,7 +236,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.label, widget.label,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: 17.0, fontSize: widget.small ? 12.0 : 17.0,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
), ),

Loading…
Cancel
Save