readAsStringSync method

  1. @override
String readAsStringSync()
override

Synchronously read the entire file contents as a String. Throws FileSystemException if the file does not exist.

Implementation

@override
String readAsStringSync() {
  if (!file.existsSync()) {
    return '';
  }

  return file.readAsStringSync();
}