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

NameDescription
apiBaseUrlRequired. Base URL without a trailing slash.
apiVersionRequired. Appended to the base URL (requests go to apiBaseUrl/apiVersion) and sent as X-API-Version.
endpointsAPI paths. Defaults to const VoApiEndpoints() — see Endpoints below.
connectTimeoutMsConnection timeout. Default 30000.
receiveTimeoutMsReceive timeout. Default 30000.
apiUserAgentFull User-Agent override. Default null.
clientVersionBuild label used in the default User-Agent. Ignored when apiUserAgent is set.
tenantIdSent as X-Tenant-Id when non-empty.
orgIdSent as X-Org-Id when non-empty.
firebaseConfigFirebase options per platform. Null disables Firebase and push notifications.
enableDpopAttach RFC 9449 DPoP proofs. Default true.
interceptorHooksExtra 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()],
);
NameDescription
beforeAuthRuns after the built-in headers and logging, before the access token and DPoP proof are added. Use it for extra headers.
afterAuthRuns 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.