command/create/templates
library
Functions
-
crudBindingTemplate(String name)
→ String
-
The Riverpod provider binding for the CRUD controller.
-
crudControllerTemplate(String name, ProjectContext ctx)
→ String
-
An
AsyncNotifier-based CRUD controller that delegates to the repository.
-
crudViewTemplate(String name, List<FieldSpec> fields, ProjectContext ctx)
→ String
-
A list view bound to the CRUD controller, with loading/error/empty states.
Uses the widget library + design tokens when those modules are installed.
-
modelsFileTemplate(List<ModelDef> models)
→ String
-
Renders one or more ModelDefs (root model plus any nested models inferred
from JSON) into a single Dart file.
-
modelTemplate(String name, List<FieldSpec> fields)
→ String
-
Code templates shared by the generators. Names are derived from a single
input via Naming; output adapts to the modules installed in ProjectContext
(e.g. the widget library and design tokens are used only when present).
An immutable data class with
fromJson / toJson / copyWith / toString,
generated from a --fields spec.
-
modelTestTemplate(String name, List<FieldSpec> fields, ProjectContext ctx)
→ String
-
A
flutter_test round-trip test asserting fromJson/toJson are inverse
for the model. Only valid for models whose fields are all primitive/list/
DateTime (the caller skips it when any field is a nested model).
-
repositoryTemplate(String name, ProjectContext ctx)
→ String
-
A repository. When the
network module is installed it extends
BaseRepository and uses the shared APIProvider; otherwise it emits a
self-contained stub with TODOs so the file still compiles.
-
widgetTemplate(String name, ProjectContext ctx)
→ String
-
A reusable widget placed in the shared widgets folder, following the library
naming style. Uses MyText/AppColors when those modules are present.