readFile static method

Future<String> readFile(
  1. String filePath
)

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 {
  final File file = File(filePath);
  return await file.readAsString();
}