flutterflow_cloud_core

Pure Dart values and local project generation shared by the Flutter app SDK, its project generator, the emulator and the Dart Admin SDK. Runtime libraries have no Flutter dependency, transport, credential store, deployed resources or listening port. Keeping them separate lets the pure Dart emulator, which compiles with dart compile exe, use the same Functions value-schema validation as the app without depending on the Flutter app client or its ambient HTTP transport.

Surface

functionBackendLimitExceeded maps to FFXFunctionError. Its userMessage explains that the action stopped partway and earlier changes may already be saved. The detail and fix fields carry the diagnostics. When an action returns an invalid result or stops during execution, earlier changes may already be saved. A sign-in or app setup refusal before the action starts has separate wording.

The closed Functions generator schema reads optional capabilities.admin: "full" and minRuntimeAbi: "ffx-functions-v3" on every function kind. They do not change generated app call bindings. Existing configs remain compatible with old generator pins. Opted-in configs require generator and emulator releases containing this reader; publication, template and agent pin updates are operator steps. Local TypeScript Functions expose ctx.admin through the matching CLI/emulator pair. Cloud activation uses ordinary deployment permissions and requires serving-v3 readiness; the operator's runtime release remains required. Every function kind refuses admin combined with non-empty exact service grants at capabilities.serviceGrants, with the TypeScript compiler's message. Absent admin adds no canonical fields. The reserved-operation refusal functionBackendOperationUnavailable maps to FFXServiceUnavailableError, retaining its code and retry delay, as in the TS client.

flutterflow_cloud_core.dart exports the common record, query, user, file and geopoint values plus typed API errors and problem decoding. Recognized sign-in and account feature codes have plain userMessage copy with the original error code in parentheses and, when present, (ref <requestId>). Shared access/session codes (authenticationRequired, sessionRevoked, sessionExpired) keep their existing context-specific copy: they can mean an expired app ticket, a deleted account, or an older request finishing after a successful account switch. A permissionDenied or authenticationRequired refusal that carries the rule's own message (ruleMessage) shows that sentence instead. Apps show userMessage; detail, fix and toString() retain the builder's diagnostics. FFXUser keeps its wire strings and adds typed members: isGuest, isFullAccount, isEmailVerified, signInProviders (FFXSignInProvider, with unknown for a provider added after this release) and createdAtTime, updatedAtTime and lastSignInAtTime as DateTimes. FFXFile adds fileStatus (FFXFileStatus), isReady and isUploading. The Dart Admin SDK uses the same FFXSignInProvider and FFXFileStatus.

FFXErrorCode holds one static const per platform error code, generated from the problem registry (error_codes.g.dart, bun run codegen), so an app compares error.code == FFXErrorCode.emailAlreadyExists; code stays a String, since a newer server can answer a code this release does not name. FFXApiError keeps its wire retry string and errors maps and adds retryClass (the FFXRetry enum; a missing or unknown value is never), isRetryable, and fieldErrors (FFXFieldError: pointer, code, message, String? fix; a malformed entry is dropped). The Dart Admin SDK re-exports all three (functions/13 §5). batch.dart exports canonical generated record/batch wire models and the common batch builders, which the app SDK re-exports as the same Dart types. Use ffxBatchOperation.check for a read-only version guard. Its BatchCheckResult confirms the guarded ID and version. A create result carries the newly assigned ID in BatchCreateResult.record.id. Include BatchCheckOperation and BatchCheckResult in exhaustive switches over their respective sealed types. Batch operations

Local data's engines live in four small libraries the app SDK's device store and the emulator share, kept out of the main library so their names stay the caller's choice. cel.dart is the FFX-CEL engine (parseCel, runCel, evaluateCel) and celFieldsRead, which says which fields of record or newRecord a rule reads. rules.dart adds evaluateRule(rule, principal, record, {request, program, operation}) over plain maps: a RuleAllow, a RuleDeny with its reason (signed out, never allowed, or this record) and the rule's message, or RuleUndecided when the device cannot decide. Pass the operation: an owner create is then allowed for anyone signed in, every create denial is categorical (FFX answers 403), and a get, list, update or delete without the stored record is undecided when the rule reads it. query.dart matches, compares and sorts plain-map rows as the database does (queryMatches, compareQueryValues, sortQueryRows), with bindQueryClauses adding the owner clause. ids.dart makes record ids on the device (newRecordId, the <model>_<ULID> shape with a first character 0–7) and recognises them (isClientRecordId). test/fixtures/cel_vectors.json runs through this engine and the platform's rules-engine with the same expected outcome. recordExists maps to FFXRecordExistsError, whose userMessage is This item already exists., as in the TypeScript client; a rule's ruleMessage is the refusal's userMessage unless it is blank. needsConnectionError, localDataFullError and localDataUnavailableError build the device-side problems, whose userMessage is plain copy.

For an admin runTransaction, look up the created record's ID by a unique key after commit. In Functions, at most eight transaction reads and other broker calls are in flight; a ninth concurrent call waits for one to answer. A batch carries at most 100 checks; a 101st is 413 batchTooLarge. Admin transactions

dynamic_links.dart (also in the main library) exports the Dynamic Links values (specs/34 §4, §11): FFXDynamicLink (a resolved link and its router location, the path with its query keys sorted), FFXLinkCampaign (the five UTM fields), the short-code rules (isShortCode, shortCodeOfPath, the alphabet and reserved codes), linkLocation, locationOfAppSchemeUri (an "Open in app" URL read back as a route) and the build define names FFX_LINK_DOMAIN and FFX_LINK_SCHEME. The app SDK and the emulator share them; the shared golden table dynamic-links/test/fixtures/link-url-parity.json holds them to @flutterflow/dynamic-links. The errors map the four dynamicLinks* problem codes, with end-user copy, and carry FFXDynamicLinksNotConfiguredError, thrown before anything is sent by a build with no link host. function_values.dart exports strict bounded JSON parsing/encoding and function value-schema validation. encodeFunctionJson writes exactly the bytes the TypeScript encodeFunctionJson (JSON.stringify) writes for the same value: numbers by functionJsonNumber (an integral double below 1e21 without .0, negative zero as 0), and an object's array-index keys first in ascending order. The shared encodeCases goldens in schema/test/fixtures/functions-wire.json pin both encoders. Public function strings count Unicode scalars; validation against the generated TypeBox tables explicitly selects UTF-16 bounds to match TypeBox. A nullable type list accepts null before any enum is checked. The shared valueCases in schema/test/fixtures/functions-wire.json run through this validator and the independent TypeScript validateFunctionValue with the same expected outcome. function_contracts.dart validates standalone definitions against the generated TypeBox table, then semantic bounds, grants and paths. It returns recursively immutable canonical definitions; findings include a JSON pointer and fix. A definition's kind is callable, http or scheduled (functions/02 §4). Any other kind, and a nested trigger/event/eventType/subscription key, is rejected as an unsupported delivery at its exact pointer before the structural check, matching the config compiler's functionKindUnsupported (functions/02 §1); a schedule or delivery key on a callable or HTTP function is rejected at that key as the scheduled kind's own. A scheduled definition has no auth and capabilities.data: none (the closed table admits nothing else), and its schedule.cron must parse under parseFunctionCron (function_schedule.dart, exported by this library): the five-field grammar and @ macros of the TypeScript schedule engine (schema/src/functions/schedule.ts), checked for syntax and field ranges only, with the engine's messages, reported at /functions/<name>/schedule/cron. schedule.timeZone is checked by spelling alone (the table's pattern). The TypeScript config compiler is the authority on whether the zone exists in the platform's zone database, whether the schedule ever fires and whether its instants keep the platform's minimum interval (functionScheduleTimeZoneInvalid, functionScheduleNeverFires, functionScheduleTooFrequent); nothing in Dart computes an instant, so a definition this validator accepts can still fail ffx-functions check on those three findings. Config parsing explicitly selects a larger bounded nesting limit than callable values. Remote schemas are never resolved. JSON object validation checks actual string keys, including maps with dynamic Dart type arguments; it does not invoke custom toJson methods or coerce non-string keys.

The separate generator.dart library owns the project generator and its runGenerator CLI implementation, which emits the app's models, methods, options and typed callable function clients and never reads .ffx/functions.json: function handlers are TypeScript, written against the types ffx-functions generates (functions/02 §5). Only callable functions have an app binding: functions.g.dart exists whenever the config declares functions, and HTTP and scheduled functions contribute no model or method to it, since nothing in an app invokes them through the SDK. The app SDK re-exports this library and retains dart run flutterflow_cloud:generate. Canonical formatting uses the shared SDK language floor (Dart 3.11), 80 columns and automatic trailing commas with the selected pinned formatter. Destination package maps, analysis options and whether output directories already exist do not change those formatting inputs; --check still compares exact generated bytes. Only this explicit tooling library uses local filesystem/process APIs; runtime libraries do not import it. Generation requires an explicit functions map, including {} when disabled; it never defaults a missing section. Generation requires no analyzer or dependency resolution. The shared CLI reads project and options inputs only as bounded regular files through confined, non-link project ancestors; optional Pubspec prefix reads use the same boundary. Limits are 9 MiB for project config, 64 KiB for options and 2 MiB for Pubspec. Optional dangling links and special files reject instead of being skipped. Generated app paths reject links before writing or drift inspection. An explicit --out selects local output authority, with descendants still confined. Parser and formatter diagnostics never include source excerpts, option values or raw exceptions. These checks prevent pre-existing local path escapes; they are not an atomic hostile-filesystem boundary.

Dependencies and consumers

Runtime dependencies are Dart SDK libraries only. Codegen owns the contract schema table; the app project generator re-exports its generator. The app SDK depends on it. The emulator checks the request shapes of the internal API it serves an attached local Functions host with its validateFunctionSchema. The Dart Admin SDK re-exports ffxBatchOperation, FFXBatchOperationBuilder, BatchOperation, BatchCreateOperation, BatchUpdateOperation, BatchDeleteOperation and BatchCheckOperation. It also re-exports FFXFieldValue, FFXErrorCode, FFXFieldError, FFXRetry, FFXValidationError, FFXSignInProvider and FFXFileStatus. App Preview and the native app builder bundle its sources with the app SDK and include both packages in compilation identity.

Verification and contracts

Resolve the backend pub workspace with the pinned Flutter SDK. Run dart analyze --fatal-infos and dart test in this directory. The consuming SDK suites also exercise these exact types and the shared adversarial function wire fixtures. See Dart SDK and Functions API.

Libraries

batch
Canonical batch wire models and builders of the app SDK.
cel
FFX-CEL alone (05 §3): the parser, the evaluator and celFieldsRead, the same engine the emulator runs, without the rule decisions of rules.dart.
Dynamic Links values shared by flutterflow_cloud and its emulator (specs/34): FFXDynamicLink, FFXLinkCampaign, and the short-code, location and define rules of the link host.
flutterflow_cloud_core
Pure Dart values and typed API errors of the app SDK.
function_contracts
Local project contract validation shared by generation and emulation.
function_values
Strict bounded JSON codecs and validators for function contracts.
generator
The FlutterFlow Cloud project generator, as a library.
ids
Record ids (04 §2.2): ULIDs, model prefixes and the client-made record id grammar (newRecordId, isClientRecordId), shared by the app SDK and the emulator.
query
Named-query predicate and order over plain maps (04 §3.5): the where operators, the owner clause and FFX's index order, shared by the app SDK (local data, 5.5–5.6) and the emulator.
rules
Access rules over plain maps (05 §2): FFX-CEL and the four rule kinds' decisions (evaluateRule, Principal), shared by the app SDK's device checks (local data, 5.13) and the emulator.