ids library
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.
Functions
-
isClientRecordId(
String model, String id) → bool -
Whether
idis a record id a client may send formodel(its config name, or its snake_case prefix) on create or batch create: exactly^<model_snake>_[0-7][0-9A-HJKMNP-TV-Z]{25}$(04 §2.2), the platform'sisClientRecordId. Lowercase, a wrong prefix, another length or a first character past7are refused. -
newRecordId(
String model, {DateTime? now, Random? random}) → String -
A new record id for
model(its config name, or its snake_case prefix):<model_snake>_<ulid>, in the grammar isClientRecordId accepts, minted on this device (local data, 3.1, 5.9). -
newUlid(
{DateTime? now, Random? random}) → String -
A ULID: 10 Crockford base32 characters of epoch milliseconds, then 16 of
randomness (80 bits).
nowdefaults to the clock andrandomtoRandom.secure(); both are for tests. Throws RangeError for a time before 1970 or past the ULID range, so the first character is always0–7. -
toSnakeCase(
String name) → String -
taskList→task_list: the record id prefix of a model, exactly as the platform derives it (toSnakeCasein@flutterflow/schemaids.ts), soapiURLisapi_url. Already snake_case input comes back unchanged.