You can now run the generator, and then override and implement the "validate" methods.
Default validationSteps names
The name parameter of the ValidationStep is optional. If you omit it, it will be replaced by a default name :
If there's only one step, then its default name is 'Value' (instead of 'Value1').
Complete Example
// ... Imports & Part statements@Modddel( validationSteps: [ValidationStep([Validation('location', FailureType<GeoPointLocationFailure>()), ]), ],)classGeoPointextendsMultiValueObject<InvalidGeoPoint, ValidGeoPoint> with_$GeoPoint {GeoPoint._();factoryGeoPoint({requiredint latitude,requiredint longitude, }) {return_$GeoPoint._create( latitude: latitude, longitude: longitude, ); }@overrideOption<GeoPointLocationFailure> validateLocation(geoPoint) {if (geoPoint.latitude ==0&& geoPoint.longitude ==0) {returnsome(constGeoPointLocationFailure.nullIsland()); }returnnone(); }}@freezedclassGeoPointLocationFailureextendsValueFailurewith_$GeoPointLocationFailure{/// Null Island is the point on the Earth's surface at zero degrees /// latitude and zero degrees longitude (0°N 0°E)constfactoryGeoPointLocationFailure.nullIsland() =_NullIsland;}