my vaccine & lab result fix

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 062ca5c11c
commit 7675a4496a

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart';
@ -42,7 +43,7 @@ class _MyVaccinesState extends State<MyVaccines> {
children: <Widget>[
AppExpandableNotifier(
isExpand: true,
title: "2013",
title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate).year.toString() : "",
bodyWidget: Container(
child: ListView.separated(
scrollDirection: Axis.vertical,

@ -110,9 +110,10 @@ class LineChartCurvedState extends State<LineChartCurved> {
getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
getTitles: (value) {
return '${value.toInt()}';
return '${value}';
},
margin: 8,
interval: getInterval(),
//reservedSize: 30,
),
),
@ -142,6 +143,14 @@ class LineChartCurvedState extends State<LineChartCurved> {
);
}
double getInterval() {
double interval = 0.0;
interval = (getMaxY() - getMinY()) < 1.0 ? 0.05 : 3.0;
// print("Interval: " + (getMaxY() - getMinY()).toString());
// print("Interval: " + interval.toString());
return interval;
}
double getMaxY() {
double max = 0;
widget.labResult.forEach((element) {
@ -152,8 +161,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
print(e);
}
});
print("MinX: " + max.roundToDouble().toString());
return max.roundToDouble();
// print("MaxY: " + max.toString());
return max;
}
double getMinY() {
@ -168,9 +177,9 @@ class LineChartCurvedState extends State<LineChartCurved> {
} catch (e) {
print(e);
}
int value = min.toInt();
print("MinY: " + value.toDouble().toString());
return value.toDouble();
// int value = min.toInt();
// print("MinY: " + min.toString());
return min;
}
List<LineChartBarData> getData() {

Loading…
Cancel
Save