InjectableInit class
// Marks a top-level function as an initializer function for configuring Get_it
- Annotations
-
- @Target({TargetKind.function})
Constructors
-
InjectableInit({List<
String> generateForDir = const ['lib'], String? rootDir, bool preferRelativeImports = false, String initializerName = 'init', List<Type> ignoreUnregisteredTypes = const [], List<String> ignoreUnregisteredTypesInPackages = const [], bool asExtension = true, bool usesNullSafety = true, bool throwOnMissingDependencies = false, bool includeMicroPackages = true, List<ExternalModule> ? externalPackageModulesAfter, List<ExternalModule> ? externalPackageModulesBefore, bool usesConstructorCallback = false}) -
default constructor
const
-
InjectableInit.microPackage({List<
String> generateForDir = const ['lib'], bool preferRelativeImports = false, List<Type> ignoreUnregisteredTypes = const [], List<ExternalModule> ? externalPackageModulesAfter, List<ExternalModule> ? externalPackageModulesBefore, bool usesConstructorCallback = false, bool throwOnMissingDependencies = false, List<String> ignoreUnregisteredTypesInPackages = const [], bool usesNullSafety = true}) -
default constructor
const
Properties
- asExtension → bool
-
if true the init function
will be generated inside
of a
GetIt
extension defaults to truefinal -
externalPackageModulesAfter
→ List<
ExternalModule> ? -
a List of external package modules to be registered
in the default package initializer after root dependencies
classes passed here must extend MicroPackageModule
final
-
externalPackageModulesBefore
→ List<
ExternalModule> ? -
a List of external package modules to be registered
in the default package initializer before root dependencies
classes passed here must extend MicroPackageModule
final
-
generateForDir
→ List<
String> -
Only files exist in provided directories will be processed
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
ignoreUnregisteredTypes
→ List<
Type> -
generator will not show warning for unregistered types
included in this list
final
-
ignoreUnregisteredTypesInPackages
→ List<
String> -
generator will not show warning for unregistered types if import start with any string
included in this list
final
- includeMicroPackages → bool
-
whether or not the main initializers
should include micro package modules
defaults to true
final
- initializerName → String
-
generated initializer name
defaults to $init
final
- preferRelativeImports → bool
-
if true relative imports will be used where possible
defaults to false
final
- rootDir → String?
-
If rootDir is provided, generation processes will continue
through this dir.
You can define the rootDir in the following two ways:
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- throwOnMissingDependencies → bool
-
throw an error and abort generation
in case of missing dependencies
defaults to false
final
- usesConstructorCallback → bool
-
feature flag to activate a 'constructor callback'.
Setting this to 'true' will generate an additional parameter
to '$initGetIt' - named "constructorCallback" - a function of signature
"T constructorCallback
final
- usesNullSafety → bool
-
weather to include null-safety
suffixes to the generated code;
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited