ProcessingCameraImagePlugin.ets 1.18 KB
import {
  FlutterPlugin,
  FlutterPluginBinding,
  MethodCall,
  MethodCallHandler,
  MethodChannel,
  MethodResult,
} from '@ohos/flutter_ohos';

import common from '@ohos.app.ability.common';

/** ProcessingCameraImagePlugin **/
export default class ProcessingCameraImagePlugin implements FlutterPlugin, MethodCallHandler {
  private channel: MethodChannel | null = null;
  private context: common.Context | null = null;

  constructor(context?: common.Context) {
    if (context) {
      this.context = context;
    }
  }

  getUniqueClassName(): string {
    return "ProcessingCameraImagePlugin"
  }

  onAttachedToEngine(binding: FlutterPluginBinding): void {
    this.channel = new MethodChannel(binding.getBinaryMessenger(), "processing_camera_image");
    this.channel.setMethodCallHandler(this)

    this.context = binding.getApplicationContext();
    // hilog.info(0x0000, 'start', 'MMKVPlugin onAttachedToEngine: %{public}s', this.context);
  }

  onDetachedFromEngine(binding: FlutterPluginBinding): void {
    if (this.channel != null) {
      this.channel.setMethodCallHandler(null)
    }
  }

  onMethodCall(call: MethodCall, result: MethodResult): void {
      result.notImplemented()
  }
}