readFile static method

Future<String> readFile(
  1. String filePath
)

Read the contents of a file

Implementation

static Future<String> readFile(String filePath) async {
  try {
    return await File(filePath).readAsString();
  } catch (e) {
    throw Exception('Failed to read file: $filePath - ${e.toString()}');
  }
}