Task<S, F>.succeed constructor
Task<S, F>.succeed (
- S value
Creates a task that immediately succeeds with the given value.
This is used for testing.
test('Example', () {
when(() => temperatureClient.fetch(any())).thenReturn(Task.succeed(50));
final result = await weatherRepository.fetch('London').run();
expect(result.asSuccess.temperature, 50);
});
Implementation
Task.succeed(S value) : this._(t.Task.succeed(value));