evalFile method

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

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

Implementation

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