buildFile static method

File buildFile(
  1. String fileName
)

Implementation

static File buildFile(String fileName) {
  // Check file file contains an allowed extension
  final ext = p.extension(fileName).substring(1);
  if (!SlideAsset.allowedExtensions.contains(ext)) {
    throw Exception('Invalid file extension: $ext');
  }
  return File(
    p.join(
      kConfig.assetsImageDir.path,
      '${SlideAsset.assetPrefix}$fileName',
    ),
  );
}