all_result 1.0.1 copy "all_result: ^1.0.1" to clipboard
all_result: ^1.0.1 copied to clipboard

Typed success and failure for pure Dart, with predictable error contracts, sync/async composition, recovery, and zero runtime dependencies.

example/all_result_example.dart

import 'package:all_result/all_result.dart';

Result<String, int> parsePositive(String raw) {
  return Result.guard(
    () => int.parse(raw),
    onError: (_) => 'Número inválido',
  ).flatMap(
    (value) => Result.cond(value > 0, value, 'O número deve ser positivo'),
  );
}

void main() {
  print(parsePositive('42').fold((error) => error, (value) => '$value'));
}
0
likes
160
points
273
downloads

Documentation

API reference

Publisher

verified publisheropensource.tatamemaster.com.br

Weekly Downloads

Typed success and failure for pure Dart, with predictable error contracts, sync/async composition, recovery, and zero runtime dependencies.

Repository (GitHub)
View/report issues
Contributing

Topics

#result #error-handling #functional-programming #async

License

MIT (license)

More

Packages that depend on all_result