prescription ui changes(cont).

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

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.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/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -20,11 +22,34 @@ class PrescriptionDetailsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).prescriptions, appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ 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( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -51,9 +76,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''),
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
), ),
), ),
) )
@ -152,26 +175,10 @@ class PrescriptionDetailsPage extends StatelessWidget {
), ),
TableRow( TableRow(
children: [ children: [
Container( Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.routeN ?? ''))),
color: Colors.white, Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
height: 50, Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
width: double.infinity, Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.days}')))
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( child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(), eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder", title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate, startDate: startDate,
endDate: endDate, endDate: endDate,
location: prescriptionReport.remarks, location: prescriptionReport.remarks,
@ -250,31 +256,22 @@ class PrescriptionDetailsPage extends StatelessWidget {
// height: 100.0, // height: 100.0,
margin: EdgeInsets.all(7.0), margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0), padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration( decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add", child: Text("add", overflow: TextOverflow.clip, style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
overflow: TextOverflow.clip,
style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder", child: Text("reminder", overflow: TextOverflow.clip, style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
overflow: TextOverflow.clip,
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
), ),
Container( Container(
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
margin: projectViewModel.isArabic margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) : EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
? 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), 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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart'; import 'PrescriptionIDeliveryAddressPage.dart';
@ -188,6 +189,7 @@ class PrescriptionItemsPage extends StatelessWidget {
itemCount: model.prescriptionReportListINP.length) itemCount: model.prescriptionReportListINP.length)
else else
ListView.separated( ListView.separated(
padding: EdgeInsets.all(21),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -211,99 +213,72 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
); );
}, },
child: Card( child: Container(
margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4), decoration: BoxDecoration(
shape: cardRadius(12), 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( child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20), padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
model.prescriptionReportEnhList[index].itemDescription.isNotEmpty (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription ? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '', : model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xff2E303A),
letterSpacing: -0.64, letterSpacing: -0.64,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
mHeight(10), mHeight(10),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Card(
child: Card( child: Image.network(
child: Image.network( model.prescriptionReportEnhList[index].imageSRCUrl,
model.prescriptionReportEnhList[index].imageSRCUrl, fit: BoxFit.cover,
fit: BoxFit.cover, width: 48,
width: 60, height: 48,
height: 60,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
shape: cardRadius(2000),
), ),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1), shape: cardRadius(2000),
), ),
mWidth(12), mWidth(12),
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
children: [ myRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic),
Text( myRichText(TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), projectViewModel.isArabic),
TranslationBase.of(context).route + ": ", mHeight(9),
style: TextStyle( Text(
color: Colors.grey, model.prescriptionReportEnhList[index].remarks,
fontSize: 10, style: TextStyle(
letterSpacing: -0.4, color: Color(0xff575757),
fontWeight: FontWeight.w600, fontSize: 12,
), 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,
),
), ),
],
),
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) { separatorBuilder: (context, index) {
return mHeight(8); return mHeight(12);
}, },
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -324,26 +299,23 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
Container( Container(
width: double.infinity, color: Colors.white,
padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 20), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Container( child: DefaultButton(
width: MediaQuery.of(context).size.width * 0.8, TranslationBase.of(context).resendOrder,
child: DefaultButton( () {
TranslationBase.of(context).resendOrder, Navigator.push(
() { context,
Navigator.push( FadePage(
context, page: PrescriptionDeliveryAddressPage(
FadePage( prescriptions: prescriptions,
page: PrescriptionDeliveryAddressPage( prescriptionReportList: model.prescriptionReportList,
prescriptions: prescriptions, prescriptionReportEnhList: model.prescriptionReportEnhList,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
), ),
); ),
}, );
color: Colors.green[800], },
), color: Color(0xff359846),
), ),
), ),
], ],

Loading…
Cancel
Save