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(value: 0);
await frame!.sendMessage(0x10, code.pack());
// clear the display
final plainText = TxPlainText(text: ' ');
await frame!.sendMessage(0x0a, plainText.pack());
setState(() {
currentState = ApplicationState.ready;
});
}