From 61da09ade5afc3ab340d514d581fa48a1208dcf1 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 29 Dec 2022 01:39:03 -0500 Subject: Layout simplifications and tweaks Changes: - Remove OrientationBuilder usage and landscape widget layout, as it complicates further rework due to not being as easily tested, and will be an ongoing maintenance hassle until landscape mode is actually required. - Simplify layout by removing the arrows for tire pressure, and replacing the heavy Positioned usage with Row/Columns with some alignment directives. - Swap the fuel and speed gauges to have the speed on the left, as that matches the typical cluster postion. - Correct the aspect ratio of hero car image and increase its size to better fill available area. - Tweaked label alignment and positioning on the temperature widgets to better make use of the available space. - Corrected labels to 'km/h' in a couple of places. Bug-AGL: SPEC-4660 Signed-off-by: Scott Murray Change-Id: I45a15e2c4c9aa835745c754952979cda8baa90fa --- lib/provider.dart | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'lib/provider.dart') diff --git a/lib/provider.dart b/lib/provider.dart index 4c9ed0a..463e743 100644 --- a/lib/provider.dart +++ b/lib/provider.dart @@ -5,37 +5,19 @@ import 'dart:math'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -final fuelProvider = StateNotifierProvider((ref) => - fuel(), +final fuelProvider = StateNotifierProvider( + (ref) => fuel(), ); -class fuel extends StateNotifier{ +class fuel extends StateNotifier { late Timer timer; - fuel() : super(0.2){ - + fuel() : super(0.2) { Timer.periodic(Duration(seconds: 5), (timer) { double num = Random().nextInt(100).toDouble(); update(num); }); } - void update(value){ - state = value; - } -} - -final DateTimeProvider = StateNotifierProvider((ref) => - datetime(), -); - -class datetime extends StateNotifier{ - datetime() : super(DateTime.now()){ - - Timer.periodic(Duration(seconds: 30), (timer) { - DateTime _now = DateTime.now(); - update(_now); - }); - } - void update(value){ + void update(value) { state = value; } } -- cgit