The Dart SDK is currently in experimental status. If you would like to provide feedback, please reach out to us with your suggestions and comments on our Discord.
Dart - bucket.files()
Get a list of file references for files that exist in the bucket.
import 'package:nitric_sdk/nitric.dart';
final assets = Nitric.bucket("assets").allow([
BucketPermission.read,
BucketPermission.delete,
]);
final files = await assets.files();
Examples
delete all files in a bucket
import 'package:nitric_sdk/nitric.dart';
final assets = Nitric.bucket("assets").allow([
BucketPermission.read,
BucketPermission.delete,
]);
final files = await assets.files();
await Future.wait(files.map((file) async {
await file.delete();
}));
Notes
This method returns a list of File references that exist on the bucket.