flutterflow_cloud library
The FlutterFlow Cloud SDK for Flutter.
One initialize call connects the app; everything else is
self-contained — sessions persist and restore on every Flutter platform
with no plugins, tokens refresh transparently, data requests retry with
their idempotency handled (a function call is sent once, never retried),
query pages can be cached for instant/offline reads, and uploads report
progress.
await FlutterFlowCloud.initialize(options: FFXDefaultOptions.current);
final cloud = FlutterFlowCloud.instance;
Pair it with the built-in generator — dart run flutterflow_cloud:generate
— which turns the project's .ffx/project.json into typed models,
collections, and query methods so app code never touches raw maps.
Pure-Dart CLIs and tools should import
package:flutterflow_cloud/core.dart instead: this barrel adds Flutter
widgets (FFXImage) and therefore requires dart:ui.
Apps that sell import package:flutterflow_cloud/purchases.dart too, for
cloud.purchases; this barrel doesn't export it.
Classes
- BatchCreateOperation
- BatchCreateResult
- BatchDeleteOperation
- BatchDeleteResult
- BatchOperation
- BatchRequest
- BatchResponse
- BatchResult
- BatchUpdateOperation
- BatchUpdateResult
- FFXAggregateResult
- One aggregate query result row: alias → numeric value.
- FFXAppClaimResult
- The durable assignment of one delegated, project-wide custom claim.
- FFXAuth
- Auth surface (14 §6): email/password + guest sign-in and self-managing sessions.
- FFXBatchOperationBuilder
- FFXCacheConfig
- Cache tuning for FlutterFlowCloud.initialize.
- FFXCollection
- Collections addressed by config model-name string (14 §4).
- FFXConnectors
- Connectors surface: calls a third-party service (Slack, Resend, …) through the platform, which holds the credential.
- FFXDatabase
- The database entry points (14 §4–5).
- FFXFieldValue
- Atomic numeric field transforms for update patches and batch updates.
- FFXFile
- A file record (14 §7).
- FFXFunctionCallMetadata
- Response identity: the invocation, release, revision and config that answered, each null when the response did not carry it.
- FFXFunctionCallOptions
- Controls one call, which runs its function at most once: the SDK never resends a request that may have started it. Cancelling or timing out cannot undo effects that already started.
- FFXFunctions
- Callable transport. Project generation adds typed methods to this instance.
- FFXGeoPoint
-
A latitude/longitude pair — the wire shape of config
geopointfields. - FFXGoogleSignInBrowser
- A system-browser port. The browser returns the final app URL, never a Google token.
- FFXImage
- Renders a private FlutterFlow Cloud file by fileId.
- FFXOptions
- Connection settings for one FlutterFlow Cloud project environment.
- FFXPersistedSession
- A persisted session: the token triple plus the last-known user snapshot.
- FFXQuery
- A named list query (14 §5).
- FFXQueryMetadata
- Honest per-response metadata. There is no fictional offline machinery here: isFromCache is true only when the page was actually served from the SDK's query cache, and receivedAt is when the page was originally fetched from the network (so a cached page reports its original fetch time, not "now").
-
FFXQueryPage<
T> - FFXRealtime
- One lazy socket per app; all subscriptions reconcile strongly consistent first pages.
- FFXRecord
- The untyped record core (14 §3.1): raw wire JSON + typed system accessors.
- FFXRetryPolicy
- The shared retry engine (14 §11); numbers are identical to the TS SDK.
- FFXSessionStorage
- FFXStorage
- Storage surface (14 §7): uploads with progress, cached signed download URLs, and file-record reads/updates/deletes.
- FFXSystemGoogleSignInBrowser
- Construct in the sign-in button handler, before any await, so web popups retain the browser's user gesture. Native apps use the OS authentication browser and never an embedded WebView.
-
FFXTypedCollection<
T> -
FFXTypedQuery<
T> - FFXUploadProgress
- Progress of an in-flight upload.
- FFXUploadTask
-
An in-flight upload: awaitable like a
Future<FFXFile>, with progress and cancel. - FFXUser
-
An end user (14 §6): the signed-in person from auth, or an
endUserrecord row from a named query, record read or watch. - FlutterFlowCloud
-
The FlutterFlow Cloud client (14 §2): explicit initialization, one line
in
main, everything else self-contained — session persistence and restore, token refresh, query caching, retries. -
QuerySnapshot<
T> -
RecordAdded<
T> -
RecordChange<
T> - RecordDocument
- System fields plus the model’s declared fields as raw wire JSON.
-
RecordModified<
T> -
RecordRemoved<
T> -
WireValue<
T> - A present optional wire member, including an explicit null value. Leave the containing field null to omit it; use WireValue(null) to clear it.
Enums
- FFXConnectionState
- FFXFetchPolicy
- How a query read consults the cache.
- FFXSignOutScope
- Which sessions FFXAuth.signOut revokes.
Constants
- ffxBatchOperation → const FFXBatchOperationBuilder
-
Builders mirroring the TS SDK's
ffxBatchOperationhelpers: typed batch operations addressed by collection (config model-name string).
Functions
-
newIdempotencyKey(
) → String - Fresh ULID for one logical mutation (18 §8).
Typedefs
-
FFXWebSocketConnector
= Future<
WebSocket> Function(Uri uri, {Iterable<String> ? protocols}) - Opens a realtime connection; injectable for tests and custom transports.
Exceptions / Errors
- FFXApiError
- FFXAuthenticationError
- FFXCancelledError
- Thrown by FFXUploadTask when the caller cancels an in-flight upload.
- FFXConfigVersionRetiredError
- FFXConflictError
- FFXFunctionCancelledError
- Cancellation cannot undo a function's external effects.
- FFXFunctionDeadlineError
- The client stopped waiting at the call's deadline; the function may have run.
- FFXFunctionError
- A function's public application/runtime outcome, retained in the normal platform problem envelope. The SDK never calls the function again on its own: another call is a new invocation, and the app decides whether to make it.
- FFXFunctionTransportError
- No valid answer arrived: the connection failed, the body broke off or the response was neither a result nor a problem. The request may have reached the platform, so the function may have run; the SDK does not send it again.
- FFXInsufficientCreditsError
-
A write whose rule spends credits (
spend("…", n), 05 §3.4) needs more than the end user has: nothing was written or spent. Offer a pack, then send the same request again. - FFXInternalError
- FFXNetworkError
- FFXNotFoundError
- FFXPermissionDeniedError
- FFXQuotaExceededError
- FFXRateLimitedError
- FFXRequestTooLargeError
- FFXTimeoutError
- FFXUnknownError
- FFXValidationError
- FFXVersionConflictError