DefaultEnvironmentConfig class
Default implementation of EnvironmentConfig
Use this for simple cases where you just need basic configuration.
Example:
final config = DefaultEnvironmentConfig(
environment: Environment.production,
baseUrl: 'https://api.example.com',
headers: {'X-API-Key': 'xxx'},
);
KeystoneNetwork.initialize(
baseUrl: config.baseUrl,
connectTimeout: config.connectTimeout,
headers: config.headers,
);
- Implemented types
Constructors
-
DefaultEnvironmentConfig({required Environment environment, required String baseUrl, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, Map<
String, dynamic> ? headers, bool? enableLogging}) -
const
Properties
- baseUrl → String
-
Base URL for API requests
final
- connectTimeout → Duration
-
Connection timeout duration
no setteroverride
- enableLogging → bool
-
Enable debug logging
no setteroverride
- environment → Environment
-
Current environment
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, dynamic> -
Default headers for all requests
no setteroverride
- receiveTimeout → Duration
-
Response receive timeout duration
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTimeout → Duration
-
Request send timeout duration
no setteroverride
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