value_class 1.1.0 copy "value_class: ^1.1.0" to clipboard
value_class: ^1.1.0 copied to clipboard

discontinued
SDKDart

Code generation for value classes. This package depends on value_annotation.

1.1.0 #

Added #

  • Supported @Assert to generate assert(...) 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 #

1.0.1 #

Fixed #

  • Changed how content is accessed.

1.0.0+1 #

Fixed #

  • Create .pubignore.

1.0.0 #

  • Initial version.
1
likes
110
pub points
0%
popularity

Publisher

verified publisherblendthink.dev

Code generation for value classes. This package depends on value_annotation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

analyzer, build, build_config, collection, source_gen, value_annotation

More

Packages that depend on value_class