value_class 1.1.0 value_class: ^1.1.0 copied to clipboard
Code generation for value classes. This package depends on value_annotation.
1.1.0 #
Added #
-
Supported
@Assert
to generateassert(...)
statements on the generated classes:@valueClass class Email with _$Email { @Assert(_checkNotEmpty, 'Email cannot be empty') @Assert(_checkFormat, 'Email format is invalid') factory Email(String value) = _Email; factory Email.fromJson(String value) = _Email; } bool _checkNotEmpty(String value) => value.isNotEmpty; bool _checkFormat(String value) => value.contains(RegExp(r'^.+@\S+\.\S+$'));
1.0.2 #
Fixed #
- Supported the combination of json_serializable and freezed.
1.0.0 #
- Initial version.