Commit 6e36fac7ad421c20700c3e68b0599f23e05f23b6

Authored by 权海
1 parent 1f7931e2

feat(ui):主题变化回调

@@ -29,7 +29,7 @@ class FriendsController extends GetxController { @@ -29,7 +29,7 @@ class FriendsController extends GetxController {
29 _selfHealthRepository = selfHealthRepository ?? 29 _selfHealthRepository = selfHealthRepository ??
30 SelfHealthRepositoryImpl(Get.find<HealthApi>()), 30 SelfHealthRepositoryImpl(Get.find<HealthApi>()),
31 _updateWatchOtherUserInfo = updateWatchOtherUserInfo ?? 31 _updateWatchOtherUserInfo = updateWatchOtherUserInfo ??
32 - ((info) => WearEngineHostApi().sendWatchSyncPayload('')); 32 + ((info) => PlatformHostApi().refreshWatchAppAndWidgets());
33 33
34 static const maxFriends = 10; 34 static const maxFriends = 10;
35 35
@@ -135,11 +135,7 @@ class CustomWatchThemePreviewController extends GetxController { @@ -135,11 +135,7 @@ class CustomWatchThemePreviewController extends GetxController {
135 if (selectedFriend == null) return; 135 if (selectedFriend == null) return;
136 136
137 await loadFriendTheme(); 137 await loadFriendTheme();
138 - try {  
139 - await WearEngineHostApi().sendWatchSyncPayload('');  
140 - } catch (_) {  
141 - // The selected friend is saved on the server; native refresh can retry.  
142 - } 138 + PlatformHostApi().refreshWatchAppAndWidgets();
143 } 139 }
144 140
145 Future<void> addWatchFace() async { 141 Future<void> addWatchFace() async {
@@ -105,11 +105,8 @@ class WatchThemePreviewController extends GetxController { @@ -105,11 +105,8 @@ class WatchThemePreviewController extends GetxController {
105 if (selectedFriend == null) return; 105 if (selectedFriend == null) return;
106 106
107 await loadFriendTheme(); 107 await loadFriendTheme();
108 - try {  
109 - await WearEngineHostApi().sendWatchSyncPayload('');  
110 - } catch (_) {  
111 - // The selected friend is saved on the server; native refresh can retry.  
112 - } 108 + // 同时刷新好友、好友数据和好友主题
  109 + PlatformHostApi().refreshWatchAppAndWidgets();
113 } 110 }
114 111
115 Future<void> addWatchFace() async { 112 Future<void> addWatchFace() async {