flatMap<R> method
Chains another operation that returns a VerificationResult
If this result is a failure, returns a new failure with the same error.
If this result is a success, executes transform with the data.
Implementation
Future<VerificationResult<R>> flatMap<R>(
Future<VerificationResult<R>> Function(T data) transform,
) async {
if (isSuccess) {
return await transform(data as T);
} else {
return VerificationResult.failure(error!);
}
}