flutter-nfc-manager
flutter-nfc-manager copied to clipboard
add setTimeout and getTimeout method to IsoDep
-
Added two methods to the IsoDep class.
- One is setTimeout and the second is getTimeout.
- It uses Android's IsoDep setTimeout and getTimeout respectively.
-
Changed the existing member variable
timeout
toinitialTimeout
.
Confirmation
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
result.value = tag.data;
var isoDep = IsoDep.from(tag);
if (isoDep != null) {
print("initialTimeout ${isoDep.initialTimeout}");
var time = await isoDep.setTimeout(time: 60000000);
print("setTimeout setTimeout $time}");
var getTime = await isoDep.getTimeout();
print("getTime $getTime}");
}
NfcManager.instance.stopSession();
});
@okadan Please review 🙇
@okadan I'm in a hurry so can you review it if you like 🙇🙇🙇
This would've helped me a lot too, hopefully the new API in v4.0.0 will mean this isn't required anymore.