ConfigManager class

Manages switching between test and live AppConfig instances.

Call setup once (e.g. in main()) before using currentConfig.

ConfigManager.setup(
  testConfig: AppConfig(apiKey: '...', ...),
  liveConfig: AppConfig(apiKey: '...', ...),
);
ConfigManager.setEnvironment(Environment.live);
PaymobFlutter.instance.initializeWithConfig(...ConfigManager.currentConfig);

Constructors

ConfigManager()

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 Properties

currentConfig AppConfig
Returns the AppConfig for the active environment.
no setter
currentEnvironment Environment
The active environment.
no setter
isLive bool
no setter
isTest bool
no setter

Static Methods

setEnvironment(Environment environment) → void
Switch environments at runtime.
setup({required AppConfig testConfig, required AppConfig liveConfig, Environment initialEnvironment = Environment.test}) → void
Register the test and live configs. Must be called before currentConfig.