prescription ui changes(cont).

merge-update-with-lab-changes
Sikander Saleem 4 years ago
parent 999a45c711
commit 4e0197965c

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -20,11 +22,34 @@ class PrescriptionDetailsPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// DoctorHeader(
// headerModel: HeaderModel(
// prescriptionReport.doctorName,
// prescriptionReport.doctorImageURL,
// prescriptionReport.speciality,
// "",
// prescriptions.name,
// DateUtil.convertStringToDate(prescriptions.appointmentDate),
// DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
// prescriptions.nationalityFlagURL,
// prescriptions.doctorRate,
// prescriptions.actualDoctorRate,
// prescriptions.noOfPatientsRate,
// model.user.emailAddress,
// ),
// isNeedToShowButton: false,
// onTap: () {
// // showConfirmMessage(context, model);
// },
// ),
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -51,9 +76,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''),
),
),
)
@ -152,26 +175,10 @@ class PrescriptionDetailsPage extends StatelessWidget {
),
TableRow(
children: [
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(child: Text(prescriptionReport.routeN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(child: Text('${prescriptionReport.days}')))
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.routeN ?? ''))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.days}')))
],
),
],
@ -227,8 +234,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
@ -250,31 +256,22 @@ class PrescriptionDetailsPage extends StatelessWidget {
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
child: Text("add", overflow: TextOverflow.clip, style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
child: Text("reminder", overflow: TextOverflow.clip, style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) : EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset("assets/images/new-design/reminder_icon.png", width: 45.0, height: 45.0),
),
],

@ -10,13 +10,14 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart';
@ -188,6 +189,7 @@ class PrescriptionItemsPage extends StatelessWidget {
itemCount: model.prescriptionReportListINP.length)
else
ListView.separated(
padding: EdgeInsets.all(21),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
@ -211,99 +213,72 @@ class PrescriptionItemsPage extends StatelessWidget {
),
);
},
child: Card(
margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4),
shape: cardRadius(12),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '',
(model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(
fontSize: 16,
color: Color(0xff2E303A),
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(10),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Card(
child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 60,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
shape: cardRadius(2000),
Card(
child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 48,
height: 48,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1),
shape: cardRadius(2000),
),
mWidth(12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
TranslationBase.of(context).route + ": ",
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
Text(
model.prescriptionReportEnhList[index].route,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).dailyDoses + ": ",
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
Text(
model.prescriptionReportEnhList[index].doseDailyQuantity.toString(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
myRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic),
myRichText(TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), projectViewModel.isArabic),
mHeight(9),
Text(
model.prescriptionReportEnhList[index].remarks,
style: TextStyle(
color: Color(0xff575757),
fontSize: 12,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
],
),
mHeight(12),
Text(
model.prescriptionReportEnhList[index].remarks,
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
],
],
),
)
],
),
@ -314,7 +289,7 @@ class PrescriptionItemsPage extends StatelessWidget {
);
},
separatorBuilder: (context, index) {
return mHeight(8);
return mHeight(12);
},
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@ -324,26 +299,23 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 20),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
child: DefaultButton(
TranslationBase.of(context).resendOrder,
() {
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).resendOrder,
() {
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
);
},
color: Colors.green[800],
),
),
);
},
color: Color(0xff359846),
),
),
],

Loading…
Cancel
Save