Dart - bucket()

Create a new bucket for storing and retrieving files.

import 'package:nitric_sdk/nitric.dart';

// Create a readable, writable, and deletable reference to an 'assets' bucket
final assets = Nitric.bucket("assets").allow([
  BucketPermission.read,
  BucketPermission.write,
  BucketPermission.delete,
]);

Parameters

  • Name
    name
    Required
    Required
    Type
    String
    Description

    The unique name of this bucket within the service. Subsequent calls to bucket with the same name will return the same object.

Access

All Nitric resources provide access permissions you can use to specify the level of access your service needs to the resource. See here for details Access Control documentation.

Available permissions:


BucketPermission.read

This permission allows your service to read files from the bucket


BucketPermission.write

This permission allows your service to write files to the bucket


BucketPermission.delete

This permission allows your service to delete files from the bucket


Working with files

See the following for examples on working with files in a bucket: