From e6ecc5d46c7ebb11efbc674289c87e50f6d5dfbc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 7 Dec 2022 22:10:39 +0900 Subject: Update Tier -> Tire Bug-AGL: SPEC-4642 Signed-off-by: Scott Murray Change-Id: I8540eb55d83bf617a4c0d7fb9f97a16c72611603 (cherry picked from commit 1a5706e55524f8ba16d28ea9e9748e3ff0ac48c1) --- lib/Tire_pressure.dart | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/Tire_pressure.dart (limited to 'lib/Tire_pressure.dart') 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 createState() => _TirePressureState(); +} + +class _TirePressureState extends State { + @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, + ), + ], + ), + ); + } +} -- cgit 1.2.3-korg