TemplateGenerator class
Template generator for creating Flutter Clean Architecture code templates.
The TemplateGenerator class is responsible for generating all code templates based on the user's configuration preferences. It handles different state management patterns, naming conventions, and code generation styles.
Example usage:
final config = await ConfigModel.load();
final generator = TemplateGenerator(config);
final modelCode = generator.generateModel('User');
Constructors
- TemplateGenerator.new(ConfigModel config)
- Creates a new TemplateGenerator with the specified configuration.
Properties
- config → ConfigModel
-
The configuration model controlling code generation behavior.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
generateBinding(
String name) → String -
generateBlocBinding(
String name) → String -
generateBlocController(
String name) → String -
generateBlocEvent(
String name) → String -
generateBlocPage(
String name) → String -
generateBlocState(
String name) → String -
generateController(
String name) → String -
generateDataSource(
String name) → String -
generateEntity(
String name) → String - Generates a domain entity class following Clean Architecture principles.
-
generateModel(
String name) → String - Generates a data model class with optional Freezed/Equatable integration.
-
generatePage(
String name) → String -
generateRepositoryImplementation(
String name) → String -
generateRepositoryInterface(
String name) → String -
generateUseCase(
String name) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCamelCase(
String text) → String - Converts a string to camelCase naming convention.
-
toPascalCase(
String text) → String - Converts a string to PascalCase naming convention.
-
toSnakeCase(
String text) → String - Converts a string to snake_case naming convention.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited