addMark method

Future addMark(
  1. String deviceId,
  2. MarkType markType,
  3. String markName, {
  4. String? userId,
  5. dynamic sendSuccess()?,
  6. dynamic progress(
    1. Map map
    )?,
})

通过蓝牙添加指纹

Implementation

Future addMark(
  String deviceId,
  MarkType markType,
  String markName, {
  String? userId,
  Function()? sendSuccess,
  Function(Map map)? progress,
}) {
  methodChannel.setMethodCallHandler((call) {
    switch (call.method) {
      case "progress":
        if (progress != null) {
          progress(convert.json.decode(call.arguments));
        }
        break;
      case "sendSuccess":
        if (sendSuccess != null) {
          sendSuccess();
        }
        break;
    }
    return Future.value("SUCCESS");
  });
  try {
    return methodChannel.invokeMethod("addMark", {
      "deviceId": deviceId,
      "markType": markType.name,
      "markName": markName,
      "userId": userId
    });
  } catch (e) {
    methodChannel.setMethodCallHandler(null);
    rethrow;
  }
}