Skip to content

Commit

Permalink
upload wear changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Dec 21, 2024
1 parent 5386771 commit 3ad8859
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions android/wear/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions lib/Frontend/WatchUI/main_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
],
),
);
}
}
20 changes: 19 additions & 1 deletion lib/Frontend/go_router_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -82,6 +87,19 @@ class TriggersEditRoute extends GoRouteData {
Page<void> buildPage(BuildContext context, GoRouterState state) => ModalPage(key: state.pageKey, name: state.name, child: TriggerEdit(uuid: uuid));
}

@TypedGoRoute<WatchHomeRoute>(
path: '/watch',
name: 'Watch',
)
class WatchHomeRoute extends GoRouteData {
const WatchHomeRoute();

static final GlobalKey<NavigatorState> $navigatorKey = rootNavigatorKey;

@override
Widget build(BuildContext context, GoRouterState state) => const MainMenu();
}

@TypedGoRoute<ManageGearRoute>(
path: '/manageGear',
name: 'Manage Gear',
Expand Down

0 comments on commit 3ad8859

Please sign in to comment.