DartSdk class
The DartSdk provides access to a number of the dart sdk tools as well as details on the active sdk instance.
Constructors
- DartSdk()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pathToDartExe → String?
-
The path to the dart exe.
no setter
- pathToDartToNativeExe → String?
-
file path to the 'dart2native' command.
no setter
- pathToPackageConfig → String
-
returns the relative path to the packges configuration file.
For versions of dart prior to 2.10 this returns '.packages'
For versions of dart from 2.10 it returns .dart_tools/package_config.json
no setter
- pathToPubExe → String?
-
file path to the 'pub' command.
no setter
- pathToSdk → String
-
The path to the dart 'bin' directory.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useDartCommand → bool
-
From 2.10 onwards we use the dart compile option rather than dart2native.
no setter
- version → String?
-
returns the version of dart.
no setter
- versionMajor → int
-
no setter
- versionMinor → int
-
no setter
Methods
-
globalActivate(
String package) → void -
Run dart pub global activate on the given
package
. -
globalActivateFromPath(
String path) → void -
Run dart pub global activate for a packae located in
path
relative to the current directory. -
installFromArchive(
String defaultDartSdkPath, {bool askUser = true}) → String -
Installs the latest version of DartSdk from the official google archives
This is simply the process of downloading and extracting the
sdk to the
defaultDartSdkPath
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
runDartCompiler(
Script script, {required String pathToExe, Progress? progress}) → void -
Run the 'dart compiler' command.
script
is the path to the dcli script we are compiling.pathToExe
is the path (including the filename) to write the compiled ex to . -
runPubGet(
String? workingDirectory, {Progress? progress, bool? compileExecutables}) → void - runs 'pub get'
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- dart2NativeExeName → String
-
platform specific name of the 'dart2native' executable
no setter
- dartExeName → String
-
platform specific name of the 'dart' executable
no setter
- pubExeName → String
-
platform specific name of the 'pub' executable
no setter