readFile static method

Future<String> readFile(
  1. File file
)

Implementation

static Future<String> readFile(File file) async {
  String contents;
  try {
    // Read the file
    contents = await file.readAsString();
  } catch (e) {
    // If we encounter an error
    contents = '';
  }
  return contents;
}