utils/functions library
Utility functions for handling YAML, string manipulation, file operations, and system environment.
Functions
-
camelCase(
String value) → String - Converts a string to camelCase.
-
capitalize(
String value) → String - Capitalizes the first letter of a string.
-
generateEssentials(
File pubspecFile, CliConfig cliConfig) → void - Generates a new app id (as UUID) for the app, if not already present. The new id is persisted in the pubspec.yaml file.
-
getHomeDir(
) → String - Retrieves the user's home directory path.
-
getInnoSetupExec(
{bool throwIfNotFound = true}) → File? - Locates the Inno Setup executable file, ensuring its proper installation.
-
getSystemUserName(
) → String - Get the logged in username in the machine.
-
getWingetExec(
) → Future< String> - Checks if Winget is installed on the system, and returns the path to the executable.
-
installInnoSetup(
) → Future< void> - Installs Inno Setup into your system if not already installed with Winget.
-
persistDefaultInstallerIcon(
String dirPath) → String - Persists the default installer icon to a file in the given directory.
-
readPubspec(
File pubspecFile) → Map< String, dynamic> -
Reads the
pubspecFile
and returns a map of its contents. ThepubspecFile
is passed as a File object instead of being hardcoded because in the future, we may support reading multiple files for configuration. -
yamlToList(
YamlList yamlList) → List -
Convert yaml list to list, this prevents some weird behaviors that come with
YamlList
type. -
yamlToMap(
YamlMap yamlMap) → Map< String, dynamic> -
Convert yaml to map, this prevents some weird behaviors that come with
YamlMap
type.