empty_generator 0.0.3 copy "empty_generator: ^0.0.3" to clipboard
empty_generator: ^0.0.3 copied to clipboard

Code generator for use with the Empty Annotation package.

example/example.dart

// ignore_for_file: avoid_print

import 'package:empty_annotation/empty_annotation.dart';

// Make sure the `part` is specified before running the builder.
// part 'example.g.dart';

@Empty()
class ExampleClass {
  final int id;
  final String name;

  ExampleClass({required this.id, required this.name});
}

// Comment this class when the code is generated by the builder.
class ExampleClassEmpty extends ExampleClass {
  ExampleClassEmpty() : super(id: 0, name: '');
}

void main() {
  // Run `dart run build_runner build` first to generate the code
  final emptyInstance = ExampleClassEmpty();
  print('Generated empty instance: $emptyInstance');
}
0
likes
140
points
73
downloads

Publisher

unverified uploader

Weekly Downloads

Code generator for use with the Empty Annotation package.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

analyzer, build, empty_annotation, source_gen

More

Packages that depend on empty_generator