stop method

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

Implementation

@override
Future<void> stop() async {
  _state = BoatState.stopping;
  try {
    await methodsChannel.invokeMethod<void>('stop');
    _state = BoatState.idle;
  } catch (e) {
    _state = BoatState.error;
    // Still cancel subs — native may be in an unknown state, but the
    // Dart-side streams should not keep delivering into a dead engine.
    await _cancelSubs();
    rethrow;
  }
  await _cancelSubs();
}