FLUTTER ECOSYSTEM

multiple_result

Multiple results for dart. Inspired by dartz's Either and Kotlin's sealed classes

Latest version
5.3.0
30-day downloads
43.3K
Likes
174
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

Multiple_result is a Dart package providing a robust way to handle multiple possible outcomes in a type-safe manner, inspired by dartz's Either and Kotlin's sealed classes. It enables developers to model complex result types with multiple success or failure states, improving code clarity and error handling. The package supports exhaustive pattern matching and is designed for use across all major platforms, making it ideal for functional-style programming in Flutter and other Dart applications.

Use cases
  • Handling multiple success or error states in APIs
  • Implementing state management with clear result types
  • Building resilient business logic with explicit outcomes
  • Supporting functional programming patterns in Dart
  • Managing asynchronous operations with varied results
Key features
  • Supports multiple result types
  • Exhaustive pattern matching
  • Type-safe result handling
  • Inspired by Kotlin sealed classes and dartz Either
  • Cross-platform compatibility
Suitable for
  • Developers using functional programming in Dart
  • Teams prioritizing type safety and error handling
  • Flutter apps requiring structured result management
  • Projects with complex state transitions
Considerations
  • Requires understanding of functional concepts
  • May increase boilerplate for simple cases
  • Best suited for larger applications with complex workflows
  • Not ideal for basic success/failure scenarios without multiple variants
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add multiple_result

Categories

Source repository

Related projects