df_generate_dart_models 0.16.2
df_generate_dart_models: ^0.16.2 copied to clipboard
A tool for generating data models and classes from annotations, offering greater flexibility than json_serializable or freezed.
Changelog #
0.16.2 #
- Released @ 6/2026 (UTC)
- Fix:
df_generate_dbmlwas built intobin/but missing from theexecutables:block, sodart pub global activatedid not install it as a CLI. Adding it (plus a--dbmlalias) makesdf_generate_dbmlavailable globally
0.16.1 #
- Released @ 6/2026 (UTC)
- New:
tableName:annotation slot — explicit override for the DBML table name; falls back to stripping theModelmarker (prefix or suffix) from the class and snake-casing. No automatic English pluralisation.ModelUser→user,HelloModel→hello,ModelModel→model - New:
schema:annotation slot acts as the DBML emission gate. Models withoutschema:are skipped (nested/embedded children drop out naturally). Distinct schema values produce one<schema>.dbmlfile each — multi-schema projects supported out of the box - New:
static const tableNameemitted on every generated class — runtime introspection without the annotation handshake (ModelUser.tableName) - New:
XxxFieldNames.$values/$primaryKey/$foreignKeys— surface declaration-order field names, the primary key, and the foreign-key → referenced-class map without reflection - New:
references:accepts aStringliteral (references: 'ModelUser') in addition to a Type literal — lets cross-package references skip the import chain - New: FK target column now resolves to the parent's actual primary-key column (e.g.
permissions.key) instead of hardcoded.id; FK target table honours the parent's explicittableName: - New: DBML emitter's
--outputis now treated as the directory for per-schema files (a*.dbmlvalue uses its parent dir — old ergonomics still work) - Fix: default template URL is now version-pinned (
v$version) — old binaries no longer pullmaintemplate changes silently. Falls back tomainonly for dev checkouts - Fix: no-pluralisation rule replaces the previous naive English heuristic that produced
activitys/contact_address/ etc. - Pulls in df_generate_dart_models_core 0.11.0
0.15.0 #
- Released @ 6/2026 (UTC)
- New:
fieldPathdual-shape — dot-separatedStringorIterable<String>; multi-segment paths emit deep null-aware accessors (json?['profile']?['id']) - New: enum detection without
Type/Enumsuffix — analyzer-driven via@enumsentinel; legacy suffix-based detection still works - New: Equatable opt-in by inheritance —
extends BaseModelopts out (const-set-safe), everything else getsEquatableMixin - New: dialect support —
PG_*,SQLITE_*,FS_*,STRICT-prefix vocabulary with composable mappers - New: DBML schema export via
df_generate_dbmlCLI — PKs, FKs, sized varchar/numeric, enums, JSONB columns - Fix:
fromOrNull/fromJsonStringOrNull/fromUriOrNulltemplates honor the null-return contract (no more silent throws on the null/empty/wrong-path input) - Fix: AI prompt no longer collapses field path segments via
join('')— uses.separator - Fix: AI generator uses safe
FieldUtilsaccessors instead of dynamic property access - Fix: top-level catch logs the actual exception, not just a generic message
- Removed: obsolete
df_generate_dart_models_gemeniexecutable - Pulls in df_gen_core 0.8.0 and df_generate_dart_models_core 0.10.0
0.14.3 #
- Released @ 12/2025 (UTC)
- Update dependencies