Merge branch 'blood_pressure' into 'development'

Blood pressure

See merge request Cloud_Solution/diplomatic-quarter!362
merge-requests/361/merge
Mohammad Aljammal 3 years ago
commit 41f1704790

@ -50,6 +50,15 @@ class _BodyFatState extends State<BodyFat> {
TextEditingController waistController = TextEditingController(); TextEditingController waistController = TextEditingController();
TextEditingController hipController = TextEditingController(); TextEditingController hipController = TextEditingController();
@override
void initState() {
neckController.text = neck.toString();
hipController.text = hip.toString();
waistController.text = waist.toString();
heightController.text = heightCm.toString();
super.initState();
}
void updateColorHeight(int type) { void updateColorHeight(int type) {
//MG/DLT card //MG/DLT card
if (type == 1) { if (type == 1) {
@ -319,11 +328,6 @@ class _BodyFatState extends State<BodyFat> {
child: TextFormField( child: TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: heightController, controller: heightController,
decoration: InputDecoration(
labelText: heightCm.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
), ),
), ),
), ),
@ -350,6 +354,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (heightCm < 250) heightCm++; if (heightCm < 250) heightCm++;
heightController.text = heightCm.toString();
}); });
}, },
), ),
@ -362,6 +367,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (heightCm > 0) heightCm--; if (heightCm > 0) heightCm--;
heightController.text = heightCm.toString();
}); });
}, },
), ),
@ -381,6 +387,7 @@ class _BodyFatState extends State<BodyFat> {
onChanged: (double newValue) { onChanged: (double newValue) {
setState(() { setState(() {
heightCm = newValue.round(); heightCm = newValue.round();
heightController.text = heightCm.toString();
}); });
}, },
activeColor: Color(0xffC5272D), activeColor: Color(0xffC5272D),
@ -492,15 +499,10 @@ class _BodyFatState extends State<BodyFat> {
Expanded( Expanded(
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 10.0), padding: const EdgeInsets.only(left: 15.0, bottom: 0),
child: TextFormField( child: TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: neckController, controller: neckController,
decoration: InputDecoration(
labelText: neck.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
), ),
), ),
), ),
@ -527,6 +529,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (neck < 60) neck++; if (neck < 60) neck++;
neckController.text = neck.toString();
}); });
}, },
), ),
@ -539,6 +542,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (neck > 5) neck--; if (neck > 5) neck--;
neckController.text = neck.toString();
}); });
}, },
), ),
@ -558,6 +562,7 @@ class _BodyFatState extends State<BodyFat> {
onChanged: (double newValue) { onChanged: (double newValue) {
setState(() { setState(() {
neck = newValue.round(); neck = newValue.round();
neckController.text = neck.toString();
}); });
}, },
activeColor: Color(0xffC5272D), activeColor: Color(0xffC5272D),
@ -673,11 +678,6 @@ class _BodyFatState extends State<BodyFat> {
child: TextFormField( child: TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: waistController, controller: waistController,
decoration: InputDecoration(
labelText: waist.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
), ),
), ),
), ),
@ -704,6 +704,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (waist < 200) waist++; if (waist < 200) waist++;
waistController.text = waist.toString();
}); });
}, },
), ),
@ -716,6 +717,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (waist > 5) waist--; if (waist > 5) waist--;
waistController.text = waist.toString();
}); });
}, },
), ),
@ -735,6 +737,7 @@ class _BodyFatState extends State<BodyFat> {
onChanged: (double newValue) { onChanged: (double newValue) {
setState(() { setState(() {
waist = newValue.round(); waist = newValue.round();
waistController.text = waist.toString();
}); });
}, },
activeColor: Color(0xffC5272D), activeColor: Color(0xffC5272D),
@ -850,11 +853,6 @@ class _BodyFatState extends State<BodyFat> {
child: TextFormField( child: TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: hipController, controller: hipController,
decoration: InputDecoration(
labelText: hip.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
), ),
), ),
), ),
@ -881,6 +879,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (hip < 140) hip++; if (hip < 140) hip++;
hipController.text = hip.toString();
}); });
}, },
), ),
@ -893,6 +892,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
if (hip > 5) hip--; if (hip > 5) hip--;
hipController.text = hip.toString();
}); });
}, },
), ),
@ -912,6 +912,7 @@ class _BodyFatState extends State<BodyFat> {
onChanged: (double newValue) { onChanged: (double newValue) {
setState(() { setState(() {
hip = newValue.round(); hip = newValue.round();
hipController.text = hip.toString();
}); });
}, },
activeColor: Color(0xffC5272D), activeColor: Color(0xffC5272D),

@ -19,6 +19,7 @@ class OvulationPeriod extends StatefulWidget {
class _OvulationPeriodState extends State<OvulationPeriod> { class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
DateTime selectedDateTime = DateTime.now();
int cycleLength = 0; int cycleLength = 0;
int lutealPhaseLength = 0; int lutealPhaseLength = 0;
String selectedDate; String selectedDate;
@ -37,13 +38,30 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
} }
String getDate() { String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; return "${DateUtil.getMonth(selectedDateTime.month)} ${selectedDateTime.day}, ${selectedDateTime.year}";
} }
// void calculate() {} // void calculate() {}
// //
// void calculateFertility(DateTime selectedDate) {const diff = Date.} // void calculateFertility(DateTime selectedDate) {const diff = Date.}
calculateBabyInformation() {
setState(() {
bloodSugarDate = selectedDateTime;
dateFrom = selectedDateTime.add(Duration(days: 10));
updatedDt = DateFormat.yMMMEd().format(dateFrom);
dateTo = selectedDateTime.add(Duration(days: 20));
conceivedDate = selectedDateTime.add(Duration(days: 14));
deliveryDue = selectedDateTime.add(Duration(days: 280));
// babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK);
babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.WEEK);
babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.DAY);
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -78,18 +96,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
onConfirm: (date) { onConfirm: (date) {
print('confirm $date'); print('confirm $date');
setState(() { setState(() {
bloodSugarDate = date; selectedDateTime = date;
dateFrom = date.add(Duration(days: 10));
updatedDt = DateFormat.yMMMEd().format(dateFrom);
dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280));
// babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK);
babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([date.year, date.month, dateTo.day]), Units.WEEK);
babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([date.year, date.month, dateTo.day]), Units.DAY);
}); });
}, },
currentTime: DateTime.now(), currentTime: DateTime.now(),
@ -321,8 +328,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
child: SecondaryButton( child: SecondaryButton(
label: 'CALCULATE', label: 'CALCULATE',
onTap: () { onTap: () {
setState(() { calculateBabyInformation();
{
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -335,8 +341,6 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
babyAgeDays: babyAgeDays, babyAgeDays: babyAgeDays,
)), )),
); );
}
});
}, },
), ),
), ),

@ -78,7 +78,7 @@ class OvulationResult extends StatelessWidget {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
Texts( Texts(
babyAge.toString() + " Weeks," + "2", babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks," + "3",
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 21.0, fontSize: 21.0,
), ),

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.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';
@ -9,11 +10,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:provider/provider.dart';
import '../../d_q_icons_icons.dart'; import '../../d_q_icons_icons.dart';
class ParkingPage extends StatelessWidget { class ParkingPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<QrViewModel>( return BaseView<QrViewModel>(
onModelReady: (model) => model.getIsSaveParking(), onModelReady: (model) => model.getIsSaveParking(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -21,10 +24,7 @@ class ParkingPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).parking, appBarTitle: TranslationBase.of(context).parking,
description: TranslationBase.of(context).parkingDescription, description: TranslationBase.of(context).parkingDescription,
imagesInfo: [ imagesInfo: [
ImagesInfo( ImagesInfo(imageAr: 'assets/images/bc_parking.png', imageEn: 'assets/images/bc_parking.png', isAsset: true)
imageAr: 'assets/images/bc_parking.png',
imageEn: 'assets/images/bc_parking.png',
isAsset: true)
], ],
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -50,7 +50,9 @@ class ParkingPage extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container(child: Icon(/*Icons.landscape*/DQIcons.parking_icon,size: 130),), child: Container(
child: Icon(/*Icons.landscape*/ DQIcons.parking_icon, size: 130),
),
), ),
SizedBox( SizedBox(
width: 15, width: 15,
@ -85,15 +87,15 @@ class ParkingPage extends StatelessWidget {
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
color: Colors.white,
shape: BoxShape.rectangle),
height: 70, height: 70,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).showMyPark), Texts(TranslationBase.of(context).showMyPark),
Texts(model.qrParkingModel.floorDescriptionN), Texts(projectViewModel.isArabic
? model.qrParkingModel.floorDescriptionN
: model.qrParkingModel.floorDescription),
], ],
), ),
), ),
@ -102,9 +104,7 @@ class ParkingPage extends StatelessWidget {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
color: Colors.white,
shape: BoxShape.rectangle),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
height: 70, height: 70,
@ -112,7 +112,9 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).gate), Texts(TranslationBase.of(context).gate),
Texts(model.qrParkingModel.gateDescriptionN), Texts(projectViewModel.isArabic
? model.qrParkingModel.gateDescriptionN
: model.qrParkingModel.gateDescription),
], ],
), ),
), ),
@ -121,9 +123,7 @@ class ParkingPage extends StatelessWidget {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
color: Colors.white,
shape: BoxShape.rectangle),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
height: 70, height: 70,
@ -131,7 +131,9 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).building), Texts(TranslationBase.of(context).building),
Texts(model.qrParkingModel.buildingDescriptionN), Texts(projectViewModel.isArabic
? model.qrParkingModel.buildingDescriptionN
: model.qrParkingModel.buildingDescription),
], ],
), ),
), ),
@ -141,16 +143,16 @@ class ParkingPage extends StatelessWidget {
Container( Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
color: Colors.white,
shape: BoxShape.rectangle),
width: double.infinity, width: double.infinity,
height: 70, height: 70,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).branch), Texts(TranslationBase.of(context).branch),
Texts(model.qrParkingModel.branchDescriptionN), Texts(projectViewModel.isArabic
? model.qrParkingModel.branchDescriptionN
: model.qrParkingModel.branchDescription),
], ],
), ),
), ),

Loading…
Cancel
Save