getModelsDirPath method

Future<String> getModelsDirPath()

Implementation

Future<String> getModelsDirPath() async {
  final baseDir = await getExternalStorageDirectory();
  if (baseDir == null) {
    throw UnsupportedError(
      'getExternalStorageDirectory() returned null — no external storage available',
    );
  }
  final modelsDir = Directory(
    p.join(baseDir.path, resourceConfig.modelsDirName),
  );

  if (!await modelsDir.exists()) {
    await modelsDir.create(recursive: true);
  }
  return modelsDir.path;
}