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 loadEnvFile function to parse .env files and retrieve environment variables.

Functions

convertType<T>(String value) → T?
Converts a String value to the specified type T.
loadEnvFile(String filePath) Future<Map<String, String>>
Loads and parses a .env file to retrieve environment variables.
parseEnv(String content) Map<String, String>
Parses the .env file content into a Map<String, String>.
resolvedDefaultValue<T>(T? defaultValue) → T
Returns a default value of type T if none is provided.
resolveReferences(Map<String, String> envMap) Map<String, String>
Resolves variable references within the environment map.