FileGenerator class
A utility class for generating Flutter project files and directory structures following Clean Architecture principles.
The FileGenerator class handles the creation of files, directories, and complete feature structures with proper naming conventions and templates.
Example usage:
final templateGen = TemplateGenerator();
final fileGen = FileGenerator(templateGen);
await fileGen.generateFeature('user_profile');
Constructors
- FileGenerator.new(TemplateGenerator templateGenerator)
-
Creates a new FileGenerator with the specified
templateGenerator
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- templateGenerator → TemplateGenerator
-
The template generator instance used for creating file contents.
final
Methods
-
ensureDirectoryExists(
String dirPath) → Future< void> - Ensures that the specified directory path exists, creating it if necessary.
-
generateFeature(
String name) → Future< void> - Generates a complete Clean Architecture feature structure.
-
generateModel(
String name) → Future< void> - Generates a standalone model class with optional Freezed/Equatable support.
-
generateRepository(
String name) → Future< void> - Generates repository interface and implementation following Clean Architecture.
-
generateScreen(
String name) → Future< void> - Generates a standalone screen with controller and binding.
-
generateUseCase(
String name) → Future< void> - Generates a standalone use case class following Clean Architecture principles.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeFile(
String filePath, String content) → Future< void> - Writes content to a file at the specified path.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited