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

discontinued
outdated

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

Pub Version Dart SDK Version Pub popularity

Features #

By annotating the class, the code required for the "Value Class" is automatically generated.

Inspired by json_serializable and freezed.

Getting started #

Flutter project:

flutter pub add value_annotation
flutter pub add --dev build_runner
flutter pub add --dev value_class

flutter pub get

Dart project:

dart pub add value_annotation
dart pub add --dev build_runner
dart pub add --dev value_class

dart pub get

Usage #

1. Create class #

import 'package:value_annotation/value_annotation.dart';

part 'example.value.dart';

@valueClass
class Example with _$Example {
  const factory Example(String value) = _Example;

  const factory Example.fromJson(String value) = _Example;
}

2. Run generator #

Flutter project:

flutter pub run build_runner build

Dart project:

dart run build_runner build
1
likes
0
points
70
downloads

Publisher

verified publisherblendthink.dev

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, build_config, collection, source_gen, value_annotation

More

Packages that depend on value_class