diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 69be86e9..ffb12ee1 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,5 +1,6 @@ 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/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/util/date-utils.dart'; @@ -9,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @@ -18,6 +20,7 @@ class ECGPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -34,7 +37,7 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), + SizedBox(height: 12,), Texts('Service',style: "caption2",color: Colors.black,), Texts('ECG',bold: true,fontSize: 22,), SizedBox(height: 12,), @@ -45,7 +48,7 @@ class ECGPage extends StatelessWidget { }, child: Container( width: double.infinity, - height: 90, + height: 110, margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( @@ -62,7 +65,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('ECG Report',bold: true,fontSize: 14,), + Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), RichText( text: TextSpan( style: TextStyle( @@ -78,10 +82,9 @@ class ECGPage extends StatelessWidget { fontFamily: 'Poppins')), new TextSpan( - text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', style: TextStyle( - fontWeight: - FontWeight.w700, + fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)), @@ -95,13 +98,14 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), - Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + 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), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 253b0f55..4c11e43b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -256,9 +256,9 @@ class DateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime) { + static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return getMonth(dateTime.month) + + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + @@ -267,16 +267,22 @@ class DateUtils { return ""; } - /// get data formatted like Apr 26,2020 + /// 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 isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { - // if (dateTime != null) - // return getMonth(dateTime.hour) + - // " " + - // dateTime.day.toString() + - // ", " + - // dateTime.year.toString(); - // else return DateFormat('hh:mm a').format(dateTime); }