loadLabelsFromFile static method

List<String> loadLabelsFromFile(
  1. File file
)

Loads a label file into a list of strings

A legal label file is the plain text file whose contents are split into lines, and each line is an individual value. The empty lines will be ignored. The file should be in assets of the context.

Implementation

static List<String> loadLabelsFromFile(File file) {
  final fileString = file.readAsStringSync();
  return labelListFromString(fileString);
}