start method

  1. @override
Future<bool> start({
  1. bool refresh = false,
  2. String? key,
})
override

Implementation

@override
Future<bool> start({bool refresh = false, String? key}) async {
  bool ok = true;

  if (!FmlEngine.isMobile) {
    System.toast("NFC is only available on mobile devices", duration: 4);
    return ok;
  }

  switch (method?.toLowerCase().trim()) {
    case "read":
      Reader().registerListener(this);
      statusmessage = "Approach an NFC tag to Read";
      break;

    case "write":
      statusmessage = "Approach an NFC tag to Write";
      return await _write(body);
  }

  return true;
}