FlutterMobileIMSDKMethod.fromMethodCall constructor

FlutterMobileIMSDKMethod.fromMethodCall(
  1. MethodCall call
)

Implementation

factory FlutterMobileIMSDKMethod.fromMethodCall(MethodCall call) {
  MobileIMSDKMethodType type = MobileIMSDKMethodTypeExtension.fromMethodCallName(call.method);
  switch (type) {
    case MobileIMSDKMethodType.autoReLoginDaemonObserver:
    case MobileIMSDKMethodType.keepAliveDaemonObserver:
    case MobileIMSDKMethodType.qoS4SendDaemonObserver:
    case MobileIMSDKMethodType.qoS4ReciveDaemonObserver:
      return MobileIMSDKDaemonOberber(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.loginSuccess:
      return MobileIMSDKLoginSuccess(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.loginFail:
      return MobileIMSDKLoginFail(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.linkClose:
      return MobileIMSDKLinkClose(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.onRecieveMessage:
      return MobileIMSDKRecieveMessage(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.onErrorResponse:
      return MobileIMSDKErrorResponse(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.qosMessagesLost:
      return MobileIMSDKMessagesLost(type: type, argument: call.arguments);
    case MobileIMSDKMethodType.qosMessagesBeReceived:
      return MobileIMSDKMessagesBeReceived(type: type, argument: call.arguments);
  }
  return null;
}