refactor(settings): typed Pref<T> declarations

This commit is contained in:
edde746
2026-04-25 10:52:34 +02:00
parent e4e8299981
commit 0531c33b0c
42 changed files with 1102 additions and 1971 deletions
@@ -210,7 +210,7 @@ class WatchTogetherProvider with ChangeNotifier {
appLogger.d('WatchTogether: Creating session with control mode: $controlMode');
final customRelayUrl = SettingsService.instanceOrNull?.getCustomRelayUrl();
final customRelayUrl = SettingsService.instanceOrNull?.read(SettingsService.customRelayUrl);
_peerService = WatchTogetherPeerService(customBaseUrl: customRelayUrl);
_setupPeerServiceListeners();
@@ -258,7 +258,7 @@ class WatchTogetherProvider with ChangeNotifier {
appLogger.d('WatchTogether: Joining session: $sessionId');
final customRelayUrl = SettingsService.instanceOrNull?.getCustomRelayUrl();
final customRelayUrl = SettingsService.instanceOrNull?.read(SettingsService.customRelayUrl);
_peerService = WatchTogetherPeerService(customBaseUrl: customRelayUrl);
_setupPeerServiceListeners();
@@ -312,7 +312,7 @@ class WatchTogetherProvider with ChangeNotifier {
// Probe the relay with a lightweight peer service to check room occupancy,
// then do a single createSession or joinSession. This avoids the crash-prone
// join→teardown→create cycle on the provider.
final customRelayUrl = SettingsService.instanceOrNull?.getCustomRelayUrl();
final customRelayUrl = SettingsService.instanceOrNull?.read(SettingsService.customRelayUrl);
final probe = WatchTogetherPeerService(customBaseUrl: customRelayUrl);
bool shouldBeHost;
try {