stop method
Stops what was started.
Provide forceReason if force is true. There is not assertion for this.
Override it or use start future.
The future returned from start will throw if force is true.
The exception will be StopForcedException.
Implementation
@mustCallSuper
void stop({
bool force = false,
String? forceReason,
}) {
assert(_starterCompleter != null, 'Not started to be stopped');
if (force) {
_starterCompleter!._base.completeError(
StopForcedException._(describeIdentity(this), forceReason),
);
} else {
_starterCompleter!._base.complete();
}
_starterCompleter = null;
}