Skip to content

Commit 2374909

Browse files
committed
move demo gear to dev mode since it shouldn't really be shown to users
1 parent b043375 commit 2374909

File tree

2 files changed

+32
-49
lines changed

2 files changed

+32
-49
lines changed

lib/Frontend/pages/developer/developer_menu.dart

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
99
import 'package:go_router/go_router.dart';
1010
import 'package:package_info_plus/package_info_plus.dart';
1111
import 'package:tail_app/Backend/Bluetooth/bluetooth_manager_plus.dart';
12+
import 'package:tail_app/Frontend/Widgets/uwu_text.dart';
13+
import 'package:tail_app/Frontend/translation_string_definitions.dart';
1214

1315
import '../../../Backend/firebase.dart';
1416
import '../../../Backend/logging_wrappers.dart';
@@ -29,9 +31,7 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
2931
@override
3032
Widget build(BuildContext context) {
3133
return Scaffold(
32-
appBar: AppBar(
33-
title: const Text('Developer Menu'),
34-
),
34+
appBar: AppBar(title: const Text('Developer Menu')),
3535
body: ListView(
3636
primary: true,
3737
children: [
@@ -59,19 +59,30 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
5959
throw Exception('Sentry Test');
6060
},
6161
),
62+
ListTile(
63+
title: Text(convertToUwU(scanDemoGear())),
64+
leading: const Icon(Icons.explore),
65+
subtitle: Text(convertToUwU(scanDemoGearTip())),
66+
trailing: Switch(
67+
value: HiveProxy.getOrDefault(settings, showDemoGear, defaultValue: showDemoGearDefault),
68+
onChanged: (bool value) async {
69+
setState(() {
70+
HiveProxy.put(settings, showDemoGear, value);
71+
});
72+
},
73+
),
74+
),
6275
ListTile(
6376
title: const Text(hasCompletedOnboarding),
6477
trailing: Switch(
6578
value: HiveProxy.getOrDefault(settings, hasCompletedOnboarding, defaultValue: hasCompletedOnboardingDefault) == hasCompletedOnboardingVersionToAgree,
6679
onChanged: (bool value) async {
67-
setState(
68-
() {
69-
HiveProxy.put(settings, hasCompletedOnboarding, value ? hasCompletedOnboardingVersionToAgree : hasCompletedOnboardingDefault);
70-
if (!value) {
71-
OnBoardingPageRoute().go(context);
72-
}
73-
},
74-
);
80+
setState(() {
81+
HiveProxy.put(settings, hasCompletedOnboarding, value ? hasCompletedOnboardingVersionToAgree : hasCompletedOnboardingDefault);
82+
if (!value) {
83+
OnBoardingPageRoute().go(context);
84+
}
85+
});
7586
},
7687
),
7788
),
@@ -110,22 +121,15 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
110121
trailing: Switch(
111122
value: HiveProxy.getOrDefault(settings, showDebugging, defaultValue: showDebuggingDefault),
112123
onChanged: (bool value) async {
113-
setState(
114-
() {
115-
HiveProxy.put(settings, showDebugging, value);
116-
context.pop();
117-
},
118-
);
124+
setState(() {
125+
HiveProxy.put(settings, showDebugging, value);
126+
context.pop();
127+
});
119128
},
120129
),
121130
),
122-
const ListTile(
123-
title: Divider(),
124-
),
125-
ListTile(
126-
title: const Text("ScanState"),
127-
subtitle: Text(ref.read(scanProvider).toString()),
128-
),
131+
const ListTile(title: Divider()),
132+
ListTile(title: const Text("ScanState"), subtitle: Text(ref.read(scanProvider).toString())),
129133
ListTile(
130134
title: const Text("AdapterState"),
131135
subtitle: StreamBuilder(
@@ -158,9 +162,7 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
158162
},
159163
),
160164
),
161-
const ListTile(
162-
title: Divider(),
163-
),
165+
const ListTile(title: Divider()),
164166
ListTile(
165167
title: const Text("SentryEnvironment"),
166168
subtitle: FutureBuilder(
@@ -235,13 +237,8 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
235237
Clipboard.setData(ClipboardData(text: await getFirebaseToken() ?? ""));
236238
},
237239
),
238-
ListTile(
239-
title: const Text("PlatformLocale"),
240-
subtitle: Text(Platform.localeName),
241-
),
242-
const ListTile(
243-
title: Divider(),
244-
),
240+
ListTile(title: const Text("PlatformLocale"), subtitle: Text(Platform.localeName)),
241+
const ListTile(title: Divider()),
245242
ListTile(
246243
title: const Text("WatchIsReachable"),
247244
subtitle: FutureBuilder(

lib/Frontend/pages/settings.dart

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,7 @@ class _SettingsState extends ConsumerState<Settings> {
190190
},
191191
),
192192
),
193-
ListTile(
194-
title: Text(convertToUwU(scanDemoGear())),
195-
leading: const Icon(Icons.explore),
196-
subtitle: Text(convertToUwU(scanDemoGearTip())),
197-
trailing: Switch(
198-
value: HiveProxy.getOrDefault(settings, showDemoGear, defaultValue: showDemoGearDefault),
199-
onChanged: (bool value) async {
200-
setState(
201-
() {
202-
HiveProxy.put(settings, showDemoGear, value);
203-
},
204-
);
205-
},
206-
),
207-
),
193+
208194
ListTile(
209195
title: Text(convertToUwU(settingsUwUToggleTitle())),
210196
leading: const Icon(Icons.explore),

0 commit comments

Comments
 (0)