Skip to content

Commit 7e4ccab

Browse files
committed
just enable demo gear when dev mode is on, no separate toggle
1 parent 2374909 commit 7e4ccab

File tree

5 files changed

+85
-90
lines changed

5 files changed

+85
-90
lines changed

lib/Backend/Definitions/Device/device_definition.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,13 @@ String getNameFromBTName(String bluetoothDeviceName) {
431431
case 'mitail':
432432
return 'MiTail';
433433
case 'minitail':
434-
return 'MiTail Mini';
434+
return 'Mini';
435435
case 'flutter':
436436
return 'FlutterWings';
437437
case '(!)Tail1':
438438
return 'DigiTail';
439439
case 'clawgear':
440-
return 'ClawGear';
440+
return 'Claws';
441441
}
442442
return bluetoothDeviceName;
443443
}

lib/Backend/device_registry.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ BuiltList<BaseStatefulDevice> getAvailableIdleGearForType(Ref ref, BuiltSet<Devi
9898
return watch.where((element) => deviceTypes.contains(element.baseDeviceDefinition.deviceType)).toBuiltList();
9999
}
100100

101-
@Riverpod()
101+
@Riverpod(keepAlive: true)
102102
BuiltList<BaseStatefulDevice> getAvailableGearForType(Ref ref, BuiltSet<DeviceType> deviceTypes) {
103103
final BuiltList<BaseStatefulDevice> watch = ref.watch(getAvailableGearProvider);
104104
return watch.where((element) => deviceTypes.contains(element.baseDeviceDefinition.deviceType)).toBuiltList();

lib/Frontend/Widgets/scan_for_new_device.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class _ScanForNewDevice extends ConsumerState<ScanForNewDevice> {
4747
children: [
4848
ListTile(title: Text(convertToUwU(scanDevicesTitle()), style: Theme.of(context).textTheme.titleLarge)),
4949
ScanGearList(),
50-
if (HiveProxy.getOrDefault(settings, showDemoGear, defaultValue: showDemoGearDefault)) ...[
50+
if (HiveProxy.getOrDefault(settings, showDebugging, defaultValue: showDemoGearDefault)) ...[
5151
ExpansionTile(
5252
title: Text(convertToUwU(scanDemoGear())),
5353
children: [

lib/Frontend/pages/developer/developer_menu.dart

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ 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';
1412

1513
import '../../../Backend/firebase.dart';
1614
import '../../../Backend/logging_wrappers.dart';
@@ -31,7 +29,9 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
3129
@override
3230
Widget build(BuildContext context) {
3331
return Scaffold(
34-
appBar: AppBar(title: const Text('Developer Menu')),
32+
appBar: AppBar(
33+
title: const Text('Developer Menu'),
34+
),
3535
body: ListView(
3636
primary: true,
3737
children: [
@@ -59,30 +59,19 @@ 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-
),
7562
ListTile(
7663
title: const Text(hasCompletedOnboarding),
7764
trailing: Switch(
7865
value: HiveProxy.getOrDefault(settings, hasCompletedOnboarding, defaultValue: hasCompletedOnboardingDefault) == hasCompletedOnboardingVersionToAgree,
7966
onChanged: (bool value) async {
80-
setState(() {
81-
HiveProxy.put(settings, hasCompletedOnboarding, value ? hasCompletedOnboardingVersionToAgree : hasCompletedOnboardingDefault);
82-
if (!value) {
83-
OnBoardingPageRoute().go(context);
84-
}
85-
});
67+
setState(
68+
() {
69+
HiveProxy.put(settings, hasCompletedOnboarding, value ? hasCompletedOnboardingVersionToAgree : hasCompletedOnboardingDefault);
70+
if (!value) {
71+
OnBoardingPageRoute().go(context);
72+
}
73+
},
74+
);
8675
},
8776
),
8877
),
@@ -121,15 +110,22 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
121110
trailing: Switch(
122111
value: HiveProxy.getOrDefault(settings, showDebugging, defaultValue: showDebuggingDefault),
123112
onChanged: (bool value) async {
124-
setState(() {
125-
HiveProxy.put(settings, showDebugging, value);
126-
context.pop();
127-
});
113+
setState(
114+
() {
115+
HiveProxy.put(settings, showDebugging, value);
116+
context.pop();
117+
},
118+
);
128119
},
129120
),
130121
),
131-
const ListTile(title: Divider()),
132-
ListTile(title: const Text("ScanState"), subtitle: Text(ref.read(scanProvider).toString())),
122+
const ListTile(
123+
title: Divider(),
124+
),
125+
ListTile(
126+
title: const Text("ScanState"),
127+
subtitle: Text(ref.read(scanProvider).toString()),
128+
),
133129
ListTile(
134130
title: const Text("AdapterState"),
135131
subtitle: StreamBuilder(
@@ -162,7 +158,9 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
162158
},
163159
),
164160
),
165-
const ListTile(title: Divider()),
161+
const ListTile(
162+
title: Divider(),
163+
),
166164
ListTile(
167165
title: const Text("SentryEnvironment"),
168166
subtitle: FutureBuilder(
@@ -237,8 +235,13 @@ class _DeveloperMenuState extends ConsumerState<DeveloperMenu> {
237235
Clipboard.setData(ClipboardData(text: await getFirebaseToken() ?? ""));
238236
},
239237
),
240-
ListTile(title: const Text("PlatformLocale"), subtitle: Text(Platform.localeName)),
241-
const ListTile(title: Divider()),
238+
ListTile(
239+
title: const Text("PlatformLocale"),
240+
subtitle: Text(Platform.localeName),
241+
),
242+
const ListTile(
243+
title: Divider(),
244+
),
242245
ListTile(
243246
title: const Text("WatchIsReachable"),
244247
subtitle: FutureBuilder(

lib/Frontend/pages/settings.dart

Lines changed: 47 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,41 +35,35 @@ class _SettingsState extends ConsumerState<Settings> {
3535
Widget build(BuildContext context) {
3636
ref.watch(initLocaleProvider);
3737
return Scaffold(
38-
appBar: AppBar(
39-
title: Text(convertToUwU(settingsPage())),
40-
),
38+
appBar: AppBar(title: Text(convertToUwU(settingsPage()))),
4139
body: ListView(
4240
controller: _controller,
4341
children: [
4442
LanguagePicker(),
4543
ListTile(
4644
leading: const Icon(Icons.color_lens),
47-
title: Text(
48-
convertToUwU(settingsAppColor()),
49-
),
45+
title: Text(convertToUwU(settingsAppColor())),
5046
trailing: Row(
5147
mainAxisSize: MainAxisSize.min,
5248
children: [
5349
if (HiveProxy.getOrDefault(settings, appColor, defaultValue: appColorDefault) != appColorDefault) ...[
5450
IconButton(
55-
onPressed: () {
56-
setState(() {
57-
HiveProxy.put(settings, appColor, appColorDefault);
58-
appColorValue = Color(appColorDefault);
59-
});
60-
},
61-
icon: Icon(Icons.clear)),
51+
onPressed: () {
52+
setState(() {
53+
HiveProxy.put(settings, appColor, appColorDefault);
54+
appColorValue = Color(appColorDefault);
55+
});
56+
},
57+
icon: Icon(Icons.clear),
58+
),
6259
],
63-
ColorIndicator(
64-
width: 44,
65-
height: 44,
66-
borderRadius: 22,
67-
color: appColorValue,
68-
)
60+
ColorIndicator(width: 44, height: 44, borderRadius: 22, color: appColorValue),
6961
],
7062
),
7163
onTap: () async {
72-
ColorPickerRoute(defaultColor: appColorValue.toARGB32()).push(context).then(
64+
ColorPickerRoute(defaultColor: appColorValue.toARGB32())
65+
.push(context)
66+
.then(
7367
(color) => setState(() {
7468
if (color != null) {
7569
HiveProxy.put(settings, appColor, color);
@@ -86,11 +80,9 @@ class _SettingsState extends ConsumerState<Settings> {
8680
trailing: Switch(
8781
value: HiveProxy.getOrDefault(settings, showAccurateBattery, defaultValue: showAccurateBatteryDefault),
8882
onChanged: (bool value) async {
89-
setState(
90-
() {
91-
HiveProxy.put(settings, showAccurateBattery, value);
92-
},
93-
);
83+
setState(() {
84+
HiveProxy.put(settings, showAccurateBattery, value);
85+
});
9486
},
9587
),
9688
),
@@ -101,11 +93,9 @@ class _SettingsState extends ConsumerState<Settings> {
10193
trailing: Switch(
10294
value: HiveProxy.getOrDefault(settings, largerActionCardSize, defaultValue: largerActionCardSizeDefault),
10395
onChanged: (bool value) async {
104-
setState(
105-
() {
106-
HiveProxy.put(settings, largerActionCardSize, value);
107-
},
108-
);
96+
setState(() {
97+
HiveProxy.put(settings, largerActionCardSize, value);
98+
});
10999
},
110100
),
111101
),
@@ -116,11 +106,9 @@ class _SettingsState extends ConsumerState<Settings> {
116106
trailing: Switch(
117107
value: HiveProxy.getOrDefault(settings, hideTutorialCards, defaultValue: hideTutorialCardsDefault),
118108
onChanged: (bool value) async {
119-
setState(
120-
() {
121-
HiveProxy.put(settings, hideTutorialCards, value);
122-
},
123-
);
109+
setState(() {
110+
HiveProxy.put(settings, hideTutorialCards, value);
111+
});
124112
},
125113
),
126114
),
@@ -131,17 +119,13 @@ class _SettingsState extends ConsumerState<Settings> {
131119
trailing: Switch(
132120
value: HiveProxy.getOrDefault(settings, tailBlogWifiOnly, defaultValue: tailBlogWifiOnlyDefault),
133121
onChanged: (bool value) async {
134-
setState(
135-
() {
136-
HiveProxy.put(settings, tailBlogWifiOnly, value);
137-
},
138-
);
122+
setState(() {
123+
HiveProxy.put(settings, tailBlogWifiOnly, value);
124+
});
139125
},
140126
),
141127
),
142-
const ListTile(
143-
title: Divider(),
144-
),
128+
const ListTile(title: Divider()),
145129
ListTile(
146130
title: Text(convertToUwU(settingsHapticsToggleTitle())),
147131
leading: const Icon(Icons.vibration),
@@ -181,35 +165,43 @@ class _SettingsState extends ConsumerState<Settings> {
181165
subtitle: Text(convertToUwU(settingsKitsuneToggleSubTitle())),
182166
trailing: Switch(
183167
value: HiveProxy.getOrDefault(settings, kitsuneModeToggle, defaultValue: kitsuneModeDefault),
168+
onChanged: (bool value) async {
169+
setState(() {
170+
HiveProxy.put(settings, kitsuneModeToggle, value);
171+
});
172+
},
173+
),
174+
),
175+
/* ListTile(
176+
title: Text(convertToUwU(scanDemoGear())),
177+
leading: const Icon(Icons.explore),
178+
subtitle: Text(convertToUwU(scanDemoGearTip())),
179+
trailing: Switch(
180+
value: HiveProxy.getOrDefault(settings, showDemoGear, defaultValue: showDemoGearDefault),
184181
onChanged: (bool value) async {
185182
setState(
186183
() {
187-
HiveProxy.put(settings, kitsuneModeToggle, value);
184+
HiveProxy.put(settings, showDemoGear, value);
188185
},
189186
);
190187
},
191188
),
192-
),
193-
189+
), */
194190
ListTile(
195191
title: Text(convertToUwU(settingsUwUToggleTitle())),
196192
leading: const Icon(Icons.explore),
197193
subtitle: Text(convertToUwU(settingsUwUToggleSubTitle())),
198194
trailing: Switch(
199195
value: HiveProxy.getOrDefault(settings, uwuTextEnabled, defaultValue: uwuTextEnabledDefault),
200196
onChanged: (bool value) async {
201-
setState(
202-
() {
203-
HiveProxy.put(settings, uwuTextEnabled, value);
204-
ref.invalidate(initLocaleProvider);
205-
},
206-
);
197+
setState(() {
198+
HiveProxy.put(settings, uwuTextEnabled, value);
199+
ref.invalidate(initLocaleProvider);
200+
});
207201
},
208202
),
209203
),
210-
const ListTile(
211-
title: Divider(),
212-
),
204+
const ListTile(title: Divider()),
213205
ListTile(
214206
title: Text(convertToUwU(settingsMarketingNotificationsToggleTitle())),
215207
leading: const Icon(Icons.notifications),

0 commit comments

Comments
 (0)