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,17 +109,25 @@ 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
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.status ==
3
? Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Card( child: Card(
margin: margin: EdgeInsets.fromLTRB(
EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), 8.0, 16.0, 8.0, 8.0),
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(10),
), ),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width:
MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
@ -129,7 +143,8 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
right: 20.0), right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
model model
@ -139,13 +154,15 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
.patientName, .patientName,
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight:
FontWeight.w500,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(
context)
.fileno + .fileno +
": " + ": " +
model model
@ -156,7 +173,8 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
.toString(), .toString(),
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight:
FontWeight.w500,
) )
], ],
), ),
@ -166,21 +184,23 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
Expanded( Expanded(
flex: 2, flex: 2,
child: Container( child: Container(
// height: MediaQuery.of(context).size.height * 0.12, margin:
margin: EdgeInsets.only(top: 2.0), EdgeInsets.only(top: 2.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of( label: TranslationBase
context) .of(context)
.updateInsurance, .fetchData,
small: true, small: true,
textColor: Colors.white, textColor:
// color: Colors.grey, Colors.white,
onTap: () {
getDetails(
model);
},
), ),
//height: 45,
// width:90
), ),
], ],
), ),
@ -190,7 +210,8 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
), ),
), ),
), ),
); )
: Container();
}) })
: 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,8 +94,8 @@ 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,
@ -96,11 +104,16 @@ class ReportListWidget extends StatelessWidget {
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