change the lab result design

merge-requests/388/head
Mohammad Aljammal 5 years ago
parent f0c65bb70b
commit 747a0b7da4

@ -5,6 +5,8 @@ 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/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.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,94 +22,61 @@ 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'];
ProjectViewModel projectViewModel = Provider.of(context); String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type'];
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(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).labOrders,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: Center( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
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('Lab',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); ...List.generate(
}, model.patientLabOrdersList.length,
), (index) => Column(
), crossAxisAlignment: CrossAxisAlignment.start,
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
), children: model
Expanded( .patientLabOrdersList[index].patientLabOrdersList
flex: 1, .map((labOrder) {
child: InkWell( return DoctorCard(
onTap: () => model.setFilterType(FilterType.Hospital), onTap: () => Navigator.push(
child: ListTile( context,
title: Text(TranslationBase.of(context).hospital), FadePage(
leading: Radio( page: LaboratoryResultPage(
value: FilterType.Hospital, patientLabOrders: labOrder,
groupValue: model.filterType, patient: patient,
onChanged: (FilterType value) =>
model.setFilterType(value),
), ),
), ),
), ),
) doctorName: labOrder.doctorName,
], invoiceNO: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
branch: labOrder.projectName,
appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo,
);
}).toList(),
), ),
...List.generate( )
model.patientLabOrdersList.length, ],
(index) => AppExpandableNotifier(
title: model.patientLabOrdersList[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model
.patientLabOrdersList[index].patientLabOrdersList
.map((labOrder) {
return DoctorCard(
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: labOrder,
patient: patient,
),
),
),
isInOutPatient: labOrder.isInOutPatient,
name: labOrder.doctorName,
billNo: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
subName: labOrder.projectName,
isLiveCareAppointment:
labOrder.isLiveCareAppointment,
date: projectViewModel.isArabic
? DateUtils.getMonthDayYearDateFormattedAr(
labOrder.orderDate)
: DateUtils.getMonthDayYearDateFormatted(
labOrder.orderDate),
);
}).toList(),
),
),
)
],
),
), ),
), ),
), ),

@ -88,18 +88,12 @@ class RadiologyHomePage extends StatelessWidget {
), ),
), ),
child: DoctorCard( child: DoctorCard(
isInOutPatient: radiology.isInOutPatient, doctorName: radiology.doctorName,
isLiveCareAppointment:
radiology.isLiveCareAppointment,
name: radiology.doctorName,
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
billNo: '${radiology.invoiceNo}', invoiceNO: '${radiology.invoiceNo}',
subName: '${radiology.projectName}', branch: '${radiology.projectName}',
date: projectViewModel.isArabic appointmentDate: radiology.orderDate,
? DateUtils.getMonthDayYearDateFormattedAr( orderNo: radiology.orderNo.toString(),
radiology.orderDate)
: DateUtils.getMonthDayYearDateFormatted(
radiology.orderDate),
), ),
); );
}).toList(), }).toList(),

@ -93,24 +93,15 @@ class PrescriptionsPage extends StatelessWidget {
), ),
), ),
child: DoctorCard( child: DoctorCard(
name: prescriptions.doctorName, doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL, profileUrl: prescriptions.doctorImageURL,
rat: branch: prescriptions.name,
prescriptions.actualDoctorRate.toDouble(), appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,),
subName: prescriptions.name, orderNo: prescriptions.appointmentNo.toString(),
isInOutPatient: prescriptions.isInOutPatient, invoiceNO:prescriptions.appointmentNo.toString(),
isLiveCareAppointment:
prescriptions.isLiveCareAppointment, )
date: projectViewModel.isArabic
? DateUtils
.getMonthDayYearDateFormattedAr(
DateUtils.convertStringToDate(
prescriptions
.appointmentDate))
: DateUtils.getMonthDayYearDateFormatted(
DateUtils.convertStringToDate(
prescriptions.appointmentDate)),
),
); );
}).toList(), }).toList(),
)), )),

@ -271,10 +271,9 @@ class DateUtils {
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) {
if (dateTime != null) if (dateTime != null)
return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+
" " +
dateTime.day.toString() +
" " + " " +
dateTime.year.toString(); dateTime.year.toString();
else else
return ""; return "";

@ -47,6 +47,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 4), padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
child: Card( child: Card(
color: Colors.grey[200],
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -1,7 +1,8 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -11,28 +12,22 @@ import 'StarRating.dart';
import 'Text.dart'; import 'Text.dart';
class DoctorCard extends StatelessWidget { class DoctorCard extends StatelessWidget {
final String name; final String doctorName;
final String subName; final String branch;
final double rat; final DateTime appointmentDate;
final String date;
final String profileUrl; final String profileUrl;
final String billNo; final String invoiceNO;
final String orderNo;
final Function onTap; final Function onTap;
final Function onEmailTap;
final bool isInOutPatient;
final bool isLiveCareAppointment;
DoctorCard( DoctorCard(
{this.name, {this.doctorName,
this.subName, this.branch,
this.rat,
this.date,
this.profileUrl, this.profileUrl,
this.billNo, this.invoiceNO,
this.onTap, this.onTap,
this.onEmailTap, this.appointmentDate,
this.isInOutPatient, this.orderNo});
this.isLiveCareAppointment = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,155 +37,110 @@ class DoctorCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 0.5, width: 0.5,
color: Theme.of(context).primaryColor, color: Colors.white,
), ),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.0), Radius.circular(15.0),
), ),
color: Colors.white), color: Colors.white),
child: InkWell( child: Padding(
onTap: onTap, padding: const EdgeInsets.all(15.0),
child: Column( child: InkWell(
crossAxisAlignment: CrossAxisAlignment.start, onTap: onTap,
children: <Widget>[ child: Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Row(
width: projectViewModel.isArabic ? 27 : 20, children: [
height: date == null Expanded(
? projectViewModel.isArabic child: Texts(
? 185 doctorName,
: 100 bold: true,
: 180, )),
decoration: BoxDecoration( Expanded(
//Colors.red[900] Color(0xff404545) child: Column(
color: isLiveCareAppointment crossAxisAlignment: CrossAxisAlignment.end,
? Color(0xff404545) children: [
: !isInOutPatient Texts(
? Colors.red[900] '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
: Theme.of(context).primaryColor, color: Colors.black,
borderRadius: BorderRadius.only( fontWeight: FontWeight.w600,
topLeft: projectViewModel.isArabic fontSize: 14,
? Radius.circular(0) ),
: Radius.circular(8), Texts(
bottomLeft: projectViewModel.isArabic '${DateUtils.getHour(appointmentDate)}',
? Radius.circular(0) fontWeight: FontWeight.w600,
: Radius.circular(8), color: Colors.grey[700],
topRight: projectViewModel.isArabic fontSize: 14,
? Radius.circular(8) ),
: Radius.circular(0), ],
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
), ),
), ),
child: RotatedBox( ],
quarterTurns: 3, ),
child: Center( Row(
child: Text( crossAxisAlignment: CrossAxisAlignment.end,
isLiveCareAppointment children: <Widget>[
? TranslationBase.of(context) Container(
.liveCare child: LargeAvatar(
.toUpperCase() name: doctorName,
: !isInOutPatient url: profileUrl,
? TranslationBase.of(context) ),
.inPatient width: 55,
.toUpperCase() height: 55,
: TranslationBase.of(context) ),
.outpatient Expanded(
.toUpperCase(), flex: 4,
style: TextStyle(color: Colors.white), child: Container(
), margin: EdgeInsets.all(10),
)), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: <Widget>[ children: <Widget>[
Expanded( if (orderNo != null)
flex: 1, Row(
child: LargeAvatar( children: <Widget>[
name: name, Texts(
url: profileUrl, 'order No:',
color: Colors.grey[500],
),
Texts(
orderNo ?? '',
)
],
), ),
), if (invoiceNO != null)
Expanded( Row(
flex: 4, children: <Widget>[
child: Container( Texts(
margin: EdgeInsets.all(10), 'Invoice:',
child: Column( color: Colors.grey[500],
crossAxisAlignment: CrossAxisAlignment.start, ),
children: <Widget>[ Texts(
Texts( invoiceNO,
TranslationBase.of(context).dr + )
" " + ],
name,
bold: true,
),
Texts(
subName,
),
if (billNo != null)
Row(
children: <Widget>[
Texts(
'${TranslationBase.of(context).billNo}: ',
),
Texts(
billNo,
)
],
),
if (rat != null)
StarRating(
totalAverage: rat, forceStars: true),
],
),
), ),
), Row(
if (onEmailTap != null) children: <Widget>[
InkWell( Texts(
onTap: onEmailTap, 'Branch:',
child: Icon( color: Colors.grey[500],
Icons.email,
color: Theme.of(context).primaryColor,
), ),
), Texts(
], branch,
), )
), ],
if (date != null)
Divider(
height: 8,
color: Colors.grey[400],
),
if (date != null)
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.calendar_today_outlined,
size: 30,
color: Colors.red,
),
Expanded(
child: Texts(
date,
variant: 'bodyText',
),
) )
], ]),
) ),
],
), ),
) Icon(
], EvaIcons.eye,
), )
], ],
),
],
),
), ),
), ),
); );

Loading…
Cancel
Save