ResStream<S, F>.fail constructor
ResStream<S, F>.fail (
- F value, [
- Object? exception,
- StackTrace? stack
Creates a result stream that emits one failure with the given value and an optional exception and stack trace, then closes. For stubbing in tests:
when(() => weatherApi.watchTemperature(any()))
.thenReturn(ResultStream.fail(WeatherError.offline));
Implementation
ResStream.fail(F value, [Object? exception, StackTrace? stack])
: this._(t.ResultStream.fail(value, exception, stack));