BuildContext class Null safety

Configuration and context values used during Build.execute.

Constructors

BuildContext(Uri rootLibraryFileUri, Uri buildDirectoryUri, Uri executableUri, String source, {bool forTests = false})
BuildContext.fromMap(Map<String, dynamic> map)
factory

Properties

analyzer CodeAnalyzer
read / write
buildApplicationDirectory Directory
Directory for compiled application
read-only
buildDirectory Directory
The directory where build artifacts are stored.
read-only
buildDirectoryUri Uri
A Uri to directory where build artifacts are stored during the build process.
final
buildPackagesDirectory Directory
Directory for compiled packages
read-only
buildRuntimeDirectory Directory
The generated runtime directory
read-only
context MirrorContext
The RuntimeContext available during the build process.
read-only
executableUri Uri
A Uri to the executable build product file.
final
forTests bool
Whether dev dependencies of the application package are included in the dependencies of the compiled executable.
final
hashCode int
The hash code for this object.
read-onlyinherited
packageConfig Future<PackageConfig>
Gets dependency package location relative to sourceApplicationDirectory.
read-only
rootLibraryFileUri Uri
A Uri to the library file of the application to be compiled.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
safeMap Map<String, dynamic>
read-only
source String
The source script for the executable.
final
sourceApplicationDirectory Directory
The directory of the application being compiled.
read-only
sourceApplicationPubspec PubSpec
read-only
sourceApplicationPubspecMap Map
read-only
sourceLibraryFile File
The library file of the application being compiled.
read-only
targetScriptFileUri Uri
read-only

Methods

getAnnotationsFromField(Type type1, String propertyName) Future<List<Annotation>>
getClassDeclarationFromType(Type type) Future<ClassDeclaration?>
getDirectory(Uri uri) Directory
Returns a Directory at uri, creates it recursively if it doesn't exist.
getFile(Uri uri) File
Returns a File at uri, creates all parent directories recursively if necessary.
getImportDirectives({Uri? uri, String? source, bool alsoImportOriginalFile = false}) Future<List<String>>
getPackageFromUri(Uri? uri) Future<Package?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited