From 10945b8056eb2b228c156918a3505882a49a79b8 Mon Sep 17 00:00:00 2001 From: Hritik Chouhan Date: Thu, 1 Sep 2022 20:46:09 +0200 Subject: Upload Flutter-Dashboard app for IVI Flutter Dashboard app which shows Tyres Pressure, Child lock status , Current Location,Speed,RPM,outside and inside Temperature , Average fuel Consumption. update UI and Removed Unused code. Moved kuksa authtoken and mapbox access token and other things to config file. Bug-AGL: SPEC-4547 Signed-off-by: Hritik Chouhan Change-Id: I14f42ed453c8279a1e89f8835d2b24e07e4ce376 --- lib/Tier_pressure.dart | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/Tier_pressure.dart (limited to 'lib/Tier_pressure.dart') diff --git a/lib/Tier_pressure.dart b/lib/Tier_pressure.dart new file mode 100644 index 0000000..cb8ace5 --- /dev/null +++ b/lib/Tier_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 TierPressure extends StatefulWidget { + String tname; + double tpress; + CrossAxisAlignment crossAxisAlignment; + MainAxisAlignment mainAxisAlignment; + TierPressure( + {Key? key, + required this.tname, + required this.tpress, + required this.crossAxisAlignment, + required this.mainAxisAlignment}) + : super(key: key); + + @override + State createState() => _TierPressureState(); +} + +class _TierPressureState 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