createBucket method
Implementation
Future<void> createBucket() async {
_validateBucketInfo();
// validating bucket folder path
Directory directory = Directory(storageBucket.folderPath);
if (!directory.existsSync()) {
try {
directory.createSync(recursive: true);
// here just add the bucket id to the buckets data
await _saveBucketId();
} catch (e) {
throw StorageBucketFolderPathException(
'can\'t create the bucket folder, $e');
}
}
// check if the storage bucket is created or not
if (!directory.existsSync()) {
throw StorageBucketFolderPathException('bucket folder wasn\'t created');
}
await _createBucketInfoBox();
}