StorageFolderModel constructor

const StorageFolderModel({
  1. String? parent,
  2. required String current,
})

Serves as the foundational abstraction for models organized within a hierarchical storage or directory structure.

The StorageFolderModel defines a consistent way to represent any item or folder located inside a structured storage system, such as a remote bucket, file system, or nested data hierarchy.

Each instance exposes:

  • current: the unique path representing its own location.
  • parent: an optional reference to its parent container or folder.

This abstraction allows clean, type-safe modeling of nested storage structures, enabling path composition, traversal, and contextual operations within a bucket-like hierarchy.

Example:

class UserFolder extends StorageFolderModel<UserFolder> {
  UserFolder({super.parent}) : super(current: 'users/123');
}

final userFolder = UserFolder(parent: 'company/acme');
print(userFolder.current); // users/123
print(userFolder.parent);  // company/acme

Implementation

const StorageFolderModel({this.parent, required this.current});