diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f615af5..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba76c031..69be86e9 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,7 +1,10 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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'; +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_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -13,7 +16,8 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -21,28 +25,96 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: 'ECG', - body: ListView.builder( - itemCount: model.patientMuseResultsModelList.length, - itemBuilder: (context, index) => InkWell( + isShowAppBar: false, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + 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 { await launch( model.patientMuseResultsModelList[index].imageURL); }, child: Container( width: double.infinity, - margin: EdgeInsets.all(5), + height: 90, + margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), 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: Texts( - "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('ECG Report',bold: true,fontSize: 14,), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + ], + ), + ), + ], + ), + 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 51089567..253b0f55 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -267,6 +267,19 @@ class DateUtils { return ""; } + /// get data formatted like Apr 26,2020 + /// [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); + } + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 4f2c4271..59929075 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -216,7 +216,7 @@ class _TextsState extends State { fontSize:widget.fontSize?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, - fontWeight: _getFontWeight(), + fontWeight: widget.fontWeight ?? _getFontWeight(), decoration: widget.textDecoration //TextDecoration.lineThrough )), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 9842bbed..37dfda14 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -18,12 +18,13 @@ class AppScaffold extends StatelessWidget { final bool isShowAppBar; final BaseViewModel baseViewModel; final Widget bottomSheet; + final Color backgroundColor; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel, this.bottomSheet}); + this.baseViewModel, this.bottomSheet, this.backgroundColor}); @override Widget build(BuildContext context) { @@ -34,7 +35,7 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: Colors.white, + backgroundColor: backgroundColor??Colors.white, appBar: isShowAppBar ? AppBar( elevation: 0, @@ -59,7 +60,6 @@ class AppScaffold extends StatelessWidget { ], ) : null, - bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null