cancel method

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

the SimpleFrameApp subclass implements application-specific code

Implementation

@override
Future<void> cancel() async {
  _log.info("stop listening");

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

  bool stopped = (await NotificationsListener.stopService())!;
  _log.info("service stopped: $stopped");

  setState(() {
    _prevText = '';
    _prevIcon = Uint8List(0);
    _lastEvent = null;
    currentState = ApplicationState.ready;
  });
}