wear_engine_api.dart 1.17 KB
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);

  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.
  String? pickImageAndRemoveBackground();
}