ConfigService class

Service for managing the flavor_cli configuration file (YAML).

Constructors

ConfigService()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 Properties

root String
The root directory of the project.
getter/setter pair

Static Methods

addFlavor(String flavor) bool
detectPlatforms() List<String>
Dynamically detects platforms based on directory existence in the project root.
hasFirebase() bool
General check for Firebase presence (either config or files).
hasFirebaseConfig() bool
Checks if Firebase is configured in the .flavor_cli.json file.
hasFirebaseFiles() bool
Checks if Firebase files or dependencies actually exist in the project.
isInitialized() bool
Returns true if the project has been initialized with flavor_cli.
isValidProject(AppLogger log) bool
Returns true if the current directory is a valid Flutter project root.
load([bool excludeValidation = false]) FlavorConfig
Loads the flavor configuration from the YAML file. If excludeValidation is true, the config is loaded without full validation.
loadLenient() FlavorConfig?
Loads configuration without strict validation. Useful for migration or partial reads.
removeFlavor(String flavor) → void
renameFlavor(String oldName, String newName) → void
requiresInitialized(AppLogger log) bool
Returns false and logs an error if not initialized. Use in commands to avoid duplicating the "Run init first" message.
save(FlavorConfig config) → void
Saves the flavor configuration to the YAML file.