flatMap<R> method
Chaining: если success — применяет f, если failure — пропускает.
final names = result
.flatMap((items) => Right(items.map((e) => e.name).toList()))
.orElse((_) => <String>[]);
Implementation
Result<R> flatMap<R>(Result<R> Function(T value) f) => switch (this) {
Right(:final value) => f(value),
Left(:final failure) => Left(failure),
};