cancel method

  1. @override
Future<void> cancel()
override

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
  await frame!.sendMessage(TxCode(msgCode: 0x10, value: 0));

  // clear the display
  await frame!.sendMessage(TxPlainText(msgCode: 0x0a, text: ' '));

  setState(() {
    currentState = ApplicationState.ready;
  });
}