Skip to content
pubscout

fpdart

1.2.0, released a year ago by sandromaglione.com

Functional programming types and patterns for Dart and Flutter.

Flutter FavoriteWASM-ready
$ flutter pub add fpdart
Source repository

What it does

Provides core functional programming types and patterns like Option, Either, IO, Task, Reader, State, and immutable collections. Fully documented and tested.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to enforce strict error handling using Either instead of throwing exceptions.
  • You want to handle missing values safely using the Option type.
  • You prefer functional programming patterns in your Dart and Flutter applications.

Skip it when

  • Your team is not familiar with functional programming concepts and prefers standard imperative Dart style.
  • You only need simple async utilities already available in standard Dart libraries.

Strengths

  • Comprehensive suite of functional types (Option, Either, Task, Reader, State, etc.).
  • First-class support for Dart 3 features like sealed classes, pattern matching, and records.
  • Extensive documentation and blog posts/tutorials by the author.

Weaknesses

  • Steep learning curve for developers new to functional programming paradigms.
  • Version 2 rewrite is currently in development and pre-release stage.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Add fpdart to pubspec.yaml dependencies.

final option = Option.of(10);
final map = option.map((a) => '$a');
final value = option.getOrElse(() => -1);

Alternatives

Packages that do the same job and could replace fpdart.

Works with

Packages commonly used together with fpdart: ones it builds on, ones built on it, and its own family.