map<T extends Object> method
If this is a Success
, maps S
to T
, otherwise returns F
untouched.
Success(1).map((v) => v.toString()); // Success('1')
Failure(2).map((v) => v.toString()); // Failure(2)
Implementation
@override
@useResult Result<T, F> map<T extends Object>(T Function(S success) function) => Success(function(success));