readFileSync method

String readFileSync(
  1. String path
)

Read the contents of a file synchronously

Implementation

String readFileSync(String path) {
  final file = File(path);
  if (!file.existsSync()) {
    throw FileSystemException('File not found', path);
  }
  return file.readAsStringSync();
}