injectable_generator 2.3.0 injectable_generator: ^2.3.0 copied to clipboard
Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add injectable_generator
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
injectable_generator: ^2.3.0
Alternatively, your editor might support dart pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:injectable_generator/builder.dart';
import 'package:injectable_generator/code_builder/builder_utils.dart';
import 'package:injectable_generator/code_builder/library_builder.dart';
import 'package:injectable_generator/generators/injectable_config_generator.dart';
import 'package:injectable_generator/generators/injectable_generator.dart';
import 'package:injectable_generator/injectable_types.dart';
import 'package:injectable_generator/models/dependency_config.dart';
import 'package:injectable_generator/models/dispose_function_config.dart';
import 'package:injectable_generator/models/external_module_config.dart';
import 'package:injectable_generator/models/importable_type.dart';
import 'package:injectable_generator/models/injected_dependency.dart';
import 'package:injectable_generator/models/module_config.dart';
import 'package:injectable_generator/resolvers/dependency_resolver.dart';
import 'package:injectable_generator/resolvers/importable_type_resolver.dart';
import 'package:injectable_generator/utils.dart';