BucketFile class
Represents a file stored in a bucket.
A BucketFile contains metadata about a file including its location, size, type, and any associated tags for organization and access control.
Example
final file = BucketFile(
id: 456,
key: 'uploads/image.jpg',
description: 'User profile picture',
tags: ['profile', 'image'],
bucketId: 123,
type: 'image/jpeg',
size: 1024000,
createdAt: DateTime.now(),
);
Constructors
-
BucketFile({required int id, required String key, String? description, List<
String> ? tags, required int bucketId, String? type, required int size, required DateTime createdAt}) - Creates a new BucketFile instance.
-
BucketFile.fromJson(Map<
String, dynamic> json) -
Creates a BucketFile instance from a JSON object.
factory
Properties
- bucketId → int
-
The ID of the bucket that contains this file.
final
- createdAt → DateTime
-
The timestamp when this file was created.
final
- description → String?
-
Optional description of the file.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
The unique identifier for this file.
final
- key → String
-
The key (path) of the file within the bucket.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The size of the file in bytes.
final
-
List of tags associated with this file.
final
- type → String?
-
The MIME type of the file.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this BucketFile instance to a JSON object.
-
toString(
) → String -
Returns a string representation of this BucketFile instance.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited