Skip to content

Commit

Permalink
fix: watchos settings (#403)
Browse files Browse the repository at this point in the history
Fixes #401
  • Loading branch information
lollipopkit authored Jun 22, 2024
1 parent c9a2c1d commit 1fd6872
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
6 changes: 0 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
PODS:
- countly_flutter (24.4.1):
- Flutter
- device_info_plus (0.0.1):
- Flutter
- file_picker (0.0.1):
Expand Down Expand Up @@ -36,7 +34,6 @@ PODS:
- Flutter

DEPENDENCIES:
- countly_flutter (from `.symlinks/plugins/countly_flutter/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
Expand All @@ -55,8 +52,6 @@ DEPENDENCIES:
- watch_connectivity (from `.symlinks/plugins/watch_connectivity/ios`)

EXTERNAL SOURCES:
countly_flutter:
:path: ".symlinks/plugins/countly_flutter/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
Expand Down Expand Up @@ -91,7 +86,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/watch_connectivity/ios"

SPEC CHECKSUMS:
countly_flutter: 56233d921c6b4e0a720774a39b8ee8110d6f8d91
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
file_picker: c79185e70b9b45728cde2a8d8da454e0cb43f287
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
Expand Down
19 changes: 8 additions & 11 deletions lib/view/page/setting/platform/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ class _IOSSettingsPageState extends State<IOSSettingsPage> {
Widget _buildWatchApp() {
return FutureWidget(
future: () async {
if (!await wc.isPaired) {
return null;
}
if (!await wc.isPaired) return null;
return await wc.applicationContext;
}(),
loading: UIs.centerLoading,
Expand Down Expand Up @@ -114,16 +112,15 @@ class _IOSSettingsPageState extends State<IOSSettingsPage> {
void _onTapWatchApp(Map<String, dynamic> map) async {
final urls = Map<String, String>.from(map['urls'] as Map? ?? {});
final result = await AppRoutes.kvEditor(data: urls).go(context);
if (result == null || result! is Map<String, String>) return;
if (result == null || result is! Map<String, String>) return;

try {
await wc.updateApplicationContext({'urls': result});
} catch (e, trace) {
context.showRoundDialog(
title: l10n.error,
child: Text('${l10n.save}:\n$e'),
);
Loggers.app.warning('Update watch config failed', e, trace);
await context.showLoadingDialog(fn: () async {
await wc.updateApplicationContext({'urls': result});
});
} catch (e, s) {
context.showErrDialog(e: e, s: s, operation: 'Watch Context');
Loggers.app.warning('Update watch config failed', e, s);
}
}
}
12 changes: 2 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1396,19 +1396,11 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "v1.0.84"
resolved-ref: "50405d87bea86aece143c235b8b17263d37de3ef"
ref: "v1.0.85"
resolved-ref: "13e42750a8f8dbf9a6c7890198b0dd18283a0692"
url: "https://github.com/lollipopkit/watch_connectivity"
source: git
version: "0.1.5"
watch_connectivity_platform_interface:
dependency: transitive
description:
name: watch_connectivity_platform_interface
sha256: "9074115391bd764c08a17346fcbc4d5c0b555672defbe6928ac648503b54aa9c"
url: "https://pub.dev"
source: hosted
version: "0.1.2"
watcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies:
watch_connectivity:
git:
url: https://github.com/lollipopkit/watch_connectivity
ref: v1.0.84
ref: v1.0.85
plain_notification_token:
git:
url: https://github.com/lollipopkit/plain_notification_token
Expand Down

0 comments on commit 1fd6872

Please sign in to comment.