shutdown method Null safety

FutureOr<void> shutdown()

Implementation

FutureOr<void> shutdown() async {
  switch (_status) {
    case IsoBridgeStatus.error:
      break;
    case IsoBridgeStatus.execwait:
      break;
    case IsoBridgeStatus.running:
      break;
    default:
      return null;
  }
  if (_isolate != null) {
    //clean up isolate part
    // _sendExec.send(ShutdownAction());
    //wait to finish cleanup
    _isolate?.kill(priority: Isolate.immediate);
    _isolate = null;
  }
  _status = IsoBridgeStatus.shutdown;
}