change the font type in the app and Prescription

merge-requests/395/head
Mohammad Aljammal 4 years ago
parent 2bd505290d
commit d45b8a9cc5

@ -40,6 +40,10 @@ class ProcedureViewModel extends BaseViewModel {
filterType == FilterType.Clinic
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList;
List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList;

@ -61,7 +61,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.grey,
primaryColor: Colors.grey,
buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans',
fontFamily: 'Poppins',
dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
),

@ -37,6 +37,7 @@ class RadiologyDetailsPage extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
PatientProfileHeaderWhitAppointment(patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
@ -46,10 +47,9 @@ class RadiologyDetailsPage extends StatelessWidget {
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.2,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
@ -60,21 +60,26 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox(height: 5,),
Texts(TranslationBase.of(context).generalResult),
SizedBox(height: 5,),
Texts(
'${finalRadiology.reportData}',
textAlign: TextAlign.start,
fontSize: 17,
color: Colors.grey,
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'${finalRadiology.reportData}',
textAlign: TextAlign.start,
fontSize: 17,
color: Colors.grey,
),
),
SizedBox(height: 25,),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
color: Colors.red,
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
color: Colors.red,
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
),
),
],

@ -26,7 +26,7 @@ class RadiologyHomePage extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
ProcedureViewModel model2 = ProcedureViewModel();
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient),
builder: (_, model, widget) => AppScaffold(
@ -39,7 +39,7 @@ class RadiologyHomePage extends StatelessWidget {
physics: BouncingScrollPhysics(),
children: <Widget>[
PatientProfileHeaderNewDesign(
patient, patient.patientType.toString() ?? '0', patientType),
patient, patient.patientType.toString() ?? '0', arrivalType),
SizedBox(
height: 12,
),
@ -108,38 +108,26 @@ class RadiologyHomePage extends StatelessWidget {
),
),
),
...List.generate(
model.finalRadiologyList.length,
(index) => AppExpandableNotifier(
title: model.finalRadiologyList[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model
.finalRadiologyList[index].finalRadiologyList
.map((radiology) {
return InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: radiology,
patient: patient,
),
),
),
child: DoctorCard(
doctorName: radiology.doctorName,
profileUrl: radiology.doctorImageURL,
invoiceNO: '${radiology.invoiceNo}',
branch: '${radiology.projectName}',
appointmentDate: radiology.orderDate,
orderNo: radiology.orderNo.toString(),
),
);
}).toList(),
)),
)
...List.generate(model.radiologyList.length, (index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index],
patient: patient,
),
),
),
child: DoctorCard(
doctorName: model.radiologyList[index].doctorName,
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
appointmentDate: model.radiologyList[index].orderDate,
orderNo: model.radiologyList[index].orderNo.toString(),
),
)),
],
),
),

@ -5,7 +5,9 @@ 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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_details_page.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_with_appointment_card.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/transitions/fade_page.dart';
@ -15,7 +17,9 @@ import 'package:flutter/material.dart';
class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions;
final PatiantInformtion patient;
PrescriptionItemsPage({Key key, this.prescriptions, this.patient});
final String patientType;
final String arrivalType;
PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType});
@override
Widget build(BuildContext context) {
@ -23,199 +27,159 @@ class PrescriptionItemsPage extends StatelessWidget {
onModelReady: (model) =>
model.getPrescriptionReport(prescriptions: prescriptions,patient: patient),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescriptions,
isShowAppBar: false,
baseViewModel: model,
body: SingleChildScrollView(
child: Container(
child: Column(
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'),
],
),)
],
)
],
),
),
PatientProfileHeaderWhitAppointment(patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
branch: '',
clinic: prescriptions.clinicDescription,
isPrescriptions: true,
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate),
doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
// invoiceNO: widget.patientLabOrders.invoiceNo,
),
if (!prescriptions.isInOutPatient)
...List.generate(
model.prescriptionReportList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport:
model.prescriptionReportList[index],
),
),
(index) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Container(
width: double.infinity,
margin:
EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(5)),
child: Image.network(
model.prescriptionReportList[index]
.imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(model
.prescriptionReportList[index]
.itemDescription
.isNotEmpty
? model.prescriptionReportList[index]
.itemDescription
: model.prescriptionReportList[index]
.itemDescriptionN)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
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(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)),
SizedBox(height: 12,),
Row(
children: [
SizedBox(width: 18,),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 0.5,color: Colors.grey)
),
height: 55,
width: 55,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network(
model.prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
),
),
),
SizedBox(width: 10,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Texts(TranslationBase.of(context).route,color: Colors.grey,),
Expanded(child: Texts(model.prescriptionReportList[index].routeN)),
],
),
Row(
children: [
Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
Texts(model.prescriptionReportList[index].frequencyN ?? ''),
],
),
SizedBox(height: 12,),
Texts(model.prescriptionReportList[index].remarks ?? ''),
],
),)
],
)
],
),
),
))
else
...List.generate(
model.prescriptionReportEnhList.length,
(index) => InkWell(
onTap: () {
PrescriptionReport prescriptionReport =
PrescriptionReport(
imageSRCUrl: model
.prescriptionReportEnhList[index].imageSRCUrl,
itemDescription: model
.prescriptionReportEnhList[index]
.itemDescription,
itemDescriptionN: model
.prescriptionReportEnhList[index]
.itemDescription,
routeN:
model.prescriptionReportEnhList[index].route,
frequency: model
.prescriptionReportEnhList[index].frequency,
frequencyN: model
.prescriptionReportEnhList[index].frequency,
doseDailyQuantity: model
.prescriptionReportEnhList[index]
.doseDailyQuantity,
days: model.prescriptionReportEnhList[index].days,
itemID:
model.prescriptionReportEnhList[index].itemID,
remarks: model
.prescriptionReportEnhList[index].remarks);
Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport: prescriptionReport,
),
...List.generate(
model.prescriptionReportEnhList.length,
(index) => 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(model.prescriptionReportEnhList[index].itemDescription,bold: true,),),
SizedBox(height: 12,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 18,),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 0.5,color: Colors.grey)
),
height: 55,
width: 55,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
),
),
),
SizedBox(width: 10,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Texts(TranslationBase.of(context).route,color: Colors.grey,),
Expanded(child: Texts(model.prescriptionReportEnhList[index].route??'')),
],
),
Row(
children: [
Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
Texts(model.prescriptionReportEnhList[index].frequency ?? ''),
],
),
SizedBox(height: 12,),
Texts(model.prescriptionReportEnhList[index].remarks?? ''),
],
),)
],
)
],
),
);
},
child: Container(
margin: EdgeInsets.all(8.0),
color: Colors.white,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
model
.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(model.prescriptionReportEnhList[index]
.itemDescription),
],
),
),
),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
),
),
),
],
),

@ -91,6 +91,8 @@ class PrescriptionsPage extends StatelessWidget {
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
),
),
),
@ -98,10 +100,9 @@ class PrescriptionsPage extends StatelessWidget {
doctorName: model.prescriptionsList[index].doctorName,
profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription,
isPrescriptions: true,
appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,),
orderNo: model.prescriptionsList[index].appointmentNo.toString(),
invoiceNO:model.prescriptionsList[index].appointmentNo.toString(),
)
))

@ -28,7 +28,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
}
TextEditingController procedureController = TextEditingController();
//TODO Jammal
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;

@ -22,7 +22,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
left: 0, right: 5, bottom: 5,),
decoration: BoxDecoration(
color: Colors.white,
),
@ -188,9 +188,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
),
Container(
child: AppText(
convertDateFormat2(patient
.appointmentDate
.toString()),
convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
@ -314,20 +312,22 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
}
convertDateFormat2(String str) {
String timeConvert;
String newDate;
const start = "/Date(";
const end = "+0300)";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
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');
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}

@ -26,7 +26,8 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
final String profileUrl;
final String invoiceNO;
final String orderNo;
final bool isPrescriptions;
final String clinic;
PatientProfileHeaderWhitAppointment(
{this.patient,
this.patientType,
@ -36,7 +37,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo});
this.orderNo, this.isPrescriptions = false, this.clinic});
@override
Widget build(BuildContext context) {
@ -209,9 +210,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
),
Container(
child: AppText(
convertDateFormat2(patient
.appointmentDate
.toString()),
convertDateFormat2(patient.appointmentDate??''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
@ -371,7 +370,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
fontWeight: FontWeight.w600,
fontSize: 14,
),
if (orderNo != null)
if (orderNo != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
@ -383,7 +382,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
)
],
),
if (invoiceNO != null)
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
@ -395,10 +394,34 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
)
],
),
if(isPrescriptions)
Row(
children: [
Texts(
'Branch:',
color: Colors.grey[800],
),
Texts(
branch?? '',
)
],
),
if(isPrescriptions)
Row(
children: [
Texts(
'Clinic:',
color: Colors.grey[800],
),
Texts(
clinic?? '',
)
],
),
Row(
children: <Widget>[
Texts(
'Result Date:',
!isPrescriptions? 'Result Date:': 'Prescriptions Date',
color: Colors.grey[800],
),
Expanded(
@ -425,20 +448,22 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
}
convertDateFormat2(String str) {
String timeConvert;
String newDate ="";
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
if (str.isNotEmpty) {
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');
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}

@ -217,6 +217,7 @@ class _TextsState extends State<Texts> {
letterSpacing:
widget.variant == "overline" ? 1.5 : null,
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: 'Poppins',
decoration:
widget.textDecoration //TextDecoration.lineThrough
)),
@ -251,7 +252,7 @@ class _TextsState extends State<Texts> {
style: _getFontStyle().copyWith(
color: HexColor('#FF0000'),
fontWeight: FontWeight.w800,
fontFamily: "WorkSans",
fontFamily: "Poppins",
)),
),
),

@ -138,7 +138,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
color: Colors.white,
fontSize: 17.0,
fontWeight: FontWeight.w700,
fontFamily: "WorkSans")),
fontFamily: "Poppins")),
)
],
),

@ -25,7 +25,7 @@ class AppText extends StatefulWidget {
{this.color = Colors.black,
this.fontWeight = FontWeight.normal,
this.fontSize,
this.fontFamily = 'WorkSans',
this.fontFamily = 'Poppins',
this.margin,
this.marginTop = 0,
this.marginRight = 0,

@ -19,6 +19,8 @@ class DoctorCard extends StatelessWidget {
final String invoiceNO;
final String orderNo;
final Function onTap;
final bool isPrescriptions;
final String clinic;
DoctorCard(
{this.doctorName,
@ -27,7 +29,7 @@ class DoctorCard extends StatelessWidget {
this.invoiceNO,
this.onTap,
this.appointmentDate,
this.orderNo});
this.orderNo, this.isPrescriptions=false, this.clinic});
@override
Widget build(BuildContext context) {
@ -67,6 +69,7 @@ class DoctorCard extends StatelessWidget {
fontWeight: FontWeight.w600,
fontSize: 14,
),
if(!isPrescriptions)
Texts(
'${DateUtils.getHour(appointmentDate)}',
fontWeight: FontWeight.w600,
@ -96,7 +99,7 @@ class DoctorCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (orderNo != null)
if (orderNo != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
@ -108,7 +111,7 @@ class DoctorCard extends StatelessWidget {
)
],
),
if (invoiceNO != null)
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
@ -120,6 +123,19 @@ class DoctorCard extends StatelessWidget {
)
],
),
if(isPrescriptions)
Row(
children: <Widget>[
Texts(
'Clinic:',
color: Colors.grey[500],
),
Texts(
clinic,
)
],
),
if(branch!=null)
Row(
children: <Widget>[
Texts(
@ -135,7 +151,7 @@ class DoctorCard extends StatelessWidget {
),
),
Icon(
EvaIcons.eye,
isPrescriptions? Icons.arrow_forward: EvaIcons.eye,
)
],
),

@ -121,19 +121,19 @@ flutter:
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: WorkSans
fonts:
- asset: assets/fonts/Work_Sans/WorkSans-Regular.ttf
- asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf
- asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf
weight: 700
- family: Poppins
fonts:
- asset: assets/fonts/Poppins/Poppins-Regular.ttf
- asset: assets/fonts/Poppins/Poppins-Medium.ttf
- asset: assets/fonts/Poppins/Poppins-Bold.ttf
weight: 700
- asset: assets/fonts/Poppins/Poppins-Regular.ttf
weight: 400
- asset: assets/fonts/Poppins/Poppins-Medium.ttf
weight: 500
- asset: assets/fonts/Poppins/Poppins-Bold.ttf
weight: 700
- asset: assets/fonts/Poppins/Poppins-Bold.ttf
weight: 800
- asset: assets/fonts/Poppins/Poppins-Bold.ttf
weight: 900
# - family: Trajan Pro

Loading…
Cancel
Save