decorator_gen 0.5.0 copy "decorator_gen: ^0.5.0" to clipboard
decorator_gen: ^0.5.0 copied to clipboard

Automatically generates code for the decorator pattern in Dart by annotating classes.

example/example.dart

import 'package:decorator_annotation/decorator_annotation.dart';

part 'example.g.dart'; // This part directive is necessary for code generation

@Decorator() // Add this annotation to generate a decorator for this class
class MyExampleClass {
  // The generated decorator will forward calls to this method
  void foo() {}

  // This method will not be in the generated decorator
  static void bar() {}
}
0
likes
150
points
176
downloads

Publisher

unverified uploader

Weekly Downloads

Automatically generates code for the decorator pattern in Dart by annotating classes.

Repository (GitHub)
View/report issues

Topics

#build-runner #codegen #decorator #design-pattern

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, decorator_annotation, source_gen

More

Packages that depend on decorator_gen