loadLabels static method

Future<List<String>> loadLabels(
  1. String fileAssetLocation
)

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.

fileAssetLocation specifies the path of asset at project level. For example: If file is located at

Implementation

static Future<List<String>> loadLabels(String fileAssetLocation) async {
  final fileString = await rootBundle.loadString('$fileAssetLocation');
  return labelListFromString(fileString);
}