init method

Future<FluentAliyunOss> init (
  1. {@required AliyunOssClientConfig config}
)

初始化阿里云OSS配置

Implementation

static Future<FluentAliyunOss> init(
    {@required AliyunOssClientConfig config}) async {
  Map<String, Object> obj = config.toMap();
  obj['clientKey'] = _clientKey;
  await _channel.invokeMethod("init", obj);
  FluentAliyunOss aliyunOssClient = new FluentAliyunOss();

  _streamController.stream.listen((event) {
    final handler = _handlers[event.taskId];
    if (handler != null) {
      handler.dispatch(event);
      if (event.isFinished) _handlers.remove(event.taskId);
    }
  });
  return aliyunOssClient;
}