diff options
author | Lisandro Pérez Meyer <lpmeyer@ics.com> | 2023-11-28 13:40:59 -0300 |
---|---|---|
committer | Lisandro Perez Meyer <lpmeyer@ics.com> | 2023-11-28 17:17:09 +0000 |
commit | b9377beb28bb372f8fc29dfe3eeb9145462b716f (patch) | |
tree | dc8ee6133102bd5f789c0a550d7c26345142d1b5 /lib/presentation/screens/dashboard | |
parent | 8558b640173de8fbfe37111b29e4fc68dbc80da1 (diff) |
Update HVAC fan.
This also removes commented out code.
Original by Sabin Sajeevan <ssajeevan@ics.com>.
Bug-AGL: SPEC-4971
Change-Id: I31c3b3046f6e3bdd9cc641d403467eda11144f31
Signed-off-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Diffstat (limited to 'lib/presentation/screens/dashboard')
-rw-r--r-- | lib/presentation/screens/dashboard/widgets/temperature.dart | 104 |
1 files changed, 53 insertions, 51 deletions
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>[ - TextSpan( - text: tempUnit == TemperatureUnit.celsius ? '°C' : '°F', - style: unitTextStyle, - ), - ], + RichText( + text: TextSpan( + text: temperatureDisplay, + style: tempTextStyle, + children: <TextSpan>[ + TextSpan( + text: tempUnit == TemperatureUnit.celsius ? '°C' : '°F', + style: unitTextStyle, + ), + ], + ), ), - ), - ], - ), - ], - ), + ], + ), + ], + ), ); } -}
\ No newline at end of file +} |