diff --git a/android/wear/build.gradle.kts b/android/wear/build.gradle.kts index c5ef7bcb5..7ffeb59bd 100644 --- a/android/wear/build.gradle.kts +++ b/android/wear/build.gradle.kts @@ -15,11 +15,11 @@ if (keystorePropertiesFile.exists()) { android { - namespace = "com.codel1417.tail_App" + namespace = "com.codel1417.tailApp" compileSdk = 34 defaultConfig { - applicationId = "com.codel1417.tail_App" + applicationId = "com.codel1417.tailApp" minSdk = 30 targetSdk = 34 versionCode = 1 diff --git a/lib/Frontend/WatchUI/main_menu.dart b/lib/Frontend/WatchUI/main_menu.dart index 789ee702b..2db2f67dc 100644 --- a/lib/Frontend/WatchUI/main_menu.dart +++ b/lib/Frontend/WatchUI/main_menu.dart @@ -7,13 +7,15 @@ class MainMenu extends StatelessWidget { @override Widget build(BuildContext context) { - return ListView( - children: [ - FilledButton(onPressed: () {}, child: Text("Favorite Actions")), - FilledButton(onPressed: () {}, child: Text(homePage())), - FilledButton(onPressed: () {}, child: Text(triggersPage())), - FilledButton(onPressed: () {}, child: Text("Gear")), - ], + return SafeArea( + child: ListView( + children: [ + FilledButton(onPressed: () {}, child: Text("Favorite Actions")), + FilledButton(onPressed: () {}, child: Text(homePage())), + FilledButton(onPressed: () {}, child: Text(triggersPage())), + FilledButton(onPressed: () {}, child: Text("Gear")), + ], + ), ); } } diff --git a/lib/Frontend/go_router_config.dart b/lib/Frontend/go_router_config.dart index a8f7c55c2..e3fbf95d1 100644 --- a/lib/Frontend/go_router_config.dart +++ b/lib/Frontend/go_router_config.dart @@ -4,8 +4,10 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:logarte/logarte.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:tail_app/Frontend/WatchUI/main_menu.dart'; import 'package:tail_app/Frontend/pages/developer/bulk_ota.dart'; import 'package:tail_app/Frontend/pages/view_pdf.dart'; +import 'package:tail_app/main.dart'; import '../Backend/Definitions/Action/base_action.dart'; import '../Backend/Definitions/Device/device_definition.dart'; @@ -48,12 +50,15 @@ final GoRouter router = GoRouter( //CustomNavObserver(plausible), LogarteNavigatorObserver(logarte), ], - redirect: (context, state) { + redirect: (context, state) async { String name = state.uri.path; if (name.isNotEmpty) { unawaited(plausible.event(page: name.toString(), referrer: _previousPageName)); _previousPageName = name; } + if (await isWear()) { + return "/watch"; + } return null; }, routes: $appRoutes, @@ -82,6 +87,19 @@ class TriggersEditRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) => ModalPage(key: state.pageKey, name: state.name, child: TriggerEdit(uuid: uuid)); } +@TypedGoRoute( + path: '/watch', + name: 'Watch', +) +class WatchHomeRoute extends GoRouteData { + const WatchHomeRoute(); + + static final GlobalKey $navigatorKey = rootNavigatorKey; + + @override + Widget build(BuildContext context, GoRouterState state) => const MainMenu(); +} + @TypedGoRoute( path: '/manageGear', name: 'Manage Gear',