Merge branch 'patient_app_services' into 'development'

Patient app services

See merge request Cloud_Solution/doctor_app_flutter!388
merge-requests/387/merge
Mohammad Aljammal 5 years ago
commit 5763970d23

@ -1,11 +1,16 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/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/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/Text.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: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:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class ECGPage extends StatelessWidget { class ECGPage extends StatelessWidget {
@ -13,7 +18,9 @@ class ECGPage 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['patient-type'];
String arrivalType = routeArgs['arrival-type'];
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>( return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient( onModelReady: (model) => model.getECGPatient(
patientType: patient.patientType, patientType: patient.patientType,
@ -21,28 +28,97 @@ class ECGPage extends StatelessWidget {
patientID: patient.patientId), patientID: patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: false,
appBarTitle: 'ECG', backgroundColor: Color(0xffF8F8F8),
body: ListView.builder( body: SingleChildScrollView(
itemCount: model.patientMuseResultsModelList.length, child: Padding(
itemBuilder: (context, index) => InkWell( padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
SizedBox(height: 12,),
Texts('Service',style: "caption2",color: Colors.black,),
Texts('ECG',bold: true,fontSize: 22,),
SizedBox(height: 12,),
...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell(
onTap: () async { onTap: () async {
await launch( await launch(
model.patientMuseResultsModelList[index].imageURL); model.patientMuseResultsModelList[index].imageURL);
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.all(5), height: 110,
margin: EdgeInsets.only(top: 5,bottom: 5),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey,width: 2) border: Border.all(color: Colors.white,width: 2),
color: Colors.white,
borderRadius: BorderRadius.circular(8)
), ),
child: Center( child: Column(
child: Texts( children: [
"${model.patientMuseResultsModelList[index].createdOnDateTime}"), Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,),
SizedBox(height:3),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).orderNo,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan(
text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}',
style: TextStyle(
fontWeight: FontWeight.w600,
fontFamily:
'Poppins',
fontSize: 14)),
],
),
)
],
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,),
Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,),
],
),
),
],
),
SizedBox(height: 15,),
Align(
alignment: Alignment.topRight,
child: Icon(Icons.arrow_circle_up_rounded),
)
],
), ),
), ),
)), )),
],
),
),
),
), ),
); );
} }

@ -3,18 +3,21 @@ import 'package:doctor_app_flutter/core/viewModel/labs_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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'laboratory_result_widget.dart'; import 'laboratory_result_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
class LaboratoryResultPage extends StatefulWidget { class LaboratoryResultPage extends StatefulWidget {
final PatientLabOrders patientLabOrders; final PatientLabOrders patientLabOrders;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType;
LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); final String arrivalType;
LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType});
@override @override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState(); _LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -31,22 +34,35 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
orderNo: widget.patientLabOrders.orderNo, orderNo: widget.patientLabOrders.orderNo,
patient: widget.patient), patient: widget.patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).labResults, // appBarTitle: TranslationBase.of(context).labResults,
baseViewModel: model, baseViewModel: model,
body: Scaffold( body: Scaffold(
body: ListView.builder( body: SingleChildScrollView(
itemBuilder: (context, index) => LaboratoryResultWidget( child: Column(
onTap: () async { children: [
PatientProfileHeaderWhitAppointment(patient: widget.patient,
patientType: widget.patientType??"0",
arrivalType: widget.arrivalType??"0",
orderNo: widget.patientLabOrders.orderNo,
appointmentDate:widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName,
profileUrl: widget.patientLabOrders.doctorImageURL,
invoiceNO: widget.patientLabOrders.invoiceNo,
),
...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget(
onTap: () async {
},
billNo: widget.patientLabOrders.invoiceNo,
details: model.patientLabSpecialResult[index].resultDataHTML,
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
)),
}, ],
billNo: widget.patientLabOrders.invoiceNo,
details: model.patientLabSpecialResult[index].resultDataHTML,
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
), ),
itemCount: model.patientLabSpecialResult.length,
), ),
), ),
), ),

@ -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';
@ -16,98 +18,69 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LabsHomePage extends StatelessWidget { class LabsHomePage extends StatelessWidget {
String patientType;
String arrivalType;
@override @override
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); patientType = routeArgs['patient-type'];
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) => arrivalType: arrivalType,
model.setFilterType(value), patientType: patientType,
), ),
), ),
), ),
) 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(),
)), )),

@ -256,9 +256,9 @@ class DateUtils {
/// get data formatted like Apr 26,2020 /// get data formatted like Apr 26,2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getMonthDayYearDateFormatted(DateTime dateTime) { static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) {
if (dateTime != null) if (dateTime != null)
return getMonth(dateTime.month) + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) +
" " + " " +
dateTime.day.toString() + dateTime.day.toString() +
", " + ", " +
@ -267,6 +267,24 @@ class DateUtils {
return ""; return "";
} }
/// get data formatted like 26 Apr 2020
/// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) {
if (dateTime != null)
return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+
" " +
dateTime.year.toString();
else
return "";
}
/// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) {
return DateFormat('hh:mm a').format(dateTime);
}
static String getAgeByBirthday(dynamic birthday, BuildContext context) { static String getAgeByBirthday(dynamic birthday, BuildContext context) {
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);

@ -0,0 +1,460 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'large_avatar.dart';
class PatientProfileHeaderWhitAppointment extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String doctorName;
final String branch;
final DateTime appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
PatientProfileHeaderWhitAppointment(
{this.patient,
this.patientType,
this.arrivalType,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 300,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
AppText(
(Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(
patient.lastName)),
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
patient.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
patient.patientStatusType ==
43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1'
? AppText(
patient.startTime !=
null
? patient
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
: AppText(
DateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patient
.appointmentDate
.toString()),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(
context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan(
text: patient.patientId
.toString(),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient
.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
),
),
],
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom:BorderSide(color: Colors.grey[400],width: 2.5),
left: BorderSide(color: Colors.grey[400],width: 2.5),
)
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName,
url: profileUrl,
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${TranslationBase.of(context).dr}.$doctorName',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
if (orderNo != null)
Row(
children: <Widget>[
Texts(
'Order No:',
color: Colors.grey[800],
),
Texts(
orderNo ?? '',
)
],
),
if (invoiceNO != null)
Row(
children: <Widget>[
Texts(
'Invoice:',
color: Colors.grey[800],
),
Texts(
invoiceNO,
)
],
),
Row(
children: <Widget>[
Texts(
'Result Date:',
color: Colors.grey[800],
),
Texts(
'${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
)
],
)
]),
),
),
],
),
),
),
],
)
],
),
),
);
}
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
}

@ -216,7 +216,7 @@ class _TextsState extends State<Texts> {
fontSize:widget.fontSize?? _getFontSize(), fontSize:widget.fontSize?? _getFontSize(),
letterSpacing: letterSpacing:
widget.variant == "overline" ? 1.5 : null, widget.variant == "overline" ? 1.5 : null,
fontWeight: _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
decoration: decoration:
widget.textDecoration //TextDecoration.lineThrough widget.textDecoration //TextDecoration.lineThrough
)), )),

@ -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>[

@ -18,12 +18,13 @@ class AppScaffold extends StatelessWidget {
final bool isShowAppBar; final bool isShowAppBar;
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final Widget bottomSheet; final Widget bottomSheet;
final Color backgroundColor;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = true, this.isShowAppBar = true,
this.baseViewModel, this.bottomSheet}); this.baseViewModel, this.bottomSheet, this.backgroundColor});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,7 +35,7 @@ class AppScaffold extends StatelessWidget {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: Scaffold( child: Scaffold(
backgroundColor: Colors.white, backgroundColor: backgroundColor??Colors.white,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
@ -59,7 +60,6 @@ class AppScaffold extends StatelessWidget {
], ],
) )
: null, : null,
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection body: projectProvider.isInternetConnection
? baseViewModel != null ? baseViewModel != null

@ -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