ProjectGenerator class
A powerful Flutter project generator that creates production-ready apps with configurable features including Firebase, localization, Docker, and more.
Example:
final generator = ProjectGenerator(
projectName: 'my_app',
organization: 'com.example',
stateManagement: 'provider',
includeFirebase: true,
logger: logger,
);
await generator.generate();
Creates a new ProjectGenerator with the specified configuration.
Required parameters:
- projectName - The name of the Flutter project (snake_case recommended)
- organization - The organization identifier (e.g., com.example)
- stateManagement - State management solution ('provider', 'bloc', 'riverpod')
- includeFirebase - Whether to include Firebase integration
- themeColor - Primary theme color for the app
- authType - Authentication type ('email_password', 'phone_otp', 'social_auth', 'all')
- logger - Logger instance for output
Optional parameters:
- firebaseModules - List of Firebase modules to include (auth, firestore, storage, etc.)
- includeChatbot - Include AI chatbot feature
- includeDocker - Generate Docker configuration for web deployment
- selectedModules - Utility modules to include (camera, speech, recorder, call)
- enabledFeatures - Additional features to enable
- selectedLanguages - Languages for localization (defaults to
'en') - includeWeb - Enable Flutter Web support
Constructors
-
ProjectGenerator({required String projectName, required String organization, required String stateManagement, required bool includeFirebase, List<
String> firebaseModules = const [], bool includeChatbot = false, bool includeDocker = false, List<String> selectedModules = const [], List<String> enabledFeatures = const [], List<String> ? selectedLanguages, required String themeColor, required String authType, required Logger logger, bool includeWeb = false})
Properties
- authType → String
-
Authentication type ('email_password', 'username_password', 'phone_otp', 'social_auth', 'all').
final
-
enabledFeatures
→ List<
String> -
List of additional features to enable in the project.
final
-
firebaseModules
→ List<
String> -
List of Firebase modules to include (e.g., 'auth', 'firestore', 'storage').
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- includeChatbot → bool
-
Whether to include an AI chatbot feature with BLoC state management.
final
- includeDocker → bool
-
Whether to generate Docker configuration for web deployment.
final
- includeFirebase → bool
-
Whether to include Firebase integration in the project.
final
- includeWeb → bool
-
Whether to include Flutter Web support.
final
- logger → Logger
-
Logger instance for output during generation.
final
- organization → String
-
The organization identifier in reverse domain notation (e.g., com.example).
final
- projectName → String
-
The name of the Flutter project being generated.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedLanguages
→ List<
String> -
Languages to support for localization (ISO 639-1 codes).
final
-
selectedModules
→ List<
String> -
List of utility modules to include (e.g., 'camera', 'speech', 'recorder', 'call').
final
- stateManagement → String
-
The state management solution to use ('provider', 'bloc', 'riverpod').
final
- themeColor → String
-
Primary theme color for the generated app.
final
Methods
-
generate(
{VoidCallBack? onBeforeFirebase}) → Future< void> - Generates the complete Flutter project with all configured features.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
promptForModules(
Logger logger) → Future< List< String> > - Prompts the user to select utility modules to include in the project.