modddels
modddels copied to clipboard
Generate robust, self-validated models with compile-safe states, seamless failure handling and easy unit-testing.
# Background When it comes to implementing generics, we should consider two main issues : **param transformations** and **type constraints**. In general, a "param transformation" is a change in the...
Right now, all validation methods are synchronous, and there is no way to make them async. ```dart @Modddel( // ... ) class Age extends SingleValueObject with _$Age { Age._(); factory...
Freezed supports directly creating a union-case and preserving its type, for example : ```dart @freezed class MapLayer with _$MapLayer { const factory MapLayer.raster(int someParam) = Raster; const factory MapLayer.vector(int someParam)...
Hi (again) 👋 I have this ValueObject implementing a [0.0; 1.0] `double` inclusive range: ``` dart import "package:freezed_annotation/freezed_annotation.dart"; import "package:modddels_annotation_fpdart/modddels_annotation_fpdart.dart"; part 'percentage.modddel.dart'; part 'percentage.freezed.dart'; @Modddel( validationSteps: [ ValidationStep([Validation("range", FailureType())]), ],...