wear_engine_api.dart
1.32 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
import 'package:pigeon/pigeon.dart';
class WearDeviceInfo {
WearDeviceInfo({
this.deviceId,
this.deviceName,
this.isConnected,
});
String? deviceId;
String? deviceName;
bool? isConnected;
}
@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();
WearDeviceInfo? checkConnectedDevice();
bool registerMessageReceiver();
bool sendTextMessage(String message);
/// 添加表盘
@async
bool addWatchSurface();
@async
bool sendWatchSyncPayload(String jsonPayload);
/// 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();
}