readFile static method
Reads the contents of the file at filePath
as a string.
Example:
final contents = await FileUtils.readFile('/path/to/file.txt');
Implementation
static Future<String> readFile(String filePath) async {
if (kIsWeb) {
throw UnsupportedError('readFile is not supported on web');
}
final File file = File(filePath);
return await file.readAsString();
}