adding doctor list to health calculator

merge-requests/318/head
hussam al-habibeh 3 years ago
parent 854352d9ce
commit 446021eb90

@ -193,5 +193,6 @@ class DoctorsListTime {
DoctorsListTime({filterName, DoctorListByTimeModel doctor}) {
doctorsByTimeList.add(doctor);
this.filterName = filterName;
}
}

@ -65,12 +65,7 @@ class BariatricsViewModel extends BaseViewModel {
doctorLists.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (patientLabOrdersClinic.length != 0) {
var value = doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])]
.doctorsByTimeList
.where((e) => e.projectName == element.projectName)
.toList();
if (value.isEmpty)
doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])].doctorsByTimeList.add(element);
doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])].doctorsByTimeList.add(element);
} else {
doctorLists.add(DoctorsListTime(filterName: element.projectName, doctor: element));
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
@ -12,6 +14,7 @@ class BmrResultPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: 'BMR Calculator',
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -55,8 +58,13 @@ class BmrResultPage extends StatelessWidget {
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
),
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
}),
),
],
),

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
@ -68,6 +70,12 @@ class FatResult extends StatelessWidget {
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
@ -45,13 +47,18 @@ class CalorieResultPage extends StatelessWidget {
),
),
Container(
child:
Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'dart:math';
@ -156,6 +158,12 @@ class CarbsResult extends StatelessWidget {
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -43,17 +45,13 @@ class DeliveryDueResult extends StatelessWidget {
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800,
fontSize: 21.0,
color: Color(0xffC5272D)),
fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
Texts(
'To:',
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800,
fontSize: 21.0,
color: Color(0xffC5272D)),
fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
@ -94,6 +92,12 @@ class DeliveryDueResult extends StatelessWidget {
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -24,106 +25,100 @@ class DoctorList extends StatelessWidget {
body: ListView.builder(
itemCount: model.doctorLists.length,
itemBuilder: (BuildContext context, int index) {
return ExpansionTile(
title: Text(model.doctorListByTime[index].projectName),
children: [
Card(
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0),
child: Container(
//height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(color: Colors.white),
child: ExpansionTile(
title: Padding(
padding: EdgeInsets.all(21.0),
child: Texts(model.doctorLists[index].filterName),
),
child: Container(
decoration: BoxDecoration(),
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(model.doctorListByTime[index].doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
),
Expanded(
flex: 4,
child: Container(
width: MediaQuery.of(context).size.width * 0.55,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (model.doctorListByTime[index].doctorTitle != null)
Text(
model.doctorListByTime[index].doctorTitle +
" " +
model.doctorListByTime[index].name,
style: TextStyle(
fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(
model.doctorListByTime[index].clinicName != null
? model.doctorListByTime[index].clinicName
: "",
style: TextStyle(
fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(model.doctorListByTime[index].projectName,
style: TextStyle(
fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
),
// if (doctor.speciality != null)
// Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDoctorSpeciality(this.doctor.speciality).trim(),
// style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
// ),
// this.doctor.nearestFreeSlot != null
// ? Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDate(this.doctor.nearestFreeSlot),
// style: TextStyle(
// fontSize: 14.0,
// fontWeight: FontWeight.bold,
// color: Colors.green[600],
// letterSpacing: 1.0)),
// )
// : Container(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: model.doctorListByTime[index].actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
children: model.doctorLists[index].doctorsByTimeList
.map((doctor) => Card(
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
decoration: BoxDecoration(),
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
child: Image.network(model.doctorListByTime[index].nationalityFlagURL,
width: 25.0, height: 25.0),
),
Expanded(
flex: 4,
child: Container(
width: MediaQuery.of(context).size.width * 0.55,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (doctor.doctorTitle != null)
Text(doctor.doctorTitle + " " + doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.clinicName != null ? doctor.clinicName : "",
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
child: Image.network(doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
),
],
),
],
),
),
],
),
],
),
],
),
),
),
),
],
),
),
))
.toList(),
),
],
),
);
}),
));

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'dart:math';
@ -11,12 +13,7 @@ class IdealBodyResult extends StatelessWidget {
final double overWeightBy;
final String textResult;
IdealBodyResult(
{this.idealBodyWeight,
this.minRange,
this.mixRange,
this.overWeightBy,
this.textResult});
IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult});
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -82,8 +79,7 @@ class IdealBodyResult extends StatelessWidget {
: overWeightBy > 10 && overWeightBy < 17
? Column(
children: [
Texts(
'This means that the weight is a little bit more than ideal weight by'),
Texts('This means that the weight is a little bit more than ideal weight by'),
Texts(overWeightBy.toStringAsFixed(1)),
Texts(
'May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
@ -161,6 +157,12 @@ class IdealBodyResult extends StatelessWidget {
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -9,8 +11,7 @@ class OvulationResult extends StatelessWidget {
var dateTo;
var conceivedDate;
var deliveryDue;
OvulationResult(
{this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
OvulationResult({this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
//var newFormat = DateFormat("yy-MM-dd");
@override
@ -84,6 +85,12 @@ class OvulationResult extends StatelessWidget {
width: 350,
child: Button(
label: 'See List Of Doctors',
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
},
),
),
],

@ -41,6 +41,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
onModelReady: (model) => model.getWeight(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [
IconButton(

@ -28,46 +28,52 @@ class WeightMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
isShowDecPage: false,
body: model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -76,12 +82,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -109,12 +111,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -26,47 +26,53 @@ class WeightWeeklyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
isShowDecPage: false,
body: model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5,
),
children: fullData(context, projectViewModel, model),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -75,12 +81,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -120,12 +122,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -18,55 +18,61 @@ import 'package:provider/provider.dart';
class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model;
const WeightYearPage({Key key, this.model, })
: super(key: key);
const WeightYearPage({
Key key,
this.model,
}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
)
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
isShowDecPage: false,
body: model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -75,12 +81,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -108,12 +110,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
@ -128,7 +126,7 @@ class WeightYearPage extends StatelessWidget {
),
);
model.yearWeightMeasurementResult.forEach(
(diabtec) {
(diabtec) {
tableRow.add(
TableRow(
children: [

@ -15,6 +15,7 @@ class MyTrackers extends StatelessWidget {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myTracker,
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
@ -27,22 +28,24 @@ class MyTrackers extends StatelessWidget {
children: [
Expanded(
child: InkWell(
onTap: ()=> Navigator.push(context, FadePage(page: BloodSugarHomePage())),
onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width*0.35,
height:MediaQuery.of(context).size.width*0.35 ,
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
color: Colors.white
),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/tracker/blood-suger.png',width: 60.0,),
SizedBox(height: 15,),
Image.asset(
'assets/tracker/blood-suger.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodSugar),
],
),
@ -51,22 +54,24 @@ class MyTrackers extends StatelessWidget {
),
Expanded(
child: InkWell(
onTap: ()=> Navigator.push(context, FadePage(page: BloodPressureHomePage())),
onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width*0.35,
height:MediaQuery.of(context).size.width*0.35 ,
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
color: Colors.white
),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/tracker/blood-pressure.png',width: 60.0,),
SizedBox(height: 15,),
Image.asset(
'assets/tracker/blood-pressure.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodPressure),
],
),
@ -80,22 +85,24 @@ class MyTrackers extends StatelessWidget {
children: [
Expanded(
child: InkWell(
onTap: ()=> Navigator.push(context, FadePage(page: WeightHomePage())),
onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width*0.35,
height:MediaQuery.of(context).size.width*0.35 ,
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
color: Colors.white
),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/tracker/weight.png',width: 60.0,),
SizedBox(height: 15,),
Image.asset(
'assets/tracker/weight.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).weight),
],
),

Loading…
Cancel
Save