My tracker fixes

merge-requests/440/head
haroon amjad 3 years ago
parent 40cbca565a
commit 07a98d75c6

@ -24,6 +24,7 @@ class BloodPressureService extends BaseService {
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
response['List_MonthBloodPressureResultAverage'].forEach((item) {
monthDiabtectResultAverageList
.add(MonthBloodPressureResultAverage.fromJson(item));
@ -111,6 +112,7 @@ class BloodPressureService extends BaseService {
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int lineItemNo,
int measuredArm}) async {
hasError = false;
super.error = "";
@ -120,6 +122,7 @@ class BloodPressureService extends BaseService {
body['DiastolicPressure'] = diastolicPressure;
body['SystolicePressure'] = systolicePressure;
body['MeasuredArm'] ='$measuredArm';
body['LineItemNo'] = lineItemNo;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT,

@ -20,10 +20,10 @@ class WeightService extends BaseService {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
monthWeightMeasurementResultAverage.clear();
weekWeightMeasurementResultAverage.clear();
yearWeightMeasurementResultAverage.clear();
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResultAverage.clear();
weekWeightMeasurementResultAverage.clear();
yearWeightMeasurementResultAverage.clear();
response['List_MonthWeightMeasurementResultAverage'].forEach((item) {
monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item));
});
@ -43,10 +43,10 @@ class WeightService extends BaseService {
Future getWeightMeasurementResult() async {
hasError = false;
monthWeightMeasurementResult.clear();
weekWeightMeasurementResult.clear();
yearWeightMeasurementResult.clear();
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResult.clear();
weekWeightMeasurementResult.clear();
yearWeightMeasurementResult.clear();
response['List_WeekWeightMeasurementResult'].forEach((item) {
weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item));

@ -75,17 +75,17 @@ class BloodPressureViewMode extends BaseViewModel {
}
}
Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, bool isUpdate = false}) async {
Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, int lineItemNo, bool isUpdate = false}) async {
setState(ViewState.BusyLocal);
if (!isUpdate)
await bloodPressureService.addDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm);
else
await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm);
await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm, lineItemNo: lineItemNo);
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodPressure();
// await getBloodPressure();
setState(ViewState.Idle);
}
}

@ -4,13 +4,15 @@ class DoctorRateDetails {
dynamic clinicID;
dynamic rate;
dynamic patientNumber;
dynamic ratio;
DoctorRateDetails(
{this.doctorID,
this.projectID,
this.clinicID,
this.rate,
this.patientNumber});
this.patientNumber,
this.ratio});
DoctorRateDetails.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
@ -18,6 +20,7 @@ class DoctorRateDetails {
clinicID = json['ClinicID'];
rate = json['Rate'];
patientNumber = json['PatientNumber'];
ratio = json['Ratio'];
}
Map<String, dynamic> toJson() {
@ -27,6 +30,7 @@ class DoctorRateDetails {
data['ClinicID'] = this.clinicID;
data['Rate'] = this.rate;
data['PatientNumber'] = this.patientNumber;
data['Ratio'] = this.ratio;
return data;
}
}

@ -49,7 +49,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: ListView.separated(
body: model.hhcAllPresOrders.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
@ -170,7 +170,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
);
},
separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.hhcAllPresOrders.length),
itemCount: model.hhcAllPresOrders.length) : getNoDataWidget(context),
);
}
}

@ -32,7 +32,7 @@ class ParkingPage extends StatelessWidget {
? Column(
children: <Widget>[
Texts(
TranslationBase.of(context).parkingTitle,
TranslationBase.of(context).parkingDescription,
fontWeight: FontWeight.normal,
fontSize: 15,
),
@ -149,6 +149,7 @@ class ParkingPage extends StatelessWidget {
),
bottomSheet: !model.isSavePark
? Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(

@ -125,7 +125,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
),
],
),
bottomSheet: Container(
bottomSheet: projectViewModel.isLogin ? Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
@ -133,7 +133,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
projectViewModel.isLogin ? null : () => {},
disabledColor: Colors.grey,
),
),
) : Container(),
),
);
}

@ -64,8 +64,28 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
TabBar(
labelColor: Colors.black,
tabs: [
Tab(text: TranslationBase.of(context).consultation),
Tab(text: TranslationBase.of(context).logs),
Tab(
child: Text(
TranslationBase.of(context).consultation,
style: TextStyle(
color: Colors.black,
fontSize: 14,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
),
Tab(
child: Text(
TranslationBase.of(context).logs,
style: TextStyle(
color: Colors.black,
fontSize: 14,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
),
],
controller: _tabController,
),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
class LiveCareLogs extends StatefulWidget {
@ -20,21 +21,20 @@ class _LiveCareLogsState extends State<LiveCareLogs> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.erRequestHistoryList.length,
itemBuilder: (context, index) {
return widget.erRequestHistoryList[index].callStatus < 4
? Container()
: LiveCareHistoryCard(
erRequestHistoryList: widget.erRequestHistoryList[index]);
},
),
),
child: widget.erRequestHistoryList.length > 0
? Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.erRequestHistoryList.length,
itemBuilder: (context, index) {
return widget.erRequestHistoryList[index].callStatus < 4 ? Container() : LiveCareHistoryCard(erRequestHistoryList: widget.erRequestHistoryList[index]);
},
),
)
: Container(margin: EdgeInsets.only(top: 200.0), child: getNoDataWidget(context)),
);
}
}

@ -16,6 +16,8 @@ class AllergiesPage extends StatelessWidget {
onModelReady: (model) => model.getAllergies(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).allergies,
baseViewModel: model,
description: TranslationBase.of(context).infoAllergies,

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -51,9 +51,10 @@ class _AddWeightPageState extends State<AddWeightPage> {
dayWeightDate = widget.dayWeightDate;
timeWeightDate = widget.dayWeightDate;
measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureUnitEnList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
weightUnit = widget.weightUnit;
// if (measureUnitEnList.contains(widget.measureTimeSelectedType))
// weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
// else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
_weightValueController.text = widget.weightValue;
validateForm();
}
@ -215,46 +216,46 @@ class _AddWeightPageState extends State<AddWeightPage> {
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_weightValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
widget.model
.updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
} else
widget.model
.addWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900],
disabled: isButtonDisabled,
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(
TranslationBase.of(context).save.toUpperCase(),
isButtonDisabled ? null : () async {
if (_weightValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
widget.model
.updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit + 1,
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
} else
widget.model
.addWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
}
},
disabledColor: Colors.grey,
),
),
));
}

@ -1,6 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -56,7 +55,8 @@ class WeightWeeklyPage extends StatelessWidget {
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
@ -124,7 +124,7 @@ class WeightWeeklyPage extends StatelessWidget {
page: AddWeightPage(
isUpdate: true,
dayWeightDate: diabtec.weightDate,
measureTimeSelectedType: 'Kg',
measureTimeSelectedType: diabtec.unit == "1" ? 'Kg' : 'Pound',
weightValue: diabtec.weightMeasured.toString(),
lineItemNo: diabtec.lineItemNo,
weightUnit: int.parse(diabtec.unit),
@ -138,8 +138,6 @@ class WeightWeeklyPage extends StatelessWidget {
});
},
child: Container(
// height: 70,
// padding: EdgeInsets.all(10),
child: Icon(
Icons.edit,
color: Color(0xff575757),

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -21,11 +22,13 @@ class AddBloodPressurePage extends StatefulWidget {
final String measureTimeSelectedType;
final bool isUpdate;
final int lineItemNo;
final int measuredArm;
final String bloodSystolicValue;
final String bloodDiastolicValue;
final BloodPressureViewMode model;
const AddBloodPressurePage({Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
const AddBloodPressurePage(
{Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.measuredArm, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
: super(key: key);
@override
@ -39,13 +42,10 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
DateTime timeSugarDate = DateTime.now();
int measuredArm = 1;
bool isButtonDisabled = true;
final List<String> measureTimeEnList = [
'Left Arm ',
'Right Arm',
];
final List<String> measureTimeEnList = ['Right Arm', 'Left Arm'];
final List<String> measureTimeArList = [
'الذراع الأيسر',
'الذراع الأيمن',
'الذراع الأيسر',
];
String measureTimeSelectedType = 'Left Arm';
@ -56,9 +56,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
bloodSugarDate = widget.bloodSugarDate;
bloodSugarDate = widget.bloodSugarDate;
measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureTimeEnList.contains(widget.measureTimeSelectedType))
measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType);
else if (measureTimeArList.contains(widget.measureTimeSelectedType)) measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
measuredArm = widget.measuredArm - 1;
_bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm();
@ -119,7 +117,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(projectViewModel.isArabic ? measureTimeArList[0] : measureTimeEnList[0]),
Texts(projectViewModel.isArabic ? measureTimeArList[measuredArm] : measureTimeEnList[measuredArm]),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
@ -224,38 +222,37 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(),
measuredArm: measuredArm,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal)
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(
TranslationBase.of(context).save,
isButtonDisabled ? null : () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(),
measuredArm: (measuredArm + 1),
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
;
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
;
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900],
disabled: isButtonDisabled,
});
}
},
disabledColor: Colors.grey,
),
),
));
}

@ -1,22 +1,23 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'AddBloodPressurePage.dart';
import 'BloodPressureMonthly.dart';
import 'BloodPressureYeaPage.dart';
import 'bloodPressureWeeklyPage.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
class BloodPressureHomePage extends StatefulWidget {
@override
@ -43,97 +44,113 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<BloodPressureViewMode>(
onModelReady: (model) => model.getBloodPressure(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodPressure,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: TabBarWidget(
tabController: _tabController,
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
BloodPressureWeeklyPage(
model: model,
),
BloodPressureMonthlyPage(
model: model,
),
BloodPressureYearPage(
model: model,
)
],
),
)
],
),
floatingActionButton: Stack(children: [
Positioned(
bottom: 80,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddBloodPressurePage(
builder: (_, model, w) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase
.of(context)
.bloodPressure,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: TabBarWidget(
tabController: _tabController,
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
BloodPressureWeeklyPage(
model: model,
),
BloodPressureMonthlyPage(
model: model,
)));
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
)),
))
]),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
BloodPressureYearPage(
model: model,
)
],
),
)
],
),
floatingActionButton: Stack(children: [
Positioned(
bottom: 60,
right: projectViewModel.isArabic ? MediaQuery
.of(context)
.size
.width * .85 : 0,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddBloodPressurePage(
model: model,
))).then((value) {
model.getBloodPressure();
});
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme
.of(context)
.primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
)),
))
]),
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: DefaultButton(
TranslationBase
.of(context)
.sendEmail,
() {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase
.of(context)
.emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
// label: TranslationBase.of(context).sendEmail,
// backgroundColor: Colors.red[900],
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
),
),
)),
),
),
)),
);
}
}

@ -109,9 +109,11 @@ class BloodPressureWeeklyPage extends StatelessWidget {
bloodDiastolicValue: diabtec.diastolicPressure.toString(),
bloodSystolicValue: diabtec.systolicePressure.toString(),
measureTimeSelectedType: diabtec.measuredArmDesc,
measuredArm: diabtec.measuredArm,
),
),
).then((value) {
model.getBloodPressure();
if(model.weekDiabtecPatientResult.isEmpty) {
model.weightWeekTimeSeriesDataTop.clear();
model.weightWeekTimeSeriesDataLow.clear();

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -23,9 +23,10 @@ class AddBloodSugarPage extends StatefulWidget {
final String measuredTime;
final String bloodSugarValue;
final int lineItemNo;
final String measuredSelectedType;
final BloodSugarViewMode bloodSugarViewMode;
AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode})
AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType})
: super(key: key);
@override
@ -77,6 +78,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
measuredTime = measureTimeEnList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime);
_bloodSugarValueController.text = widget.bloodSugarValue;
measureTimeSelectedType = widget.measuredSelectedType;
validateForm();
}
}
@ -89,17 +91,6 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
// appBarIcons: widget.isUpdate
// ? [
// IconButton(
// icon: Icon(Icons.delete),
// color: Colors.white,
// onPressed: () {
// },
// )
// ]
// : null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
@ -258,46 +249,48 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_bloodSugarValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
await widget.bloodSugarViewMode.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult: _bloodSugarValueController.text.toString());
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(
TranslationBase.of(context).save.toUpperCase(),
isButtonDisabled
? null
: () async {
if (_bloodSugarValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
await widget.bloodSugarViewMode.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult: _bloodSugarValueController.text.toString());
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
} else {
await widget.bloodSugarViewMode.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult: _bloodSugarValueController.text.toString(),
bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
} else {
await widget.bloodSugarViewMode.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult: _bloodSugarValueController.text.toString(),
bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900],
disabled: isButtonDisabled,
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}
}
},
disabledColor: Colors.grey,
),
),
));
}

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -85,7 +86,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTick
floatingActionButton: Stack(
children: [
Positioned(
bottom: 130,
bottom: 60,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0,
child: InkWell(
onTap: () {
@ -111,36 +112,36 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTick
],
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: DefaultButton(
TranslationBase.of(context).sendEmail,
() {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
});
},
),
);
},
),
),
),
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -33,7 +34,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
title: '${TranslationBase.of(AppGlobal.context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
),
@ -43,7 +44,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
child: Texts(TranslationBase.of(AppGlobal.context).details),
),
Container(
padding: EdgeInsets.all(10),
@ -54,7 +55,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
child: Texts(TranslationBase.of(AppGlobal.context).noDataAvailable),
),
)
: Table(
@ -114,6 +115,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
lineItemNo: diabtec.lineItemNo,
measureUnitSelectedType: diabtec.unit,
bloodSugarViewMode: bloodSugarViewMode,
measuredSelectedType: diabtec.measuredDesc,
),
),
).then((value) {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/Constants.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';
@ -85,7 +86,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.grey),
shape: BoxShape.rectangle, color: secondaryColor),
),
SizedBox(
width: 5,

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -26,7 +27,7 @@ class ReportListWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return ListView.separated(
return reportList.length > 0 ? ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
separatorBuilder: (context, index) => SizedBox(height: 14),
@ -112,7 +113,7 @@ class ReportListWidget extends StatelessWidget {
);
},
itemCount: reportList.length,
);
) : getNoDataWidget(context) ;
}
void showConfirmMessage(Reports report) {

@ -137,7 +137,7 @@ class ShowChart extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 10,
),
// interval: 3.0,
interval: null,
margin: 12,
),
),

@ -160,6 +160,7 @@ class _AppDrawerState extends State<AppDrawer> {
),
onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null);
sharedPref.remove(CLINICS_LIST);
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');
} else {
@ -310,6 +311,7 @@ class _AppDrawerState extends State<AppDrawer> {
isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, fontHeight: projectProvider.isArabic ? 1 : 0.8, projectProvider: projectProvider),
onTap: () {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
sharedPref.remove(CLINICS_LIST);
sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');

@ -223,7 +223,7 @@ class DoctorHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.8,
width: 350.0,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -249,11 +249,14 @@ class DoctorHeader extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(margin: EdgeInsets.only(left: 20.0), child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black, fontWeight: FontWeight.bold))),
Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(),
style: TextStyle(fontSize: 32.0, color: Colors.black, letterSpacing: -0.64, fontWeight: FontWeight.bold))),
Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: RatingBar.readOnly(
initialRating: this.headerModel.actualDoctorRate.toDouble(),
initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -267,7 +270,9 @@ class DoctorHeader extends StatelessWidget {
),
Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))),
transform: Matrix4.translationValues(0.0, -10.0, 0.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews,
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
@ -278,22 +283,14 @@ class DoctorHeader extends StatelessWidget {
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[0].patientNumber, Colors.green[700]),
],
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%",
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
@ -307,22 +304,14 @@ class DoctorHeader extends StatelessWidget {
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[1].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffB7B723),
),
),
),
child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[1].patientNumber, Color(0xffB7B723)),
],
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%",
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
@ -336,22 +325,14 @@ class DoctorHeader extends StatelessWidget {
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[2].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEBA727),
),
),
),
child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[2].patientNumber, Color(0xffEBA727)),
],
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%",
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
@ -365,22 +346,14 @@ class DoctorHeader extends StatelessWidget {
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[3].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEB7227),
),
),
),
child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[3].patientNumber, Color(0xffEB7227)),
],
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%",
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
@ -395,53 +368,18 @@ class DoctorHeader extends StatelessWidget {
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[4].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffE20C0C),
),
),
),
child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[4].patientNumber, Color(0xffE20C0C)),
],
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%",
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
),
// Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
// Container(
// margin: EdgeInsets.only(top: 0.0),
// child: Align(
// alignment: FractionalOffset.bottomCenter,
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// minWidth: MediaQuery.of(context).size.width,
// height: 40.0,
// child: RaisedButton(
// elevation: 0.0,
// color: Colors.white,
// textColor: Colors.red,
// hoverColor: Colors.transparent,
// focusColor: Colors.transparent,
// highlightColor: Colors.transparent,
// disabledColor: new Color(0xFFbcc2c4),
// onPressed: () {
// Navigator.of(context).pop();
// },
// child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
// ),
// ),
// ),
// ),
],
),
),
@ -462,4 +400,26 @@ class DoctorHeader extends StatelessWidget {
var width = (patientNumber / this.headerModel.totalReviews) * 100;
return width.roundToDouble();
}
Widget getRatingLine(int patientNumber, Color color) {
return Container(
margin: EdgeInsets.only(top: 10.0),
child: Stack(children: [
SizedBox(
width: 135.0,
height: 4.0,
child: Container(
color: Colors.grey[300],
),
),
SizedBox(
width: getRatingWidth(patientNumber) * 1.35,
height: 4.0,
child: Container(
color: color,
),
),
]),
);
}
}

Loading…
Cancel
Save