adding doctor list to health calculator

merge-update-with-lab-changes
hussam al-habibeh 5 years ago
parent 854352d9ce
commit 446021eb90

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

@ -65,12 +65,7 @@ class BariatricsViewModel extends BaseViewModel {
doctorLists.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); doctorLists.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
var value = doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])] doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])].doctorsByTimeList.add(element);
.doctorsByTimeList
.where((e) => e.projectName == element.projectName)
.toList();
if (value.isEmpty)
doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])].doctorsByTimeList.add(element);
} else { } else {
doctorLists.add(DoctorsListTime(filterName: element.projectName, doctor: element)); 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
@ -12,6 +14,7 @@ class BmrResultPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: 'BMR Calculator', appBarTitle: 'BMR Calculator',
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -55,8 +58,13 @@ class BmrResultPage extends StatelessWidget {
Container( Container(
width: 350, width: 350,
child: Button( 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
@ -68,6 +70,12 @@ class FatResult extends StatelessWidget {
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', 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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
@ -45,13 +47,18 @@ class CalorieResultPage extends StatelessWidget {
), ),
), ),
Container( Container(
child: child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
), ),
Container( Container(
width: 350, width: 350,
child: Button( 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
@ -156,6 +158,12 @@ class CarbsResult extends StatelessWidget {
width: 350, width: 350,
child: Button( 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -43,17 +45,13 @@ class DeliveryDueResult extends StatelessWidget {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
Texts(DateFormat.yMMMEd().format(dateFrom), Texts(DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
fontSize: 21.0,
color: Color(0xffC5272D)),
Texts( Texts(
'To:', 'To:',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
Texts(DateFormat.yMMMEd().format(dateTo), Texts(DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
fontSize: 21.0,
color: Color(0xffC5272D)),
Texts( Texts(
'You have conceived on:', 'You have conceived on:',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -94,6 +92,12 @@ class DeliveryDueResult extends StatelessWidget {
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', 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/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,106 +25,100 @@ class DoctorList extends StatelessWidget {
body: ListView.builder( body: ListView.builder(
itemCount: model.doctorLists.length, itemCount: model.doctorLists.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ExpansionTile( return Padding(
title: Text(model.doctorListByTime[index].projectName), padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0),
children: [ child: Container(
Card( //height: MediaQuery.of(context).size.height * 0.09,
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), decoration: BoxDecoration(color: Colors.white),
color: Colors.white,
shape: RoundedRectangleBorder( child: ExpansionTile(
borderRadius: BorderRadius.circular(10), title: Padding(
padding: EdgeInsets.all(21.0),
child: Texts(model.doctorLists[index].filterName),
), ),
child: Container( children: model.doctorLists[index].doctorsByTimeList
decoration: BoxDecoration(), .map((doctor) => Card(
padding: EdgeInsets.all(7.0), margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
width: MediaQuery.of(context).size.width, color: Colors.white,
child: Row( shape: RoundedRectangleBorder(
mainAxisAlignment: MainAxisAlignment.start, borderRadius: BorderRadius.circular(10),
children: <Widget>[ ),
Expanded( child: Container(
flex: 1, decoration: BoxDecoration(),
child: ClipRRect( padding: EdgeInsets.all(7.0),
borderRadius: BorderRadius.circular(100.0), width: MediaQuery.of(context).size.width,
child: Image.network(model.doctorListByTime[index].doctorImageURL, child: Row(
fit: BoxFit.fill, height: 60.0, width: 60.0), mainAxisAlignment: MainAxisAlignment.start,
), children: <Widget>[
), Expanded(
Expanded( flex: 1,
flex: 4, child: ClipRRect(
child: Container( borderRadius: BorderRadius.circular(100.0),
width: MediaQuery.of(context).size.width * 0.55, child: Image.network(doctor.doctorImageURL,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), fit: BoxFit.fill, height: 60.0, width: 60.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,
), ),
Container( ),
child: Image.network(model.doctorListByTime[index].nationalityFlagURL, Expanded(
width: 25.0, height: 25.0), 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
@ -11,12 +13,7 @@ class IdealBodyResult extends StatelessWidget {
final double overWeightBy; final double overWeightBy;
final String textResult; final String textResult;
IdealBodyResult( IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult});
{this.idealBodyWeight,
this.minRange,
this.mixRange,
this.overWeightBy,
this.textResult});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -82,8 +79,7 @@ class IdealBodyResult extends StatelessWidget {
: overWeightBy > 10 && overWeightBy < 17 : overWeightBy > 10 && overWeightBy < 17
? Column( ? Column(
children: [ children: [
Texts( Texts('This means that the weight is a little bit more than ideal weight by'),
'This means that the weight is a little bit more than ideal weight by'),
Texts(overWeightBy.toStringAsFixed(1)), Texts(overWeightBy.toStringAsFixed(1)),
Texts( Texts(
'May wish to consult with the doctor for medical help. Click to view our list of Doctors'), '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, width: 350,
child: Button( 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/buttons/button.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -9,8 +11,7 @@ class OvulationResult extends StatelessWidget {
var dateTo; var dateTo;
var conceivedDate; var conceivedDate;
var deliveryDue; var deliveryDue;
OvulationResult( OvulationResult({this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
{this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
//var newFormat = DateFormat("yy-MM-dd"); //var newFormat = DateFormat("yy-MM-dd");
@override @override
@ -84,6 +85,12 @@ class OvulationResult extends StatelessWidget {
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', 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(), onModelReady: (model) => model.getWeight(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).weight, appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [ appBarIcons: [
IconButton( IconButton(

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

@ -26,47 +26,53 @@ class WeightWeeklyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( isShowDecPage: false,
children: [ body: model.weightWeekTimeSeriesData.isEmpty
Container( ? Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), child: Center(
color: Colors.white, child: Texts(TranslationBase.of(context).noDataAvailable),
child: LineChartCurved( ),
horizontalInterval: 1.0, )
title: TranslationBase.of(context).weight, : ListView(
timeSeries: model.weightWeekTimeSeriesData, children: [
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5, Container(
), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
), color: Colors.white,
SizedBox( child: LineChartCurved(
height: 12, horizontalInterval: 1.0,
), title: TranslationBase.of(context).weight,
Padding( timeSeries: model.weightWeekTimeSeriesData,
padding: const EdgeInsets.all(8.0), indexes: model.weightWeekTimeSeriesData.length ~/ 5.5,
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),
), ),
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, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -75,12 +81,8 @@ class WeightWeeklyPage 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 topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.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,12 +122,8 @@ class WeightWeeklyPage 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 topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -18,55 +18,61 @@ import 'package:provider/provider.dart';
class WeightYearPage extends StatelessWidget { class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model; final WeightPressureViewModel model;
const WeightYearPage({
const WeightYearPage({Key key, this.model, }) Key key,
: super(key: key); this.model,
}) : 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: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView( isShowDecPage: false,
children: [ body: model.weightYearTimeSeriesData.isEmpty
Container( ? Container(
width: double.maxFinite, child: Center(
color: Colors.white, child: Texts(TranslationBase.of(context).noDataAvailable),
child: LineChartCurved( ),
horizontalInterval: 2.0, )
title: TranslationBase.of(context).weight, : ListView(
timeSeries: model.weightYearTimeSeriesData, children: [
indexes: model.weightYearTimeSeriesData.length ~/ 5.5, Container(
) width: double.maxFinite,
), color: Colors.white,
SizedBox( child: LineChartCurved(
height: 12, horizontalInterval: 2.0,
), title: TranslationBase.of(context).weight,
Padding( timeSeries: model.weightYearTimeSeriesData,
padding: const EdgeInsets.all(8.0), indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
child: Texts(TranslationBase.of(context).details), )),
), SizedBox(
Container( height: 12,
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),
), ),
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, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -75,12 +81,8 @@ class WeightYearPage 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 topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -108,12 +110,8 @@ class WeightYearPage 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 topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -128,7 +126,7 @@ class WeightYearPage extends StatelessWidget {
), ),
); );
model.yearWeightMeasurementResult.forEach( model.yearWeightMeasurementResult.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [

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

Loading…
Cancel
Save