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",
"ar": "يرجى تقييم العيادة"
},
"fetch-data": {
"en": "Fetch Data",
"ar": "تحديث الان"
},
};

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

@ -167,7 +167,8 @@ class _InsuranceCardState extends State<InsuranceCard> {
onTap: () => {
getDetails(model.insurance[index])
},
label: TranslationBase.of(context).seeDetails,
label: TranslationBase.of(context)
.seeDetails,
textColor: Colors.white,
),
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/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../base/base_view.dart';
@ -15,6 +20,7 @@ class InsuranceUpdate extends StatefulWidget {
class _InsuranceUpdateState extends State<InsuranceUpdate>
with SingleTickerProviderStateMixin {
TabController _tabController;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
@override
void initState() {
@ -103,94 +109,109 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
itemCount: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin:
EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
return model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.status ==
3
? Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width:
MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
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,
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
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(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'));
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(
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>(
onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
@ -93,7 +105,8 @@ class _HomeReportPageState extends State<HomeReportPage>
Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Center(
child: Texts(TranslationBase.of(context).requested),
child:
Texts(TranslationBase.of(context).requested),
),
),
Container(
@ -105,13 +118,15 @@ class _HomeReportPageState extends State<HomeReportPage>
Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Center(
child: Texts(TranslationBase.of(context).completed),
child:
Texts(TranslationBase.of(context).completed),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.22,
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,
children: <Widget>[
ReportListWidget(
reportList: model.reportsOrderRequestList,
reportList: model.reportsOrderRequestList
),
ReportListWidget(
reportList: model.reportsOrderReadyList,
reportList: model.reportsOrderReadyList
),
ReportListWidget(
reportList: model.reportsOrderCompletedList,
reportList: model.reportsOrderCompletedList
),
ReportListWidget(
reportList: model.reportsOrderCanceledList,
reportList: model.reportsOrderCanceledList
),
],
),
),
SizedBox(height: 110,)
SizedBox(
height: 110,
)
],
),
bottomSheet: Container(

@ -1,7 +1,10 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -10,8 +13,9 @@ import 'package:flutter/material.dart';
class ReportListWidget extends StatelessWidget {
final List<Reports> reportList;
final Function onEmailTap;
ReportListWidget({@required this.reportList});
ReportListWidget({@required this.reportList, this.onEmailTap});
@override
Widget build(BuildContext context) {
@ -48,17 +52,6 @@ class ReportListWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
reportList[index].status == 2
? Container(
child: InkWell(
onTap: sendReportEmail(),
child: Icon(
Icons.email,
color: Colors.red,
),
),
)
: Container(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -72,6 +65,21 @@ class ReportListWidget extends StatelessWidget {
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) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>();
_reportsService
.sendEmailForMedicalReport(
report.projectName,
report.clinicDescription,
report.doctorName,
DateUtil.convertDateToString(report.requestDate),
report.invoiceNo.toString(),
report.projectID,
report.printID,
procedureID,
stamp,
setupID)
.then((value) {})
.catchError(() {});
report.invoiceNo.toString(),
report.projectID,
DateUtil.convertDateToString(report.requestDate),
report.setupId)
.then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(value["IsSent"]);
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 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,
style: TextStyle(
color: widget.textColor,
fontSize: 17.0,
fontSize: widget.small ? 12.0 : 17.0,
fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
),

Loading…
Cancel
Save