EnvUtils class

Utility class for .env file operations.

Constructors

EnvUtils()

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 Methods

escapeEnvValue(String value) String
Escapes a value for use in a .env file. Wraps in double quotes if value contains spaces, #, =, or newlines.
fromSnakeCase(String snakeCase) String
Converts UPPER_SNAKE_CASE to camelCase. e.g. BASE_URL -> baseUrl, DEBUG_MODE -> debugMode
generateEnvContent(Map<String, dynamic> values, Map<String, String> fields) String
Generates .env file content from flavor values and field type definitions. Keys are UPPER_SNAKE_CASE; values are properly escaped.
inferType(String value) String
Infers Dart type from a raw string value. Returns 'bool', 'int', 'double', or 'String'.
parseEnvFile(String content) Map<String, String>
Parses .env file content into a Map<String, String>. Handles:
toSnakeCase(String camelCase) String
Converts camelCase to UPPER_SNAKE_CASE. e.g. baseUrl -> BASE_URL, debugMode -> DEBUG_MODE