This small package is providing json_serializable
-support for dartz
-monads.
At the moment, only Option<>
and Either<,>
are supported. If you wish support for other monads, open an issue or feel free to contribute.
Since annotations aren't supporting generics, you have to bind the parameters at compile time:
class StringOptionConverter extends OptionConverter<String> {
const StringOptionConverter();
}
Then you can use the converter as usual:
@StringOptionConverter()
final Option<String> option;
Also take a look at the example.
Please file feature requests and bugs at the issue tracker.