Flutter · colveor
Configuration
colveor's VoConfig extends the colveor_ui config, so one object configures both layers.
VoConfig
app_config.dart
Dart
import 'package:colveor/config.dart';
class AppConfig extends VoConfig {
@override
String get appName => 'My App';
@override
String get apiBaseUrl => 'https://api.myapp.com';
@override
String get apiVersion => 'api/v1';
@override
VoRoutingConfig get routing =>
const VoRoutingConfig(initialLocation: AppPaths.splash);
@override
VoFirebaseConfig get firebaseConfig => DefaultFirebaseOptions();
}Everything from the colveor_ui config (appName, environment, routing, feedback, phone-input defaults) is inherited.
Reference
| Name | Description |
|---|---|
apiBaseUrl | Required. Base URL without a trailing slash. |
apiVersion | Required. Appended to the base URL (requests go to apiBaseUrl/apiVersion) and sent as X-API-Version. |
endpoints | API paths. Defaults to const VoApiEndpoints() — see Endpoints below. |
connectTimeoutMs | Connection timeout. Default 30000. |
receiveTimeoutMs | Receive timeout. Default 30000. |
apiUserAgent | Full User-Agent override. Default null. |
clientVersion | Build label used in the default User-Agent. Ignored when apiUserAgent is set. |
tenantId | Sent as X-Tenant-Id when non-empty. |
orgId | Sent as X-Org-Id when non-empty. |
firebaseConfig | Firebase options per platform. Null disables Firebase and push notifications. |
enableDpop | Attach RFC 9449 DPoP proofs. Default true. |
interceptorHooks | Extra Dio interceptors. Default const VoInterceptorHooks(). |
VoFirebaseConfig
Return per-platform FirebaseOptions, typically from the FlutterFire-generated DefaultFirebaseOptions. androidOptions and iosOptions are required; webOptions, macosOptions, windowsOptions and linuxOptions default to null.
VoInterceptorHooks
Dart
@override
VoInterceptorHooks get interceptorHooks => VoInterceptorHooks(
beforeAuth: [AnalyticsHeaderInterceptor()],
afterAuth: [SignedRequestLogger()],
);| Name | Description |
|---|---|
beforeAuth | Runs after the built-in headers and logging, before the access token and DPoP proof are added. Use it for extra headers. |
afterAuth | Runs after auth and DPoP, so it sees the final signed request. |
Endpoints
VoApiEndpoints holds every path the package calls. Extend it and override a getter to change a path. See Backend Integration for the defaults.
Not exported yet
VoApiEndpoints is not exported from a public entry file in the current release. Import it from package:colveor/src/core/network/vo_api_endpoints.dart.