Merge branch 'insurance' into 'master'

women health

See merge request Cloud_Solution/diplomatic-quarter!65
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit b0fa7811e5

@ -207,7 +207,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -306,7 +306,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -481,7 +481,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -285,98 +285,101 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(heightCm.toString()),
child: Text(heightCm.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (heightCm < 250)
heightCm++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (heightCm < 250) if (heightCm > 0)
heightCm++; heightCm--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (heightCm > 0)
heightCm--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: heightCm.toDouble(),
value: heightCm.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { heightCm = newValue.round();
heightCm = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -458,96 +461,99 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(neck.toString()),
child: Text(neck.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (neck < 60) neck++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (neck < 60) neck++; if (neck > 5) neck--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (neck > 5) neck--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: neck.toDouble(),
value: neck.toDouble(), min: 5,
min: 5, max: 60,
max: 60, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { neck = newValue.round();
neck = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -629,96 +635,100 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(waist.toString()),
child: Text(waist.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (waist < 200)
waist++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (waist < 200) waist++; if (waist > 5) waist--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (waist > 5) waist--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: waist.toDouble(),
value: waist.toDouble(), min: 5,
min: 5, max: 200,
max: 200, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { waist = newValue.round();
waist = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -800,96 +810,99 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(hip.toString()),
child: Text(hip.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (hip < 140) hip++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (hip < 140) hip++; if (hip > 5) hip--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (hip > 5) hip--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: hip.toDouble(),
value: hip.toDouble(), min: 5,
min: 5, max: 140,
max: 140, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { hip = newValue.round();
hip = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],

@ -181,7 +181,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -280,7 +280,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -448,7 +448,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -97,7 +97,7 @@ class _CarbsState extends State<Carbs> {
Column( Column(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.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:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'delivery_due_result_page.dart';
class DeliveryDue extends StatefulWidget {
@override
_DeliveryDueState createState() => _DeliveryDueState();
}
class _DeliveryDueState extends State<DeliveryDue> {
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
var dateFrom = DateTime.now();
var dateTo = DateTime.now();
var conceivedDate = DateTime.now();
var deliveryDue = DateTime.now();
var firstTrimester = DateTime.now();
var secondTrimester = DateTime.now();
var thirdTrimester = DateTime.now();
var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd");
String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
}
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivery Due Date',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0),
child: SingleChildScrollView(
child: Container(
child: Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.',
),
Divider(
//height: 2,
thickness: 2,
),
Column(
children: [
Texts(
'What was the date of the first day of the last period?',
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate == date
? null
: bloodSugarDate = DateTime.now();
dateFrom = date.add(Duration(days: 10));
dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280));
firstTrimester = date.add(Duration(days: 85));
secondTrimester = date.add(Duration(days: 190));
thirdTrimester = date.add(Duration(days: 280));
});
},
currentTime: DateTime.now(),
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.date_range_rounded),
Texts('Date'),
],
),
Texts(getDate()),
],
),
),
),
],
),
SizedBox(
height: 280.0,
),
Container(
height: 100.0,
width: 350.0,
child: Button(
label: 'CALCULATE',
onTap: () {
setState(() {
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DeliveryDueResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
firstTrimester: firstTrimester,
secondTrimester: secondTrimester,
thirdTrimester: thirdTrimester,
)),
);
}
});
},
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,106 @@
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:flutter/material.dart';
import 'package:intl/intl.dart';
class DeliveryDueResult extends StatelessWidget {
var dateFrom;
var dateTo;
var conceivedDate;
var deliveryDue;
var firstTrimester;
var secondTrimester;
var thirdTrimester;
DeliveryDueResult(
{this.dateFrom,
this.dateTo,
this.conceivedDate,
this.deliveryDue,
this.firstTrimester,
this.secondTrimester,
this.thirdTrimester});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivery Due Date',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'The next ovulation period is estimated to be:',
fontWeight: FontWeight.w400,
),
Texts(
'From:',
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateFrom),
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)),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'First Trimester Ends (12 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(firstTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Second Trimester Ends (27 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(secondTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Third Trimester, Estimated Due Date (40 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(thirdTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
),
),
],
),
),
),
),
);
}
}

@ -29,7 +29,7 @@ class _IdealBodyState extends State<IdealBody> {
double overWeightBy; double overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue; String dropdownValue = 'Medium(fingers touch)';
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double maxIdealWeight;
@ -126,97 +126,100 @@ class _IdealBodyState extends State<IdealBody> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(height.toString()),
child: Text(height.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
), ),
), ),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (height < 250)
height++;
});
},
),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (height < 250) if (height > 0) height--;
height++;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 0) height--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: height.toDouble(),
value: height.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { height = newValue.round();
height = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -304,97 +307,100 @@ class _IdealBodyState extends State<IdealBody> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(weight.toString()),
child: Text(weight.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
), ),
), ),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (weight < 250)
weight++;
});
},
),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (weight < 250) if (weight > 0) weight--;
weight++;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: weight.toDouble(),
value: weight.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { weight = newValue.round();
weight = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],

@ -0,0 +1,350 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
class OvulationPeriod extends StatefulWidget {
@override
_OvulationPeriodState createState() => _OvulationPeriodState();
}
class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0;
String selectedDate;
var dateFrom = DateTime.now();
var dateTo = DateTime.now();
var conceivedDate = DateTime.now();
var deliveryDue = DateTime.now();
var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd");
String updatedDt;
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
}
String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
}
// void calculate() {}
//
// void calculateFertility(DateTime selectedDate) {const diff = Date.}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ovulation Period',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 700.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Calculates Ovulation Period'),
SizedBox(
height: 12.0,
),
Divider(
//height: 2,
thickness: 2,
),
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate = 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));
});
},
currentTime: DateTime.now(),
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Date'),
Texts(getDate()),
],
),
),
),
SizedBox(
height: 5.0,
),
Texts(
'Average Cycle Length (usually 28 days):',
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(cycleLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength < 45)
cycleLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength > 0)
cycleLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: cycleLength.toDouble(),
min: 0,
max: 45,
onChanged: (double newValue) {
setState(() {
cycleLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
],
),
Texts(
'Average Luteal Phase Length (usually 14 days):',
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child:
Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15)
lutealPhaseLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0)
lutealPhaseLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: lutealPhaseLength.toDouble(),
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
],
),
SizedBox(
height: 220.0,
),
Container(
height: 100.0,
width: 350.0,
child: Button(
label: 'CALCULATE',
onTap: () {
setState(() {
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
)),
);
}
});
},
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,96 @@
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:flutter/material.dart';
import 'package:intl/intl.dart';
class OvulationResult extends StatelessWidget {
var dateFrom;
var dateTo;
var conceivedDate;
var deliveryDue;
OvulationResult(
{this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
//var newFormat = DateFormat("yy-MM-dd");
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ovulation Period',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'The next ovulation period is estimated to be:',
fontWeight: FontWeight.w400,
),
Texts(
'From:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'To:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Useful Information:',
color: Color(0xffC5272D),
),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The baby\'s age right now:',
fontWeight: FontWeight.w400,
),
Texts(
'5 Weeks, 2',
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The delivery due date is estimated to be on the: ',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(deliveryDue),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
),
),
],
),
),
),
),
);
}
}

@ -2,6 +2,7 @@ import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/page
import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -9,6 +10,7 @@ import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'health_calculator/bmr_calculator/bmr_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart';
import 'health_calculator/delivery_due/delivery_due.dart';
import 'health_calculator/ideal_body/ideal_body.dart'; import 'health_calculator/ideal_body/ideal_body.dart';
class HealthCalculators extends StatefulWidget { class HealthCalculators extends StatefulWidget {
@ -233,10 +235,10 @@ class _HealthCalculatorsState extends State<HealthCalculators>
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// FadePage(page: BloodSugar()), FadePage(page: OvulationPeriod()),
// ); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: 'Ovulation', title: 'Ovulation',
@ -249,12 +251,12 @@ class _HealthCalculatorsState extends State<HealthCalculators>
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// FadePage( FadePage(
// page: BloodCholesterol(), page: DeliveryDue(),
// ), ),
// ); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: 'Delivery', title: 'Delivery',

Loading…
Cancel
Save