DChannel constructor

DChannel(
  1. MethodChannel methodChannel
)

Implementation

DChannel(MethodChannel methodChannel) {
  _methodChannel = methodChannel;
  _methodChannel.setMethodCallHandler((MethodCall call) {
    // sendActionToFlutter 处理Native发过来的指令
    if (DStackConstant.nodeToFlutter == call.method) {
      return DNavigatorManager.handleActionToFlutter(call.arguments)!;
    } else if (DStackConstant.lifeCycle == call.method) {
      return LifeCycleHandler.handleLifecycleMessage(call.arguments);
    } else if (DStackConstant.sendOperationNodeToFlutter == call.method) {
      return DNodeObserverHandler.handlerNodeMessage(call.arguments);
    }
    return Future.value();
  });
}