diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-12-07 22:10:39 +0900 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-12-13 03:54:05 +0000 |
commit | e6ecc5d46c7ebb11efbc674289c87e50f6d5dfbc (patch) | |
tree | e941e20c556af79cb944a28a32a4df5e27765bb6 /lib/Tire_pressure.dart | |
parent | 5db65d9bb45a1022c37556506ef0c15c3cc8c263 (diff) |
Update Tier -> Tire
Bug-AGL: SPEC-4642
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I8540eb55d83bf617a4c0d7fb9f97a16c72611603
(cherry picked from commit 1a5706e55524f8ba16d28ea9e9748e3ff0ac48c1)
Diffstat (limited to 'lib/Tire_pressure.dart')
-rw-r--r-- | lib/Tire_pressure.dart | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/Tire_pressure.dart b/lib/Tire_pressure.dart new file mode 100644 index 0000000..2f68bf3 --- /dev/null +++ b/lib/Tire_pressure.dart @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +import 'package:dashboard_app/size.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/linear_percent_indicator.dart'; + + + +class TirePressure extends StatefulWidget { + String tname; + double tpress; + CrossAxisAlignment crossAxisAlignment; + MainAxisAlignment mainAxisAlignment; + TirePressure( + {Key? key, + required this.tname, + required this.tpress, + required this.crossAxisAlignment, + required this.mainAxisAlignment}) + : super(key: key); + + @override + State<TirePressure> createState() => _TirePressureState(); +} + +class _TirePressureState extends State<TirePressure> { + @override + Widget build(BuildContext context) { + return SizedBox( + height: SizeConfig.safeBlockVertical * 12, + width: SizeConfig.safeBlockHorizontal * 14, + child: Column( + mainAxisAlignment: widget.mainAxisAlignment, + + children: [ + Text( + '${widget.tname}', + style: SizeConfig.smallnormalfont2, + ), + Text( + widget.tpress.toString() + ' PSI', + style: SizeConfig.smallnormalfont, + ), + LinearPercentIndicator( + width: SizeConfig.safeBlockHorizontal * 11, + + progressColor: widget.tpress / 50 > 0.6 ? Colors.green : Colors.red, + lineHeight: SizeConfig.safeBlockVertical * 1.5, + alignment: MainAxisAlignment.center, + animateFromLastPercent: true, + animation: true, + percent: widget.tpress / 50, + + barRadius: Radius.circular(SizeConfig.fontsize / 4), + backgroundColor: Colors.grey, + ), + ], + ), + ); + } +} |