ConfigService class
Methods
addInitialAssetEntries ()
→ Future <void >
Registers the default client's env file as a Flutter asset so the app
can load it when no CLIENT_ENV is passed.
appendBuildHistory ({required String client , required String platform , required String type , required String ? version , required bool success , required Duration duration , String ? errorMessage , String ? artifactPath })
→ Future <void >
Appends a build record to the project-local history file, keeping only
the most recent _maxHistoryEntries. Newest entries are stored first.
backedUpFiles ()
→ List <String >
Project-relative paths of every file currently backed up.
clearBackups ()
→ Future <void >
clearBuildHistory ()
→ Future <bool >
Deletes the build history file. Returns true if a file was removed.
copyToRootEnv (File sourceEnv , {bool trackForCleanup = true })
→ Future <File >
Copies a client env file to the root .env for the Flutter build.
createBackup (File file )
→ Future <File >
Creates a backup of a file under .udara/backups. Returns the backup.
ensureGitignoreEntries (List <String > entries )
→ Future <void >
Appends entries to the project's .gitignore when they are not already
present. Creates the file if needed.
getPubspecVersion ()
→ Future <String >
hasBackup (File file )
→ bool
Whether a backup exists for file.
keptClient ()
→ String ?
The client a whitelabel --keep left the project branded as, if any.
loadBuildHistory ()
→ Future <List <Map <String , dynamic > > >
Loads recorded build history, newest first. Returns an empty list if
no history file exists yet.
markCreated (File file )
→ Future <void >
Records that the CLI created file from scratch, so cleanup can remove
it instead of restoring a backup.
markKept (String client )
→ Future <void >
whitelabel --keep leaves its backups in place instead of restoring
them, and records the client here. The next run (or clean) restores
the project from them before doing anything else.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseEnvFile (File envFile )
→ Future <Map <String , String > >
Parses an environment file into a Map.
removeCreatedFiles ()
→ Future <void >
Removes every file recorded via markCreated and clears the markers.
restoreBackup (File originalFile )
→ Future <void >
Restores a file from its backup and deletes the backup. No-op when no
backup exists.
restoreNativeBranding ()
→ Future <void >
Makes every snapshotted folder match its snapshot again: restores
overwritten and deleted files, removes files the run created, and
removes folders that didn't exist before the run.
snapshotDirectories (List <String > rels )
→ Future <void >
Snapshots each folder whole. A folder that doesn't exist yet is
recorded as absent, so restoring removes it if the run created it.
Folders already snapshotted in this run keep their first snapshot.
snapshotFonts ()
→ Future <void >
Snapshots fontsDir (or records that it doesn't exist yet).
snapshotNativeBranding ()
→ Future <void >
Backs up (or records as new) every native branding file and snapshots
the branding folders, so restoreNativeBranding can undo the
bundle id, app name, icon, splash and hook changes of a build.
stageNativeEnv (File envFile , File ? secretsFile , {bool trackForCleanup = true })
→ Future <File >
Generated app config: writes the root .env for native build tooling
(e.g. Gradle reading signing passwords) as the client's .env plus its
.secrets. It is never registered as an app asset, so nothing in it
ships; it is backed up / removed on cleanup like copyToRootEnv .
toString ()
→ String
A string representation of this object.
inherited
updateDevelopmentTeam ({required String teamId })
→ void
Rewrites every DEVELOPMENT_TEAM entry in the iOS project file.
updatePubspecAssets ({required String clientAssetPath , bool keepDefaultEnv = true })
→ Future <void >
Rewrites the flutter.assets list in pubspec.yaml so that exactly one
branding folder (the active client's) and the runtime env file are
registered. The default client's fallback env entry is preserved.
updatePubspecFonts (List fontList )
→ Future <void >
updateYamlValue (File yamlFile , List <Object > path , Object newValue )
→ Future <void >
Safely updates a value in a YAML file using YamlEditor.
Preserves comments and formatting.
Constants
defaultClientEnvAsset
→ const String
The env file the app loads at runtime when nothing is passed via
--dart-define=CLIENT_ENV. Registered as an asset by setup.
fontsDir
→ const String
The active client's fonts are copied here; snapshotted by every run
that applies client fonts so the previous fonts come back exactly.
historyFileName
→ const String
nativeBrandingDirs
→ const List <String >
Folders the icon and splash generators create, overwrite and delete
files in, so they are snapshotted whole.
nativeBrandingFiles
→ const List <String >
Files the branding steps and common hooks rewrite or create.
First line of a root .env staged for native builds; lets clean
recognise it as udara_cli's.