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 id is a record id a client may send for model (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's isClientRecordId. Lowercase, a wrong prefix, another length or a first character past 7 are 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). now defaults to the clock and random to Random.secure(); both are for tests. Throws RangeError for a time before 1970 or past the ULID range, so the first character is always 0–7.
toSnakeCase(String name) → String
taskList → task_list: the record id prefix of a model, exactly as the platform derives it (toSnakeCase in @flutterflow/schema ids.ts), so apiURL is api_url. Already snake_case input comes back unchanged.