wear_engine_api.dart
2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import 'package:pigeon/pigeon.dart';
class WearDeviceInfo {
WearDeviceInfo({
this.deviceId,
this.deviceName,
this.isPaired,
this.isReachable,
this.isWatchAppInstalled,
});
String? deviceId;
String? deviceName;
bool? isPaired;
bool? isReachable;
bool? isWatchAppInstalled;
}
class WatchTransformTheme {
WatchTransformTheme({
required this.themeId,
required this.themeName,
required this.energeticDescription,
this.energeticImage,
required this.normalDescription,
this.normalImage,
required this.slightStressfulDescription,
this.slightStressfulImage,
required this.stressfulDescription,
this.stressfulImage,
this.energeticImageUrl,
this.normalImageUrl,
this.slightStressfulImageUrl,
this.stressfulImageUrl,
});
int themeId;
final String themeName;
final String energeticDescription;
final Uint8List? energeticImage;
final String? energeticImageUrl;
final String normalDescription;
final Uint8List? normalImage;
final String? normalImageUrl;
final String slightStressfulDescription;
final Uint8List? slightStressfulImage;
final String? slightStressfulImageUrl;
final String stressfulDescription;
final Uint8List? stressfulImage;
final String? stressfulImageUrl;
}
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/pigeon/wear_engine_api.g.dart',
dartPackageName: 'doublefeel_flutter',
dartOptions: DartOptions(),
kotlinOut:
'android/app/src/main/kotlin/com/doublefeel/app/pigeon/WearEngineApi.kt',
kotlinOptions: KotlinOptions(
package: 'com.doublefeel.app.pigeon.wear',
),
swiftOut: 'ios/Runner/Pigeon/WearEngineApi.swift',
swiftOptions: SwiftOptions(),
// arkTSOut: 'ohos/entry/src/main/ets/pigeon/WearEngineApi.ets',
copyrightHeader: 'pigeon/copyright.txt',
),
)
@HostApi()
abstract class WearEngineHostApi {
bool hasAvailableDevices();
@async
WearDeviceInfo? checkConnectedDevice();
bool registerMessageReceiver();
bool sendTextMessage(String message);
/// 添加表盘
@async
bool addWatchSurface();
/// 添加或者删除主题
@async
bool syncWatchTheme(WatchTransformTheme? theme);
/// Opens the system photo picker and returns a local PNG file path after
/// removing the image background on the host platform.
@async
String? removeBackground(String originImagePath);
/// 是否有已安装的表盘
@async
bool hasInstalledWatchSurface();
}