Task<S, F>.succeed constructor

Task<S, F>.succeed(
  1. S value
)

Creates a task that succeeds with the given value, for stubbing in tests:

when(() => weatherApi.fetchForecast(any()))
    .thenReturn(Task.succeed(Forecast(high: 21)));

Implementation

Task.succeed(S value) : this._(t.Task.succeed(value));