StorageFile constructor
StorageFile({
- required String cloudPath,
- required String fileName,
- required int size,
- required StorageRef reference,
Implementation
StorageFile(
{required this.cloudPath,
required this.fileName,
required this.size,
required this.reference}) {
List<String> names = cloudPath.split("/");
if (names.length > 6) {
relatedDirs = [];
for (int i = 6; i < names.length - 1; i++) {
relatedDirs.add(names[i]);
}
}
extension = fileName.split(".").last.toUpperCase();
if (imgExt.any((element) => element.toUpperCase() == extension)) {
type = "image";
} else if (vidExt.any((element) => element.toUpperCase() == extension)) {
type = "video";
} else {
type = "file";
}
}