cancel method
cancel tap-listening state and clear the display
Implementation
@override
Future<void> cancel() async {
setState(() {
currentState = ApplicationState.canceling;
});
// perform app-specific cleanup
await onCancel();
// let Frame know to stop sending taps
final code = TxCode(msgCode: 0x10, value: 0);
await frame!.sendMessage(code.msgCode, code.pack());
// clear the display
final plainText = TxPlainText(msgCode: 0x0a, text: ' ');
await frame!.sendMessage(plainText.msgCode, plainText.pack());
setState(() {
currentState = ApplicationState.ready;
});
}