fromFile static method

Future<Document> fromFile(
  1. File file, {
  2. ParserErrorHandler? onErrors,
  3. List<Extensions> xtends = const [],
})

Given a file and list of YES spec extensions xtends, parse and return Document.

If a custom onErrors implementation is provided, then errors will be fed to it.

By default, no extensions are selected.

Implementation

static Future<Document> fromFile(
  File file, {
  ParserErrorHandler? onErrors,
  List<Extensions> xtends = const [],
}) async {
  return fromString(
    await file.readAsString(),
    onErrors: onErrors,
    xtends: xtends,
  );
}