my vaccine & lab result fix

merge-requests/405/head
haroon amjad 5 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/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart';
@ -42,7 +43,7 @@ class _MyVaccinesState extends State<MyVaccines> {
children: <Widget>[ children: <Widget>[
AppExpandableNotifier( AppExpandableNotifier(
isExpand: true, isExpand: true,
title: "2013", title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate).year.toString() : "",
bodyWidget: Container( bodyWidget: Container(
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.vertical, 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), getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
getTitles: (value) { getTitles: (value) {
return '${value.toInt()}'; return '${value}';
}, },
margin: 8, margin: 8,
interval: getInterval(),
//reservedSize: 30, //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 getMaxY() {
double max = 0; double max = 0;
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
@ -152,8 +161,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
print(e); print(e);
} }
}); });
print("MinX: " + max.roundToDouble().toString()); // print("MaxY: " + max.toString());
return max.roundToDouble(); return max;
} }
double getMinY() { double getMinY() {
@ -168,9 +177,9 @@ class LineChartCurvedState extends State<LineChartCurved> {
} catch (e) { } catch (e) {
print(e); print(e);
} }
int value = min.toInt(); // int value = min.toInt();
print("MinY: " + value.toDouble().toString()); // print("MinY: " + min.toString());
return value.toDouble(); return min;
} }
List<LineChartBarData> getData() { List<LineChartBarData> getData() {

Loading…
Cancel
Save