add new design for Lab Result and Radiology Results

merge-requests/389/head
Mohammad Aljammal 5 years ago
parent 6fbd2076d4
commit 920ec14bc2

@ -124,10 +124,10 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'ليس لديك اي ملاحظة تقدم ' 'ar': 'ليس لديك اي ملاحظة تقدم '
}, },
'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'},
'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'},
'description': {'en': 'Description', 'ar': 'الوصف'}, 'description': {'en': 'Description', 'ar': 'الوصف'},
'value': {'en': 'Value', 'ar': 'القيمة'}, 'value': {'en': 'Value', 'ar': 'القيمة'},
'range': {'en': 'range', 'ar': 'النطاق'}, 'range': {'en': 'Range', 'ar': 'النطاق'},
'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'},
'pleaseEnterYourID': { 'pleaseEnterYourID': {
'en': 'Please enter your ID', 'en': 'Please enter your ID',

@ -88,6 +88,11 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom {
return labResultLists;
}
getLaboratoryResult( getLaboratoryResult(
{String projectID, {String projectID,
int clinicID, int clinicID,

@ -13,11 +13,10 @@ import 'package:provider/provider.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
final String filterName ;
final List<LabResult> patientLabResultList; final List<LabResult> patientLabResultList;
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
final PatiantInformtion patient; final PatiantInformtion patient;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -29,38 +28,88 @@ class LabResultWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(filterName), Expanded(
InkWell( child: Container(
onTap: () { child: Center(
Navigator.push( child: Texts(
context, TranslationBase.of(context).description,
FadePage( color: Colors.black,bold: true,
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
), ),
), ),
);
},
child: Texts(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
), ),
), ),
Expanded(
child: Container(
child: Center(
child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,),
),
),
),
Expanded(
child: Container(
child: Center(
child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,),
),
),
)
], ],
), ),
Table( SizedBox(height: 7,),
border: TableBorder.symmetric( Divider(color: Colors.black,thickness: 1,),
inside: BorderSide( SizedBox(height: 12,),
width: 2.0, color: Colors.grey[300]), ...List.generate(patientLabResultList.length, (index) => Column(
children: [
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${patientLabResultList[index].testCode}\n'+
patientLabResultList[index].description,
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM,
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
patientLabResultList[index].referanceRange,
textAlign: TextAlign.center,
), ),
children: fullData(patientLabResultList,context),
), ),
),
)
],
),
Divider(),
],
))
// Table(
// border: TableBorder.symmetric(
// inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid),
// ),
// children: fullData(patientLabResultList,context),
// ),
], ],
), ),
); );
@ -71,54 +120,22 @@ class LabResultWidget extends StatelessWidget {
TableRow( TableRow(
children: [ children: [
Container( Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).description, TranslationBase.of(context).description,
color: Colors.white, color: Colors.black,bold: true,
),
), ),
height: 60,
), ),
), ),
Container( Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center( child: Center(
child: Texts(TranslationBase.of(context).value, color: Colors.white), child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,),
), ),
height: 60),
), ),
Container( Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center( child: Center(
child: Texts(TranslationBase.of(context).range, color: Colors.white), child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,),
), ),
height: 60),
), ),
], ],
), ),

@ -34,7 +34,6 @@ class LaboratoryResultWidget extends StatefulWidget {
} }
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> { class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMore = true;
bool _isShowMoreGeneral = true; bool _isShowMoreGeneral = true;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -42,8 +41,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient),
model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient),
builder: (_, model, w) => NetworkBaseView( builder: (_, model, w) => NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Container( child: Container(
@ -53,33 +51,6 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container(
margin: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).invoiceNo),
Texts(widget.billNo),
],
),
),
),
],
),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -106,20 +77,17 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
)), )),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(child: Container(
child: Texts(TranslationBase.of(context) margin: EdgeInsets.only(left: 10, right: 10),
.generalResult)), child: Texts(TranslationBase.of(context).generalResult,bold: true,))),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor),
child: Icon( child: Icon(
_isShowMoreGeneral _isShowMoreGeneral
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down, : Icons.keyboard_arrow_down,
color: Colors.white, color: Colors.grey[800],
size: 22, size: 22,
), ),
) )
@ -142,23 +110,11 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000), duration: Duration(milliseconds: 7000),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: Column( child: LabResultWidget(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
...List.generate(
model.labResultLists.length,
(index) => LabResultWidget(
patientLabOrder: widget.patientLabOrder, patientLabOrder: widget.patientLabOrder,
filterName: model patientLabResultList: model.labResultList,
.labResultLists[index].filterName,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient:widget.patient, patient:widget.patient,
), ),
)
],
),
), ),
), ),
], ],
@ -167,63 +123,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
InkWell(
onTap: () {
setState(() {
_isShowMore = !_isShowMore;
});
},
child: Container(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
child: Row(
children: <Widget>[
Expanded(
child: Texts(
TranslationBase.of(context).specialResult)),
Container(
width: 25,
height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor),
child: Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
size: 22,
),
)
],
),
),
),
if (_isShowMore)
AnimatedContainer(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(5.0),
bottomRight: Radius.circular(5.0),
)),
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: Html(
data: widget.details ??
TranslationBase.of(context).noDataAvailable,
)),
),
], ],
), ),
], ],

@ -24,8 +24,9 @@ class LabsHomePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patientType = routeArgs['patient-type']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrival-type']; arrivalType = routeArgs['arrivalType'];
print(arrivalType);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLabs(patient), onModelReady: (model) => model.getLabs(patient),
builder: (context, LabsViewModel model, widget) => AppScaffold( builder: (context, LabsViewModel model, widget) => AppScaffold(
@ -50,6 +51,43 @@ class LabsHomePage extends StatelessWidget {
], ],
), ),
), ),
if(patientType!=null && patientType=='7')
InkWell(
onTap: (){
//TODO Hussam call the add page here
},
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Icon(Icons.add,color: Colors.white,),
),
),
SizedBox(height: 10,),
Texts('Apply for New Lab Order',color: Colors.grey[600],fontWeight: FontWeight.w600,)
],
),
),
),
),
),
...List.generate( ...List.generate(
model.patientLabOrdersList.length, model.patientLabOrdersList.length,
(index) => Column( (index) => Column(

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -15,8 +16,9 @@ import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType;
RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); final String arrivalType;
RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,45 +29,48 @@ class RadiologyDetailsPage extends StatelessWidget {
lineItem: finalRadiology.invoiceLineItemNo, lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo), invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).radiologyReport,
isShowAppBar: true, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Texts( PatientProfileHeaderWhitAppointment(patient: patient,
'${finalRadiology.reportData}', patientType: patientType??"0",
textAlign: TextAlign.center, arrivalType: arrivalType??"0",
), orderNo: finalRadiology.orderNo.toString(),
Padding( appointmentDate:finalRadiology.orderDate,
padding: const EdgeInsets.all(8.0), doctorName: finalRadiology.doctorName,
child: Texts( profileUrl: finalRadiology.doctorImageURL,
'${finalRadiology.reportData}', invoiceNO: finalRadiology.invoiceNo.toString(),
textAlign: TextAlign.start,
fontSize: 17,
),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.2, height: MediaQuery.of(context).size.height * 0.2,
)
],
), ),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
), ),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.14,
// color: Colors.grey[100],
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Divider(), SizedBox(height: 5,),
if (model.radImageURL.isNotEmpty) Texts(TranslationBase.of(context).generalResult),
SizedBox(height: 5,),
Texts(
'${finalRadiology.reportData}',
textAlign: TextAlign.start,
fontSize: 17,
color: Colors.grey,
),
SizedBox(height: 25,),
Container( Container(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(
color: Colors.red,
onTap: () { onTap: () {
launch(model.radImageURL); launch(model.radImageURL);
}, },
@ -74,7 +79,11 @@ class RadiologyDetailsPage extends StatelessWidget {
), ),
], ],
), ),
)), ),
],
),
),
),
); );
} }
} }

@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -20,6 +22,8 @@ class RadiologyHomePage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient), onModelReady: (model) => model.getPatientRadOrders(patient),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -31,41 +35,54 @@ class RadiologyHomePage extends StatelessWidget {
child: ListView( child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
Row( PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
children: <Widget>[ SizedBox(height: 12,),
Expanded( Padding(
flex: 1, padding: const EdgeInsets.all(8.0),
child: InkWell( child: Column(
onTap: () => model.setFilterType(FilterType.Clinic), crossAxisAlignment: CrossAxisAlignment.start,
child: ListTile( children: [
title: Text(TranslationBase.of(context).clinic), Texts('Radiology',style: "caption2",color: Colors.black,fontSize: 13,),
leading: Radio( Texts('Result',bold: true,fontSize: 22,),
value: FilterType.Clinic, ],
groupValue: model.filterType, ),
onChanged: (FilterType value) { ),
model.setFilterType(value); if(patientType!=null && patientType=='7')
InkWell(
onTap: (){
//TODO Hussam call the add page here
}, },
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
), ),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
), ),
child: Center(
child: Icon(Icons.add,color: Colors.white,),
), ),
), ),
Expanded( SizedBox(height: 10,),
flex: 1, Texts('Apply for Radiology Order',color: Colors.grey[600],fontWeight: FontWeight.w600,)
child: InkWell( ],
onTap: () => model.setFilterType(FilterType.Hospital), ),
child: ListTile(
title: Text(TranslationBase.of(context).hospital),
leading: Radio(
value: FilterType.Hospital,
groupValue: model.filterType,
onChanged: (FilterType value) {
model.setFilterType(value);
},
), ),
), ),
), ),
)
],
), ),
...List.generate( ...List.generate(
model.finalRadiologyList.length, model.finalRadiologyList.length,

@ -30,6 +30,50 @@ class PrescriptionItemsPage extends StatelessWidget {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
margin: EdgeInsets.all(12),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 18,right: 18),
child: Texts('Name ',bold: true,)),
Row(
children: [
SizedBox(width: 18,),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 0.5,color: Colors.grey)
),
height: 45,
width: 45,
),
SizedBox(width: 10,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Route: Monthly'),
Texts('Does: 2 Time a day with 1 hour gap'),
SizedBox(height: 12,),
Texts('Note: 2 Time a day with 1 hour gap'),
],
),)
],
)
],
),
),
),
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
...List.generate( ...List.generate(
model.prescriptionReportList.length, model.prescriptionReportList.length,

@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -20,92 +22,90 @@ class PrescriptionsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(patient), onModelReady: (model) => model.getPrescriptions(patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).prescriptions,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: ListView( child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
Row( PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
children: <Widget>[ SizedBox(height: 12,),
Expanded( Padding(
flex: 1, padding: const EdgeInsets.all(8.0),
child: InkWell( child: Column(
onTap: () => model crossAxisAlignment: CrossAxisAlignment.start,
.setFilterType(FilterType.Clinic), children: [
child: ListTile( Texts('Order',style: "caption2",color: Colors.black,fontSize: 13,),
title: Text(TranslationBase.of(context).clinic), Texts('Prescriptions',bold: true,fontSize: 22,),
leading: Radio( ],
value: FilterType.Clinic, ),
groupValue: model.filterType, ),
onChanged: (FilterType value) { if(patientType!=null && patientType=='7')
model.setFilterType(value); InkWell(
onTap: (){
//TODO Hussam call the add page here
}, },
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
), ),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
), ),
child: Center(
child: Icon(Icons.add,color: Colors.white,),
), ),
), ),
Expanded( SizedBox(height: 10,),
flex: 1, Texts('Apply for New Prescriptions Order',color: Colors.grey[600],fontWeight: FontWeight.w600,)
child: InkWell( ],
onTap: () => model
.setFilterType(FilterType.Hospital),
child: ListTile(
title: Text(TranslationBase.of(context).hospital),
leading: Radio(
value: FilterType.Hospital,
groupValue: model.filterType,
onChanged: (FilterType value) {
model.setFilterType(value);
},
), ),
), ),
), ),
)
],
), ),
...List.generate( ),
model.prescriptionsOrderList.length, ...List.generate(model.prescriptionsList.length, (index) => InkWell(
(index) => AppExpandableNotifier(
title: model
.prescriptionsOrderList[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model
.prescriptionsOrderList[index].prescriptionsList
.map((prescriptions) {
return InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: PrescriptionItemsPage( page: PrescriptionItemsPage(
prescriptions: prescriptions, prescriptions: model.prescriptionsList[index],
patient: patient, patient: patient,
), ),
), ),
), ),
child: DoctorCard( child: DoctorCard(
doctorName: prescriptions.doctorName, doctorName: model.prescriptionsList[index].doctorName,
profileUrl: prescriptions.doctorImageURL, profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: prescriptions.name, branch: model.prescriptionsList[index].name,
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,), appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,),
orderNo: prescriptions.appointmentNo.toString(), orderNo: model.prescriptionsList[index].appointmentNo.toString(),
invoiceNO:prescriptions.appointmentNo.toString(), invoiceNO:model.prescriptionsList[index].appointmentNo.toString(),
) )
); ))
}).toList(),
)),
)
], ],
), ),
), ),

@ -2,18 +2,22 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class Button extends StatefulWidget { class Button extends StatefulWidget {
final String title;
final Widget icon;
final VoidCallback onTap;
final bool loading;
final Color color;
Button({ Button({
Key key, Key key,
this.title: "", this.title = "",
this.icon, this.icon,
this.onTap, this.onTap,
this.loading: false, this.loading= false,
this.color,
}) : super(key: key); }) : super(key: key);
final String title;
final Widget icon;
final VoidCallback onTap;
final bool loading;
@override @override
_ButtonState createState() => _ButtonState(); _ButtonState createState() => _ButtonState();
@ -86,7 +90,8 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
scale: _buttonSize, scale: _buttonSize,
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
margin: EdgeInsets.only(bottom: widget.title.isNotEmpty ? 14.0 : 0.0), margin:
EdgeInsets.only(bottom: widget.title.isNotEmpty ? 14.0 : 0.0),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: widget.title != null && widget.title.isNotEmpty vertical: widget.title != null && widget.title.isNotEmpty
? 12.0 ? 12.0
@ -95,7 +100,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
? 22.0 ? 22.0
: 19), : 19),
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515b5d'), color: widget.color ?? HexColor('#515b5d'),
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(

Loading…
Cancel
Save