DartScript.fromFile constructor

DartScript.fromFile(
  1. String scriptPathTo, {
  2. DartProject? project,
})

Creates a DartScript object from a dart script located at scriptPathTo.

The scriptPathTo may be a filename or a filename with a path prefix (relative or absolute). The scriptPathTo parameter MUST end with '.dart'

If the path is relative then it will be joined with the current working directory to form a absolute path.

To obtain a DartScript instance for your running application call:

var script = DartScript.current;

Implementation

DartScript.fromFile(String scriptPathTo, {DartProject? project})
    : this._internal(scriptPathTo, project: project);