Environment class

Represents the environment configuration for the distribution process.

The Environment class loads configuration from a .env file and provides access to various settings, such as build flags, Firebase credentials, and Fastlane configuration. It also validates the environment setup.

Example usage:

final environment = Environment.fromArgResults(argResults);
if (environment.isAndroidBuild) {
  print("Android build is enabled.");
}

Constructors

Environment()
The constructor for the Environment class.

Properties

androidBinary ↔ String
The Android binary type (apk, appbundle).
getter/setter pair
androidFirebaseAppId ↔ String
The Firebase App ID for Android.
getter/setter pair
androidFirebaseGroups ↔ String
The Firebase groups for Android distribution.
getter/setter pair
androidPackageName ↔ String
The Android package name.
getter/setter pair
androidPlaystoreTrack ↔ String
The Android Play Store track for distribution (e.g., internal, alpha, beta, production).
getter/setter pair
androidPlaystoreTrackPromoteTo ↔ String
The Play Store track to promote the build to after distribution (e.g., production).
getter/setter pair
configPath ↔ String
The path to the configuration file.
getter/setter pair
distributionInitResult ↔ DistributionInitResult?
The environment variables for the distribution process.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
initialized → Future<bool>
Checks if the environment is fully initialized.
no setter
iosDistributionPassword ↔ String
The iOS distribution password.
getter/setter pair
iosDistributionUser ↔ String
The iOS distribution user.
getter/setter pair
isAndroidBuild ↔ bool
Indicates if Android builds are enabled.
getter/setter pair
isAndroidDistribute ↔ bool
Indicates if Android distribution is enabled.
getter/setter pair
isIOSBuild ↔ bool
Indicates if iOS builds are enabled.
getter/setter pair
isIOSDistribute ↔ bool
Indicates if iOS distribution is enabled.
getter/setter pair
isVerbose ↔ bool
Indicates if verbose logging is enabled.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
useFastlane ↔ bool
Indicates if Fastlane is used for distribution.
getter/setter pair
useFirebase ↔ bool
Indicates if Firebase is used for distribution.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
Returns a string representation of the environment configuration.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

examples ↔ String
Example .env configuration file content.
getter/setter pair

Static Methods

fromArgResults(ArgResults? argResults) → Environment
Creates an Environment instance from the provided argResults.
fromFile(File file) → Environment
Creates an Environment instance from the specified file.