|
|
|
|
@ -97,7 +97,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
Container(
|
|
|
|
|
width: 16,
|
|
|
|
|
height: 16,
|
|
|
|
|
decoration: containerRadius(Color(0xFF14384B), 100),
|
|
|
|
|
decoration: containerRadius(Color(0xFFD02127), 100),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5,
|
|
|
|
|
@ -144,8 +144,20 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
|
|
|
|
|
handleBuiltInTouches: true,
|
|
|
|
|
),
|
|
|
|
|
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
|
|
|
|
|
gridData: FlGridData(show: true, drawVerticalLine: false, drawHorizontalLine: true, verticalInterval: 14),
|
|
|
|
|
titlesData: FlTitlesData(
|
|
|
|
|
rightTitles: const AxisTitles(
|
|
|
|
|
sideTitles: SideTitles(
|
|
|
|
|
reservedSize: 0,
|
|
|
|
|
showTitles: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
topTitles: const AxisTitles(
|
|
|
|
|
sideTitles: SideTitles(
|
|
|
|
|
reservedSize: 0,
|
|
|
|
|
showTitles: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomTitles: AxisTitles(
|
|
|
|
|
sideTitles: SideTitles(
|
|
|
|
|
showTitles: true,
|
|
|
|
|
@ -154,38 +166,50 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
getTitlesWidget: (value, meta) {
|
|
|
|
|
if (timeSeries1!.length < 15) {
|
|
|
|
|
if (timeSeries1!.length > value.toInt()) {
|
|
|
|
|
return Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else
|
|
|
|
|
return Text("");
|
|
|
|
|
} else {
|
|
|
|
|
if (value.toInt() == 0)
|
|
|
|
|
return Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (value.toInt() == timeSeries1!.length - 1)
|
|
|
|
|
return Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
child:Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (xAxixs.contains(value.toInt())) {
|
|
|
|
|
return Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -197,14 +221,10 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
leftTitles: AxisTitles(
|
|
|
|
|
sideTitles: SideTitles(
|
|
|
|
|
showTitles: true,
|
|
|
|
|
interval: getMaxY() - getMinY() <= 500
|
|
|
|
|
? 50
|
|
|
|
|
: getMaxY() - getMinY() <= 1000
|
|
|
|
|
? 100
|
|
|
|
|
: 200,
|
|
|
|
|
reservedSize: 12,
|
|
|
|
|
reservedSize: getMaxY()>99? 40 : 30,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
borderData: FlBorderData(
|
|
|
|
|
show: true,
|
|
|
|
|
border: const Border(
|
|
|
|
|
@ -276,7 +296,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
spots: spots,
|
|
|
|
|
isCurved: true,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
barWidth: 1.5,
|
|
|
|
|
barWidth: 2,
|
|
|
|
|
isStrokeCapRound: true,
|
|
|
|
|
dotData: FlDotData(
|
|
|
|
|
show: false,
|
|
|
|
|
@ -289,7 +309,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
spots: spots2,
|
|
|
|
|
isCurved: true,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
barWidth: 1.5,
|
|
|
|
|
barWidth: 2,
|
|
|
|
|
isStrokeCapRound: true,
|
|
|
|
|
dotData: FlDotData(
|
|
|
|
|
show: false,
|
|
|
|
|
@ -308,7 +328,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget {
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1, //
|
|
|
|
|
color: background // <--- border width here
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(radius),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|