diff options
Diffstat (limited to 'lib/homescreen.dart')
-rw-r--r-- | lib/homescreen.dart | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/homescreen.dart b/lib/homescreen.dart index 7501292..be9c7ca 100644 --- a/lib/homescreen.dart +++ b/lib/homescreen.dart @@ -1,24 +1,26 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_homescreen/config.dart'; import 'package:grpc/grpc.dart'; import 'package:flutter_homescreen/generated/applauncher.pbgrpc.dart'; import 'package:flutter_homescreen/page_apps.dart'; import 'package:flutter_homescreen/widget_clock.dart'; import 'package:flutter_homescreen/bottom_panel.dart'; +import 'package:flutter_homescreen/vehicle-signals/vss_client.dart'; +import 'package:flutter_homescreen/vehicle-signals/vss_provider.dart'; enum PageIndex { home, dashboard, hvac, media } -class Homescreen extends StatefulWidget { - Homescreen({Key? key, required this.client}) : super(key: key); - final HttpClient client; +class Homescreen extends ConsumerStatefulWidget { + Homescreen({Key? key}) : super(key: key); @override _HomescreenState createState() => _HomescreenState(); } -class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { +class _HomescreenState extends ConsumerState<Homescreen> with TickerProviderStateMixin { int _selectedIndex = 0; int _previousIndex = 0; @@ -26,6 +28,7 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { late AppLauncherClient stub; List<String> apps_stack = []; static const agl_shell_channel = MethodChannel('flutter/agl_shell'); + late VssClient vss; Future<List<AppInfo>> getAppList() async { var response = await stub.listApplications(ListRequest()); @@ -34,6 +37,7 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { debugPrint("$info"); } return response.apps; + return []; } addAppToStack(String id) { @@ -90,7 +94,7 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { } initState() { - debugPrint("_HomescreenState.initState!"); + //debugPrint("_HomescreenState.initState!"); channel = ClientChannel('localhost', port: 50052, options: ChannelOptions(credentials: ChannelCredentials.insecure())); @@ -99,6 +103,9 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { handleAppStatusEvents(); + vss = ref.read(vssClientProvider); + vss.run(); + super.initState(); } @@ -276,16 +283,11 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin { child: _childForIndex(_selectedIndex), ), ), - Stack(children: [ - BottomPanelWidget( - height: railSize, - color: NavigationBarTheme.of(context).backgroundColor), - Align( - alignment: Alignment.bottomLeft, - child: GetConfig(client: widget.client)) - ]), - ], - ), + BottomPanelWidget( + height: railSize, + color: NavigationBarTheme.of(context).backgroundColor + ) + ]) ); } } |