tarsier_env library
This library provides tools for loading and managing environment variables
from .env files in Dart and Flutter applications. It helps developers
store configuration settings, such as API keys or database credentials,
outside the source code.
Usage:
- Import this library into your project.
- Use the
loadEnvFilefunction to parse.envfiles and retrieve environment variables.
Functions
-
convertType<
T> (String value) → T? -
Converts a
Stringvalue to the specified typeT. -
loadEnvFile(
String filePath) → Future< Map< String, String> > -
Loads and parses a
.envfile to retrieve environment variables. -
parseEnv(
String content) → Map< String, String> -
Parses the
.envfile content into aMap<String, String>. -
resolvedDefaultValue<
T> (T? defaultValue) → T -
Returns a default value of type
Tif none is provided. -
resolveReferences(
Map< String, String> envMap) → Map<String, String> - Resolves variable references within the environment map.