summaryrefslogtreecommitdiffstats
path: root/lib/HomePage.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/HomePage.dart')
-rw-r--r--lib/HomePage.dart20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/HomePage.dart b/lib/HomePage.dart
index accf7c1..36d8381 100644
--- a/lib/HomePage.dart
+++ b/lib/HomePage.dart
@@ -6,7 +6,9 @@ import 'package:dashboard_app/widgets/fuel_and_speed.dart';
import 'package:dashboard_app/widgets/weather.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'vehicle-signals/vss_providers.dart';
+import 'package:dashboard_app/vehicle-signals/vss_client.dart';
+import 'package:dashboard_app/vehicle-signals/vss_provider.dart';
+import 'package:dashboard_app/vehicle-signals/vss_signal_providers.dart';
class FuelRateText extends ConsumerWidget {
final TextStyle style;
@@ -24,10 +26,24 @@ class FuelRateText extends ConsumerWidget {
}
}
-class HomePage extends StatelessWidget {
+class HomePage extends ConsumerStatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
+ _HomePageState createState() => _HomePageState();
+}
+
+class _HomePageState extends ConsumerState<HomePage> {
+ late VssClient vss;
+
+ initState() {
+ vss = ref.read(vssClientProvider);
+ vss.run();
+
+ super.initState();
+ }
+
+ @override
Widget build(BuildContext context) {
SizeConfig().init(context);