From b9377beb28bb372f8fc29dfe3eeb9145462b716f Mon Sep 17 00:00:00 2001 From: Lisandro Pérez Meyer Date: Tue, 28 Nov 2023 13:40:59 -0300 Subject: Update HVAC fan. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also removes commented out code. Original by Sabin Sajeevan . Bug-AGL: SPEC-4971 Change-Id: I31c3b3046f6e3bdd9cc641d403467eda11144f31 Signed-off-by: Lisandro Pérez Meyer --- .../screens/dashboard/widgets/temperature.dart | 104 +++++++++++---------- 1 file changed, 53 insertions(+), 51 deletions(-) (limited to 'lib/presentation/screens/dashboard') diff --git a/lib/presentation/screens/dashboard/widgets/temperature.dart b/lib/presentation/screens/dashboard/widgets/temperature.dart index 0817b53..1701c68 100644 --- a/lib/presentation/screens/dashboard/widgets/temperature.dart +++ b/lib/presentation/screens/dashboard/widgets/temperature.dart @@ -10,10 +10,10 @@ class TemperatureWidget extends ConsumerWidget { // .watch(vehicleProvider.select((vehicle) => vehicle.outsideTemperature)); final tempUnit = ref.watch(unitStateProvider.select((unit) => unit.temperatureUnit)); - + TextStyle temperatureTextStyle = const TextStyle( fontFamily: 'BrunoAce', - color: Colors.white, + color: Colors.white, fontSize: 44, ); @@ -39,7 +39,8 @@ class TemperatureWidget extends ConsumerWidget { ), //color: Colors.grey, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(65), // Half of the height for an oval effect + borderRadius: BorderRadius.circular( + 65), // Half of the height for an oval effect side: const BorderSide( color: Color.fromARGB(156, 0, 0, 0), width: 2, @@ -76,8 +77,8 @@ class TemperatureWidget extends ConsumerWidget { ), ); } - - Widget buildTemperatureRow( + + Widget buildTemperatureRow( BuildContext context, IconData icon, String label, @@ -86,58 +87,59 @@ class TemperatureWidget extends ConsumerWidget { TextStyle tempTextStyle, TextStyle unitTextStyle, bool isOutside, - ) { - int temperatureAsInt = temperatureValue.toInt(); - double convertedTemperature = tempUnit == TemperatureUnit.celsius - ? temperatureAsInt.toDouble() - : (temperatureAsInt * 9 / 5) + 32; + int temperatureAsInt = temperatureValue.toInt(); + double convertedTemperature = tempUnit == TemperatureUnit.celsius + ? temperatureAsInt.toDouble() + : (temperatureAsInt * 9 / 5) + 32; - // Format the temperature for display. - String temperatureDisplay = tempUnit == TemperatureUnit.celsius - ? '$temperatureAsInt' - : '${convertedTemperature.toStringAsFixed(0)}'; + // Format the temperature for display. + String temperatureDisplay = tempUnit == TemperatureUnit.celsius + ? '$temperatureAsInt' + : convertedTemperature.toStringAsFixed(0); return Padding( - padding: isOutside - ? const EdgeInsets.only(right: 22) // Padding for the outside temperature - : const EdgeInsets.only(left: 12), // Padding for the inside temperature + padding: isOutside + ? const EdgeInsets.only( + right: 22) // Padding for the outside temperature + : const EdgeInsets.only( + left: 12), // Padding for the inside temperature child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - icon, - color: const Color(0xFF2962FF), - size: 48, - ), - const SizedBox(width: 4), // Space between icon and text - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - label, - style: const TextStyle( - color: Color(0xFFC1D8FF), - fontSize: 26, + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + icon, + color: const Color(0xFF2962FF), + size: 48, + ), + const SizedBox(width: 4), // Space between icon and text + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + label, + style: const TextStyle( + color: Color(0xFFC1D8FF), + fontSize: 26, + ), ), - ), - RichText( - text: TextSpan( - text: temperatureDisplay, - style: tempTextStyle, - children: [ - TextSpan( - text: tempUnit == TemperatureUnit.celsius ? '°C' : '°F', - style: unitTextStyle, - ), - ], + RichText( + text: TextSpan( + text: temperatureDisplay, + style: tempTextStyle, + children: [ + TextSpan( + text: tempUnit == TemperatureUnit.celsius ? '°C' : '°F', + style: unitTextStyle, + ), + ], + ), ), - ), - ], - ), - ], - ), + ], + ), + ], + ), ); } -} \ No newline at end of file +} -- cgit 1.2.3-korg