readLines static method

Future<List<String>> readLines(
  1. String path
)

以行为单位读取文件内容。

Implementation

static Future<List<String>> readLines(String path) async {
  File file = File(path);
  List<String> lines = await file.readAsLines();
  return lines;
}