either_dart
Error handler library for type-safe and easy work with errors on Dart and Flutter. Either is an alternative to Nullable value and Exceptions.
1.0.0
54K downloads/mo
#1430 most downloaded on pub.dev
avdosev/either_dart
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 12 of 14 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
17 releases · first in 2020
0 releases in the last 12 months
see the full history below
Release timeline
17 releases · Sep 2020 to Jun 2023Releases
latest 17-
1.0.010 Jun 2023Release notes
Open source →remove deprecated methods from
Future[Either]Eitheris now sealed - this gives you support pattern matching.You now have an alternative for the fold and either
before:
final either = ...; final result = either.fold( (left) => do something with left (right) => do something with right );after:
final either = ...; switch (either) { case Left(value: final left): do something with left case Right(value: final right): do something with right }Thanks to @dballance for creating the issue
Also, you can still use:
either.isLeft- check either is left
either.isRight- check either is right -
0.4.027 Apr 2023Release notes
Open source →Provide more async flexible type support for FutureEither's fold operation.
Thanks to @lukasbalaz for creating the issue
add:
- tryExcept -
A simple but powerful constructor for exception handling. Just specify the type of error you expect from the function and you will get
Either<ExpectedError, RightType>
- tryExcept -
A simple but powerful constructor for exception handling. Just specify the type of error you expect from the function and you will get
-
0.3.006 Nov 2022Release notes
Open source →Either now overrides equality and hash.
Thanks to @memishood for creating the issue
-
0.2.031 Jul 2022Release notes
Open source →Updated to support
FutureOr<T>instead ofFuture<T>:- Either:
- thenAsync
- thenLeftAsync
- mapAsync
- mapLeftAsync
- Future[Either]:
- thenRight
- thenLeft
Updated to support
FutureOr<T>instead ofT:- Future[Either]:
- mapRight
- mapLeft
Mark deprecated (not delete):
- Future[Either].thenRightSync
- Future[Either].thenLeftSync
- Future[Either].mapRightAsync
- Future[Either].mapLeftAsync
The following methods were not needed after
FutureOrsupport, so they are marked Deprecated. - Either:
-
0.1.407 Nov 2021 -
0.1.318 Aug 2021Release notes
Open source →Added:
- thenLeft
- thenLeftAsync
- similiar methods for
FutureEither<L, R>extension
-
0.1.207 Jun 2021 -
0.1.119 Apr 2021Nothing published for this version
-
0.1.019 Apr 2021Nothing published for this version
-
0.1.0-nullsafety.219 Apr 2021 pre-releaseRelease notes
Open source →Added:
- mapLeftAsync
FutureEither<L, R>extension
Fixed:
- change the naming of the async methods of
Eitherclass
Changes
Either:- asyncThen -> thenAsync
- asyncMap -> mapAsync
-
0.1.0-nullsafety.105 Jan 2021 pre-release -
0.1.0-nullsafety.004 Jan 2021 pre-releaseRelease notes
Open source →Added:
- null-safety
- swap method
- const constructor for Left and Right
Changed:
- rename unite to fold
-
0.0.525 Nov 2020 -
0.0.424 Nov 2020 -
0.0.315 Sep 2020 -
0.0.215 Sep 2020 -
0.0.113 Sep 2020