Flutter SDK — Overview
The truconsent_consent_notice_flutter package provides Flutter widgets for consent banners and the Rights Center. All API calls are made directly from the device.
How it works
Section titled “How it works”Two separate base URLs are involved:
| Purpose | URL | Used for |
|---|---|---|
| SDK runtime | https://trukit-dev.truconsent.io | TruConsentModal and NativeRightCenter at runtime |
| Management API | Your management API base URL | Fetching assetId and bannerId during setup |
Installation
Section titled “Installation”Add the package to your pubspec.yaml:
dependencies: truconsent_consent_notice_flutter: ^1.0.0Then run:
flutter pub getConfiguration
Section titled “Configuration”The SDK is configured via the TruConsentConfig class:
import 'package:truconsent_consent_notice_flutter/truconsent_consent_notice_flutter.dart';
final config = TruConsentConfig( apiKey: 'your-consent-scope-key', organizationId: 'your-organization-id', assetId: 'your-asset-id', apiBaseUrl: 'https://trukit-dev.truconsent.io',);| Field | Type | Description |
|---|---|---|
apiKey | String | Consent-scope API key from Step 1. |
organizationId | String | Your org ID from Step 1. |
assetId | String | Asset UUID from Step 2. |
apiBaseUrl | String | Defaults to https://trukit-dev.truconsent.io. |
Setup steps
Section titled “Setup steps”-
Get API key and org ID — Generate credentials from the platform dashboard.
-
Fetch asset ID — Discover your
assetIdvia the Management API. -
Fetch collection point details — Discover your
bannerIdvia the Management API. -
Integrate consent banner — Mount
TruConsentModalwith Android/iOS platform setup. -
Integrate Rights Center — Mount
NativeRightCenterto handle DPDPA data subject rights.