init method

Future<bool> init (
  1. String key,
  2. {String channel,
  3. bool reportCrash: true,
  4. bool encrypt: false,
  5. bool logEnable: false}
)

Implementation

static Future<bool> init(
  String key, {
  String channel,
  bool reportCrash = true,
  bool encrypt = false,
  bool logEnable = false,
}) {
  Map<String, dynamic> args = {"key": key, "channel": channel ?? ''};

  if (reportCrash != null) {
    args["reportCrash"] = reportCrash;
  }

  if (encrypt != null) {
    args["encrypt"] = encrypt;
  }

  if (logEnable != null) {
    args["logEnable"] = logEnable;
  }

  _channel.invokeMethod("init", args);
  return new Future.value(true);
}