is a library is a strongly-typed, immutable Dart client designed for Flutter applications. Its core function is to facilitate the uploading, indexing, and multimodal searching inside Video content media.
Core Architecture & Architecture Flow
The SDK is designed around a clear separation of concerns, separating application initialization from project scopes and credential handling.
-
VModal: The main entry point used to configure project settings. -
VModalProject: An immutable client representation of a single developer project. -
VModalScope: A scoped operator targeting specific collections and media streams without requiring you to repeatedly pass organization parameters.
Basic Implementation Flow:
dart
final favorites = project.scope(
collectionName: 'user_123',
streamName: 'favorites',
);
// Perform media search within scope
final results = await favorites.search('a person entering the room');
// Clean up resources
await project.close();
keys.close();Key Feature Capabilities
-
Resumable & Adaptive Media Uploads
-
Resumable State Stores: Incorporates
FileUploadSessionStoreandMemoryUploadSessionStoreto save multipart upload checkpoints, preventing lost progress due to network failures. -
Adaptive Policies: Evaluates device RAM (
UploadDeviceMemory), network types, and throughput speeds (UploadNetworkSpeed) to adjust multipart sizes dynamically using theAdaptiveUploadPolicy. -
On-Device Optimization: Includes an optional
VideoTranscoderframework to compress videos right on the user's device before initializing an upload.
-
Multimodal Indexing & Search
-
SearchesResource: Implements multimodal criteria pipelines to search deep media archives via natural language text strings or multi-aspect parameters. -
IndexesResource: Controls index lifecycles, management statuses, and creation parameters for searchable object groups.
-
Operational Asynchrony & Cancellation
-
UploadTask<T>: Upload functions immediately return a running task handle that broadcasts reactive metrics via anUploadTask.progressstream. -
CancellationToken: Long-running operations accept cooperative cancellation tokens, giving you clean, intentional control over network connections. [, ]
SDK Resource Taxonomy
| Resource Module | Primary Responsibility |
|---|---|
AuthResource
| Manages credentials, identity resolution, and service-health monitoring. |
CollectionsResource
| Handles media uploads, metadata updates, and collection groupings. |
ImagesResource
| Manages image location indexing, temporary pathing, and bulk asset downloads. |
AdminResource
| Tracks consumption metrics, usage statistics, and individual user limits. |
R2Resource
| Directs pre-signed asset uploads straight to cloud storage instances. |
Error Architecture
The library features a robust suite of custom exceptions to handle unexpected issues smoothly:
-
AuthException: Triggered when authentication or identity resolution fails. -
SignedUploadFailure: Thrown when a network transfer fails, while preserving your partial upload integrity information. -
OperationCanceled: Raised immediately when a token signals a cooperative cancellation. -
MalformedResponse/ResponseTooLarge: Safeguards memory limits against huge payloads or corrupted server data.
It is a popular package and It has been downloaded more than 16,000 over a couple of weeks in