readFileAsString function

Future<String?> readFileAsString(
  1. String path
)

Implementation

Future<String?> readFileAsString(String path) async {
  var file = File(path);
  String? contents;

  if (await file.exists()) {
    contents = await file.readAsString();
  }
  return contents;
}