evalFile method

dynamic evalFile(
  1. String key, {
  2. String? module,
  3. bool globallyImport = false,
  4. String? invoke,
  5. List positionalArgs = const [],
  6. Map<String, dynamic> namedArgs = const {},
})

Evaluate a file. key is a possibly relative path. file content will be searched by sourceContext. If invoke is provided, will immediately call the function after evaluation completed.

Implementation

dynamic evalFile(
  String key, {
  String? module,
  bool globallyImport = false,
  String? invoke,
  List<dynamic> positionalArgs = const [],
  Map<String, dynamic> namedArgs = const {},
  // List<HTType> typeArgs = const [],
}) {
  final source = sourceContext.getResource(key);
  final result = evalSource(
    source,
    module: module,
    globallyImport: globallyImport,
    invoke: invoke,
    positionalArgs: positionalArgs,
    namedArgs: namedArgs,
    // typeArgs: typeArgs,
  );
  return result;
}