new design for ESG service

merge-requests/388/head
Mohammad Aljammal 4 years ago
parent 7dff6c85d3
commit 019553ba51

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

@ -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<PatientMuseViewModel>(
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: <TextSpan>[
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),
)
],
),
),
)),
],
),
),
),
),
);
}

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

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

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

Loading…
Cancel
Save