load method

Future<List<String>?> load(
  1. String path
)

Loads an imported resource and returns a Future with a List of lines. Returns null if the resource could not be loaded.

Implementation

Future<List<String>?> load(String path) async {
  try {
    // Ensure `readAsLines` runs within the try block so errors are caught.
    return await File(path).readAsLines();
  } catch (_) {
    failed.add(path);
    return null;
  }
}