dino_generator 1.0.0-pre.4 copy "dino_generator: ^1.0.0-pre.4" to clipboard
dino_generator: ^1.0.0-pre.4 copied to clipboard

An optional static code generator for the dino library.

example/lib/main.dart

import 'package:dino/dino.dart';

part 'main.g.dart';

class DependencyA {}

class DependencyB {}

@service
class DependencyC {
  DependencyC(this.dependencyA, this.dependencyB);

  final DependencyA dependencyA;
  final DependencyB dependencyB;
}

abstract class TestService {
  void doSomething();
}

@Service(ServiceLifetime.singleton)
class TestServiceImpl implements TestService {
  TestServiceImpl(
    this.dependencyA,
    this.dependencyB,
    this.dependencyC,
  );

  final DependencyA dependencyA;
  final DependencyB dependencyB;
  final DependencyC dependencyC;

  @override
  void doSomething() {
    print('doSomething');
  }
}

void main(List<String> args) {
  final services = ServiceCollection();

  services.addDependencyC(ServiceLifetime.transient);
  services.addTestServiceImpl();
}
0
likes
120
pub points
7%
popularity

Publisher

verified publisherexeteres.dev

An optional static code generator for the dino library.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

analyzer, build, code_builder, dino, source_gen

More

Packages that depend on dino_generator