Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into pharmacy-bugs

 Conflicts:
	lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart
	lib/uitl/utils.dart
merge-update-with-lab-changes
hussam al-habibeh 5 years ago
commit 6dc0d89f61

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -1089,6 +1089,7 @@ const Map localizedValues = {
}, },
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"}, "Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطزيقة"}, "Way": {"en": "Way", "ar": "الطزيقة"},

@ -73,7 +73,7 @@ class BloodPressureService extends BaseService {
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress; body['To'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT, await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT,
onSuccess: (response, statusCode) async {}, onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -114,7 +114,7 @@ class BloodSugarService extends BaseService {
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress; body['To'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT, await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
onSuccess: (response, statusCode) async {}, onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -122,14 +122,17 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
bool isShouldClear = false; /// commented out based on PAP-304
if (_labsService.labOrdersResultsList.length == 1) { // bool isShouldClear = false;
labOrdersResultsList.forEach((element) { // if (_labsService.labOrdersResultsList.length == 1) {
if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) // labOrdersResultsList.forEach((element) {
isShouldClear = true; // if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty)
}); // isShouldClear = true;
} // });
if (isShouldClear) _labsService.labOrdersResultsList.clear(); // }
// if (isShouldClear)
//
// _labsService.labOrdersResultsList.clear();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -6,8 +6,10 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'dart:math'; import 'dart:math';
import '../health_calc_desc.dart';
import 'result_page.dart'; import 'result_page.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -121,7 +123,25 @@ class _BMICalculatorState extends State<BMICalculator> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", showHomeAppBarIcon: false,
appBarIcons: [
IconButton(
icon: Icon(Icons.info_outline),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HealthDescPage(
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
TranslationBase.of(context).bmiCalcDesc,
"assets/images/AlHabibMedicalService/health_calculator/bmi.png")),
);
},
)
],
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -158,7 +178,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center( child: Center(
child: Container( child: Container(
width: 60.0, width: 60.0,
@ -179,7 +200,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Container( Container(
height: 38.0, height: 38.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -261,15 +283,18 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
color: cmCard, color: cmCard,
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.symmetric(
child: Center(child: Texts(TranslationBase.of(context).cm)), vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).cm)),
), ),
), ),
), ),
@ -290,13 +315,16 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding:
child: Center(child: Texts(TranslationBase.of(context).feet)), const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child: Texts(TranslationBase.of(context).feet)),
), ),
), ),
), ),
@ -328,7 +356,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center( child: Center(
child: Container( child: Container(
width: 60.0, width: 60.0,
@ -349,7 +378,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Container( Container(
height: 38.0, height: 38.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -431,15 +461,18 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
color: kgCard, color: kgCard,
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.symmetric(
child: Center(child: Texts(TranslationBase.of(context).kg)), vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).kg)),
), ),
), ),
), ),
@ -460,13 +493,17 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding:
child: Center(child: Texts(TranslationBase.of(context).pound)), const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child:
Texts(TranslationBase.of(context).pound)),
), ),
), ),
), ),

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class HealthDescPage extends StatelessWidget {
final String title;
final String desc;
final String icon;
HealthDescPage(this.title, this.desc, this.icon);
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: title,
body: Container(
margin: EdgeInsets.all(8.0),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Image.asset(
icon,
fit: BoxFit.cover,
height: 80,
),
),
Expanded(
child: Text(
desc,
style: TextStyle(fontSize: 18.0),
),
)
],
),
),
);
}
}

@ -558,7 +558,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeIndex: _changeCurrentTab, changeIndex: _changeCurrentTab,
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked ,
floatingActionButton: floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0) (projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton( ? FloatingButton(

@ -49,7 +49,8 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).expDate+' :' + TranslationBase.of(context).expDate +
' :' +
DateUtil.getDayMonthYearDateFormatted(model DateUtil.getDayMonthYearDateFormatted(model
.activePrescriptionReport[index].orderDate), .activePrescriptionReport[index].orderDate),
), ),
@ -57,21 +58,24 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).route+ ' :' + TranslationBase.of(context).route +
' :' +
model.activePrescriptionReport[index].route, model.activePrescriptionReport[index].route,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).frequency+ ' :' + TranslationBase.of(context).frequency +
' :' +
model.activePrescriptionReport[index].frequency, model.activePrescriptionReport[index].frequency,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', TranslationBase.of(context).dailyQuantity +
' :${model.activePrescriptionReport[index].doseDailyQuantity}',
), ),
], ],
), ),
@ -86,16 +90,20 @@ class ActiveMedicationsPage extends StatelessWidget {
color: Colors.red, color: Colors.red,
size: 28, size: 28,
), ),
SizedBox(height: 25,), SizedBox(
height: 25,
),
InkWell( InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReminderPage( page: ReminderPage(
frequency: model.activePrescriptionReport[index] frequency: model
.activePrescriptionReport[index]
.frequencyNumber, .frequencyNumber,
days: model.activePrescriptionReport[index].days, days: model
.activePrescriptionReport[index].days,
itemDescription: model itemDescription: model
.activePrescriptionReport[index] .activePrescriptionReport[index]
.itemDescription, .itemDescription,

@ -27,13 +27,13 @@ class AddBloodPressurePage extends StatefulWidget {
const AddBloodPressurePage( const AddBloodPressurePage(
{Key key, {Key key,
this.bloodSugarDate, this.bloodSugarDate,
this.measureTimeSelectedType, this.measureTimeSelectedType,
this.isUpdate = false, this.isUpdate = false,
this.lineItemNo, this.lineItemNo,
this.model, this.model,
this.bloodSystolicValue, this.bloodSystolicValue,
this.bloodDiastolicValue}) this.bloodDiastolicValue})
: super(key: key); : super(key: key);
@override @override
@ -80,38 +80,44 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate appBarIcons: widget.isUpdate
? [ ? [
IconButton( IconButton(
icon: Icon(Icons.delete), icon: Icon(Icons.delete),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: 'Remove this measure', confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel, cancelText: TranslationBase.of(context).cancel,
okFunction: () async { okFunction: () async {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { widget.model
GifLoaderDialogUtils.hideDialog(context); .deactivateDiabeticStatus(
if (widget.model.state == ViewState.ErrorLocal) lineItemNo: widget.lineItemNo)
AppToast.showErrorToast(message: widget.model.error); .then((value) {
else GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context); if (widget.model.state == ViewState.ErrorLocal)
}).catchError((e) { AppToast.showErrorToast(
GifLoaderDialogUtils.hideDialog(context); message: widget.model.error);
AppToast.showErrorToast(message: widget.model.error); else
}); Navigator.pop(context);
}, }).catchError((e) {
cancelFunction: () => {}); GifLoaderDialogUtils.hideDialog(context);
dialog.showAlertDialog(context); AppToast.showErrorToast(message: widget.model.error);
}, });
) },
] cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -144,13 +150,15 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -172,18 +180,22 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showTitleActions: true, showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1), minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
setState( setState(
() { () {
bloodSugarDate = date; bloodSugarDate = date;
},
);
}, },
); currentTime: bloodSugarDate,
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType); locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -198,22 +210,30 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true,
setState( onConfirm: (date) {
() { setState(
timeSugarDate = date; () {
timeSugarDate = date;
},
);
}, },
); currentTime: timeSugarDate,
}, currentTime: timeSugarDate, locale: projectViewModel.localeType); locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())], children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -231,18 +251,23 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
loading: widget.model.state == ViewState.BusyLocal, loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white, textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, color: isButtonDisabled
? Colors.grey[900]
: Colors.grey,
onTap: () async { onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(), diastolicPressure:
systolicePressure: _bloodSystolicValueController.text.toString(), _bloodDiastolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm, measuredArm: measuredArm,
) )
.then((value) { .then((value) {
@ -290,7 +315,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 && _bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) { _bloodDiastolicValueController.text.length > 0) {
@ -320,4 +345,5 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
// }); // });
// } // }
} }
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -21,7 +22,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -29,8 +30,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: MonthCurvedChartBloodPressure( child: MonthCurvedChartBloodPressure(
horizontalInterval: 20.0, horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop, timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow, timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -47,7 +48,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -18,7 +19,7 @@ class BloodPressureYearPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( body:ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -26,8 +27,8 @@ class BloodPressureYearPage extends StatelessWidget {
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightYearTimeSeriesDataTop, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataTop,
timeSeries2: model.weightYearTimeSeriesDataLow, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -44,7 +45,7 @@ class BloodPressureYearPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -21,7 +22,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -29,8 +30,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval:3.0, horizontalInterval:3.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightWeekTimeSeriesDataTop, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -47,7 +48,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -282,11 +282,11 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white, textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () { onTap: () async {
if (_bloodSugarValueController.text.isNotEmpty) { if (_bloodSugarValueController.text.isNotEmpty) {
if (widget.isUpdate) { if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode await widget.bloodSugarViewMode
.updateDiabtecResult( .updateDiabtecResult(
month: bloodSugarDate, month: bloodSugarDate,
hour: timeSugarDate, hour: timeSugarDate,
@ -294,8 +294,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
measuredTime: measuredTime, measuredTime: measuredTime,
lineItemNo: widget.lineItemNo, lineItemNo: widget.lineItemNo,
bloodSugerResult: bloodSugerResult:
_bloodSugarValueController.text.toString()) _bloodSugarValueController.text.toString());
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal) ViewState.ErrorLocal)
@ -303,9 +303,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
});
} else } else {
widget.bloodSugarViewMode GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode
.addDiabtecResult( .addDiabtecResult(
diabtecUnit: measureUnitSelectedType, diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime, measuredTime: measuredTime,
@ -313,15 +314,17 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
_bloodSugarValueController.text.toString(), _bloodSugarValueController.text.toString(),
bloodSugerDateChart: bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
) );
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error) if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
});
}
} }
}), }),
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
@ -17,25 +18,32 @@ import 'package:provider/provider.dart';
class BloodMonthlyPage extends StatelessWidget { class BloodMonthlyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales3> timeSeriesData ; final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData})
const BloodMonthlyPage(
{Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( baseViewModel: bloodSugarViewMode,
body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: MonthLineChartCurved( child: MonthLineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty
? [TimeSeriesSales3(0, 0.0)]
: timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
) )),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -49,12 +57,20 @@ class BloodMonthlyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
border: TableBorder.symmetric( ? Container(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), child: Center(
), child: Texts(
children: fullData(context,projectViewModel), TranslationBase.of(context).noDataAvailable),
), ),
)
: Table(
border: TableBorder.symmetric(
inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel),
),
], ],
), ),
) )
@ -63,7 +79,8 @@ class BloodMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context,ProjectViewModel projectViewModel) { List<TableRow> fullData(
BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -73,8 +90,12 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -120,8 +141,12 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), ? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -133,7 +158,6 @@ class BloodMonthlyPage extends StatelessWidget {
), ),
height: 40), height: 40),
), ),
], ],
), ),
); );
@ -149,7 +173,7 @@ class BloodMonthlyPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
), ),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -16,27 +17,24 @@ import 'package:provider/provider.dart';
class BloodYearPage extends StatelessWidget { class BloodYearPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales2> timeSeriesData; final List<TimeSeriesSales2> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty baseViewModel: bloodSugarViewMode,
? Container( body: ListView(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5 ?? 0, indexes: timeSeriesData.length ~/ 5.5 ?? 0,
)), )),
SizedBox( SizedBox(
@ -52,7 +50,13 @@ class BloodYearPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -75,7 +75,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
),], ),],
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodSugar, appBarTitle: TranslationBase.of(context).bloodSugar,
baseViewModel: model, // baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: TabBarWidget(tabController: _tabController,), appBar: TabBarWidget(tabController: _tabController,),
@ -93,11 +93,12 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
BloodMonthlyPage( BloodMonthlyPage(
timeSeriesData: model.monthTimeSeriesData, timeSeriesData: model.monthTimeSeriesData,
diabtecPatientResult: model.monthDiabtecPatientResult, diabtecPatientResult: model.monthDiabtecPatientResult, bloodSugarViewMode: model,
), ),
BloodYearPage( BloodYearPage(
timeSeriesData: model.yearTimeSeriesData, timeSeriesData: model.yearTimeSeriesData,
diabtecPatientResult: model.yearDiabtecPatientResult, diabtecPatientResult: model.yearDiabtecPatientResult,
bloodSugarViewMode: model,
) )
], ],
), ),

@ -31,20 +31,15 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty baseViewModel: bloodSugarViewMode,
? Container( body: ListView(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
), ),
), ),
@ -61,7 +56,13 @@ class BloodSugarWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -20,7 +20,7 @@ class LineChartCurved extends StatelessWidget {
getXaxix(); getXaxix();
getYaxix(); getYaxix();
return AspectRatio( return AspectRatio(
aspectRatio: 1.1, aspectRatio: 1.0,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)), borderRadius: BorderRadius.all(Radius.circular(18)),
@ -128,12 +128,19 @@ class LineChartCurved extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { getTitles: (value) {
if (value.toInt() == 0) // if (value.toInt() == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0) // else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else // else
return ''; // return '';
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}';//'${(value.toInt() +(horizontalInterval - value.toInt() % horizontalInterval) )}';
}, },
margin: 12, margin: 12,
), ),

@ -21,7 +21,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
getXaxix(); getXaxix();
return AspectRatio( return AspectRatio(
aspectRatio: 1.1, aspectRatio: 1.0,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)), borderRadius: BorderRadius.all(Radius.circular(18)),
@ -143,12 +143,12 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { getTitles: (value) {
if (value.toInt() == 0) // if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}'; return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}';
else
return '';
}, },
margin: 12, margin: 12,
), ),

@ -1644,6 +1644,7 @@ class TranslationBase {
localizedValues["upcoming-pay-options"][locale.languageCode]; localizedValues["upcoming-pay-options"][locale.languageCode];
String get pleaseAcceptTerms => String get pleaseAcceptTerms =>
localizedValues["please-accept-terms"][locale.languageCode]; localizedValues["please-accept-terms"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -193,24 +193,19 @@ class Utils {
static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
List<Widget> medical = List(); List<Widget> medical = List();
if (projectViewModel.havePrivilege(5)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () => projectViewModel.havePrivilege(5)
Navigator.push( ? Navigator.push(context, FadePage(page: MyAppointments()))
context, : null,
FadePage( child: isLogin
page: MyAppointments(), ? Stack(children: [
), MedicalProfileItem(
);
},
child: isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments, title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png', imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList, subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true, hasBadge: true,
), isEnable: projectViewModel.havePrivilege(5)),
Positioned( Positioned(
right: 0.0, right: 0.0,
child: Badge( child: Badge(
@ -230,10 +225,9 @@ class Utils {
title: TranslationBase.of(context).myAppointments, title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png', imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList, subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true, hasBadge: true,isEnable: projectViewModel.havePrivilege(5),
), ),
)); ));
}
if (projectViewModel.havePrivilege(10)) { if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
@ -245,104 +239,99 @@ class Utils {
)); ));
} }
if (projectViewModel.havePrivilege(7)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context).radiologySubtitle,
),
));
}
if (projectViewModel.havePrivilege(12)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () =>projectViewModel.havePrivilege(7)
Navigator.push( ? Navigator.push(context, FadePage(page: RadiologyHomePage()))
context, : null,
FadePage( child: MedicalProfileItem(
page: HomePrescriptionsPage(), title: TranslationBase.of(context).radiology,
), imagePath: 'radiology_icon.png',
); subTitle: TranslationBase.of(context).radiologySubtitle,
}, isEnable: projectViewModel.havePrivilege(7),
child: MedicalProfileItem( ),
title: TranslationBase.of(context).medicines, ));
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
),
));
}
if (projectViewModel.havePrivilege(25)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12)
onTap: () => Navigator.push( ? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
context, : null,
FadePage( child: MedicalProfileItem(
page: VitalSignDetailsScreen(), title: TranslationBase.of(context).medicines,
), imagePath: 'prescription_icon.png',
), subTitle: TranslationBase.of(context).medicinesSubtitle,
child: MedicalProfileItem( isEnable: projectViewModel.havePrivilege(12),
title: TranslationBase.of(context).vitalSigns, ),
imagePath: 'vital_signs.png', ));
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
), medical.add(InkWell(
)); onTap: () => projectViewModel.havePrivilege(25)
} ? Navigator.push(
context,
FadePage(page: VitalSignDetailsScreen()),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
isEnable: projectViewModel.havePrivilege(25),
),
));
if (projectViewModel.havePrivilege(48)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: ActiveMedicationsPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
),
));
}
if (projectViewModel.havePrivilege(6)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () =>projectViewModel.havePrivilege(48)
Navigator.push( ? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
context, : null,
FadePage( child: MedicalProfileItem(
page: DoctorHomePage(), title: TranslationBase.of(context).myMedical,
), imagePath: 'active_medications.png',
); subTitle: TranslationBase.of(context).myMedicalSubtitle,
}, isEnable: false,
child: MedicalProfileItem( ),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(6)
? Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor, title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle, subTitle: TranslationBase.of(context).myDoctorSubtitle,
), isEnable: projectViewModel.havePrivilege(6)),
)); ));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22)
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
isEnable: projectViewModel.havePrivilege(22),
),
));
if (projectViewModel.havePrivilege(14)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: EyeMeasurementsPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
),
));
}
if (projectViewModel.havePrivilege(22)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
),
));
}
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate())); Navigator.push(context, FadePage(page: InsuranceUpdate()));
@ -354,137 +343,133 @@ class Utils {
), ),
)); ));
if (projectViewModel.havePrivilege(18)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(18)
onTap: () { ? Navigator.push(context, FadePage(page: InsuranceApproval()))
Navigator.push(context, FadePage(page: InsuranceApproval())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).insuranceApproval,
title: TranslationBase.of(context).insuranceApproval, imagePath: 'insurance_approvals_icon.png',
imagePath: 'insurance_approvals_icon.png', subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, isEnable: projectViewModel.havePrivilege(18),
), ),
)); ));
}
if (projectViewModel.havePrivilege(23)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(23)
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), ? Navigator.push(context, FadePage(page: AllergiesPage()))
child: MedicalProfileItem( : null,
title: TranslationBase.of(context).allergies, child: MedicalProfileItem(
imagePath: 'my_allergies_icon.png', title: TranslationBase.of(context).allergies,
subTitle: TranslationBase.of(context).allergiesSubtitle, imagePath: 'my_allergies_icon.png',
), subTitle: TranslationBase.of(context).allergiesSubtitle,
)); isEnable: projectViewModel.havePrivilege(23),
} ),
));
if (projectViewModel.havePrivilege(26)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(26)
onTap: () { ? Navigator.push(context, FadePage(page: MyVaccines()))
Navigator.push(context, FadePage(page: MyVaccines())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).myVaccines,
title: TranslationBase.of(context).myVaccines, imagePath: 'my_vaccines_icon.png',
imagePath: 'my_vaccines_icon.png', subTitle: TranslationBase.of(context).myVaccinesSubtitle,
subTitle: TranslationBase.of(context).myVaccinesSubtitle, isEnable: projectViewModel.havePrivilege(26),
), ),
)); ));
}
if (projectViewModel.havePrivilege(20))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomeReportPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
),
));
if (projectViewModel.havePrivilege(19)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(20)
onTap: () { ? Navigator.push(context, FadePage(page: HomeReportPage()))
Navigator.push(context, FadePage(page: MonthlyReportsPage())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).medical,
title: TranslationBase.of(context).monthly, imagePath: 'medical_reports_icon.png',
imagePath: 'monthly_reports_icon.png', subTitle: TranslationBase.of(context).medicalSubtitle,
subTitle: TranslationBase.of(context).monthlySubtitle, isEnable: projectViewModel.havePrivilege(20),
), ),
)); ));
}
if (projectViewModel.havePrivilege(16)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(19)
onTap: () { ? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
Navigator.push(context, FadePage(page: PatientSickLeavePage())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).monthly,
title: TranslationBase.of(context).sick, imagePath: 'monthly_reports_icon.png',
imagePath: 'sick_leaves_icons.png', subTitle: TranslationBase.of(context).monthlySubtitle,
subTitle: TranslationBase.of(context).sickSubtitle, isEnable: projectViewModel.havePrivilege(19),
), ),
)); ));
}
if (projectViewModel.havePrivilege(47)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(16)
onTap: () { ? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
Navigator.push(context, FadePage(page: MyBalancePage())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).sick,
title: TranslationBase.of(context).myBalance, imagePath: 'sick_leaves_icons.png',
imagePath: 'check-in.png', subTitle: TranslationBase.of(context).sickSubtitle,
subTitle: TranslationBase.of(context).myBalanceSubtitle, isEnable: projectViewModel.havePrivilege(16),
), ),
)); ));
}
if (projectViewModel.havePrivilege(61)) { medical.add(InkWell(
medical.add(MedicalProfileItem( onTap: () => projectViewModel.havePrivilege(47)
title: TranslationBase.of(context).patientCall, ? Navigator.push(context, FadePage(page: MyBalancePage()))
imagePath: 'medical_history_icon.png', : null,
subTitle: TranslationBase.of(context).patientCallSubtitle, child: MedicalProfileItem(
)); title: TranslationBase.of(context).myBalance,
} imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
isEnable: projectViewModel.havePrivilege(47),
),
));
if (projectViewModel.havePrivilege(24)) { // TODO mosa check it
medical.add(InkWell( medical.add(MedicalProfileItem(
onTap: () { title: TranslationBase.of(context).patientCall,
Navigator.push(context, FadePage(page: MyTrackers())); imagePath: 'medical_history_icon.png',
}, subTitle: TranslationBase.of(context).patientCallSubtitle,
child: MedicalProfileItem( isEnable: projectViewModel.havePrivilege(61),
title: TranslationBase.of(context).myTrackers, ));
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
),
));
}
if (projectViewModel.havePrivilege(30))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
),
));
if (projectViewModel.havePrivilege(28)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24)
onTap: () { ? Navigator.push(context, FadePage(page: MyTrackers()))
Navigator.push(context, FadePage(page: AskDoctorHomPage())); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
isEnable: projectViewModel.havePrivilege(24),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30)
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
isEnable: projectViewModel.havePrivilege(30),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28)
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour, title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png', imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle, subTitle: TranslationBase.of(context).askYourSubtitle,
), isEnable: projectViewModel.havePrivilege(28)),
)); ));
}
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
@ -515,23 +500,23 @@ class Utils {
)); ));
} }
if (projectViewModel.havePrivilege(40)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(40)
onTap: () { ? launch('whatsapp://send?phone=18885521858&text=')
launch('whatsapp://send?phone=18885521858&text='); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).chatbot,
title: TranslationBase.of(context).chatbot, imagePath: 'insurance_approvals_icon.png',
imagePath: 'insurance_approvals_icon.png', subTitle: TranslationBase.of(context).chatbotSubtitle,
subTitle: TranslationBase.of(context).chatbotSubtitle, isEnable: projectViewModel.havePrivilege(40),
), ),
)); ));
}
return medical; return medical;
} }
static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) { static Widget loadNetworkImage(
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
@ -584,7 +569,8 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); assert(!(androidPackageName == null),
"Should have valid value in androidPackageName parameter");
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {

@ -97,14 +97,22 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
if (widget.index != 0 && projectViewModel.havePrivilege(34)) if (widget.index != 0 && projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: Icons.home_outlined,
activeIcon: EvaIcons.calendar, activeIcon: Icons.home_outlined,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 2, currentIndex: 0,
name: TranslationBase.of(context).bookAppo, name: TranslationBase.of(context).home,
), ),
if (widget.index == 0 && projectViewModel.havePrivilege(34)) // BottomNavigationItem(
// icon: EvaIcons.calendar,
// activeIcon: EvaIcons.calendar,
// changeIndex: _changeIndex,
// index: _index,
// currentIndex: 2,
// name: TranslationBase.of(context).bookAppo,
// ),
if (/*widget.index == 0 && */projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,

@ -103,7 +103,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
color: Colors.white, color: Colors.white,
), ),
Texts( Texts(
TranslationBase.of(context).sendCopy, TranslationBase.of(context).sendEmail,
color: Colors.white, color: Colors.white,
) )
], ],

@ -8,16 +8,19 @@ import '../../../Constants.dart';
import '../text.dart'; import '../text.dart';
class MedicalProfileItem extends StatelessWidget { class MedicalProfileItem extends StatelessWidget {
MedicalProfileItem(
{@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge});
final String imagePath; final String imagePath;
final String title; final String title;
final String subTitle; final String subTitle;
final bool hasBadge = false; final bool hasBadge = false;
bool isEnable;
MedicalProfileItem({
@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge,
this.isEnable = true,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,27 +29,48 @@ class MedicalProfileItem extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.14, height: MediaQuery.of(context).size.height * 0.14,
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white),
color: Colors.white clipBehavior: Clip.antiAlias,
), child: Stack(
padding: EdgeInsets.all(10), children: [
child: Column( Padding(
mainAxisAlignment: MainAxisAlignment.spaceBetween, padding: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Texts(title, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 1.5 * SizeConfig.textMultiplier, children: <Widget>[
color: secondaryColor, Texts(title,
fontWeight: FontWeight.bold), fontSize: 1.5 * SizeConfig.textMultiplier,
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,), color: secondaryColor,
Align( fontWeight: FontWeight.bold),
alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, Texts(
child: Image.asset( subTitle,
"assets/images/medical/$imagePath", fontSize: 1.4 * SizeConfig.textMultiplier,
height: SizeConfig.heightMultiplier * 5, ),
width: SizeConfig.heightMultiplier * 5, Align(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
child: Image.asset(
"assets/images/medical/$imagePath",
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
),
)
],
), ),
) ),
isEnable
? Container()
: Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
], ],
), ),
); );

@ -217,6 +217,7 @@ flutter:
- assets/images/svg/ - assets/images/svg/
- assets/tracker/ - assets/tracker/
- assets/images/AlHabibMedicalService/ - assets/images/AlHabibMedicalService/
- assets/images/AlHabibMedicalService/health_calculator/
- assets/images/pharmacy_module/ - assets/images/pharmacy_module/
- assets/images/gif/ - assets/images/gif/
- assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/payment/

Loading…
Cancel
Save