initSDK static method

Future<void> initSDK(
  1. String appId,
  2. String url, {
  3. String channel = "",
  4. bool isDebug = false,
  5. DTLogLevel logLevel = DTLogLevel.DEBUG,
})

初始化入口

  • appId 应用id,后台分配
  • url 服务器地址,后台分配
  • channel 渠道,默认为空字符串,可用 ROIQueryChannel.GP,具体联系商务
  • isDebug 是否打开调试,调试模式下将打印log, 默认关闭
  • logLevel log 的级别,默认为 2 (Log.VERBOSE),仅在 isDebug = true 有效

Implementation

static Future<void> initSDK(String appId, String url,
    {String channel = "",
    bool isDebug = false,
    DTLogLevel logLevel = DTLogLevel.DEBUG}) {
  var typeSuffix = "";
  if (Platform.isIOS) {
    typeSuffix = "-iOS";
  } else if (Platform.isAndroid) {
    typeSuffix = "-Android";
  } else {
    // Unsupported platforms
    typeSuffix = "-${Platform.operatingSystem}";
  }

  return DTPigeon().initSDK(appId, url, channel, isDebug, logLevel, {
    "#sdk_type": "Flutter$typeSuffix",
    "#sdk_version_name": _versionName,
  });
}