Skip to content

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.

Two separate base URLs are involved:

PurposeURLUsed for
SDK runtimehttps://trukit-dev.truconsent.ioTruConsentModal and NativeRightCenter at runtime
Management APIYour management API base URLFetching assetId and bannerId during setup

Add the package to your pubspec.yaml:

dependencies:
truconsent_consent_notice_flutter: ^1.0.0

Then run:

Terminal window
flutter pub get

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',
);
FieldTypeDescription
apiKeyStringConsent-scope API key from Step 1.
organizationIdStringYour org ID from Step 1.
assetIdStringAsset UUID from Step 2.
apiBaseUrlStringDefaults to https://trukit-dev.truconsent.io.
  1. Get API key and org ID — Generate credentials from the platform dashboard.

  2. Fetch asset ID — Discover your assetId via the Management API.

  3. Fetch collection point details — Discover your bannerId via the Management API.

  4. Integrate consent banner — Mount TruConsentModal with Android/iOS platform setup.

  5. Integrate Rights Center — Mount NativeRightCenter to handle DPDPA data subject rights.