updateBucket method Null safety

Future<String> updateBucket(
  1. String id,
  2. BucketOptions bucketOptions
)
inherited

Updates a new Storage bucket

id is a unique identifier for the bucket you are creating.

bucketOptions is a parameter to set the publicity of the bucket.

Implementation

Future<String> updateBucket(
  String id,
  BucketOptions bucketOptions,
) async {
  final FetchOptions options = FetchOptions(headers: headers);
  final response = await storageFetch.put(
    '$url/bucket/$id',
    {'id': id, 'name': id, 'public': bucketOptions.public},
    options: options,
  );
  final message = (response as Map<String, dynamic>)['message'] as String;
  return message;
}