iabtcf_consent_info 3.1.0 copy "iabtcf_consent_info: ^3.1.0" to clipboard
iabtcf_consent_info: ^3.1.0 copied to clipboard

Flutter plugin for reading IAB TCF v2.0 user consent information, such as made available through CMP SDKs, like Funding Choices's User Messaging Platform (UMP).

example/lib/main.dart

// ignore_for_file: public_member_api_docs

import 'package:flutter/material.dart';
import 'package:iabtcf_consent_info/iabtcf_consent_info.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'IABTCF Consent Info Example',
      home: IabtcfConsentInfoViewer(),
    );
  }
}

class IabtcfConsentInfoViewer extends StatefulWidget {
  @override
  _IabtcfConsentInfoViewerState createState() =>
      _IabtcfConsentInfoViewerState();
}

class _IabtcfConsentInfoViewerState extends State<IabtcfConsentInfoViewer> {
  late Stream<BasicConsentInfo?> consentInfoStream;

  @override
  void initState() {
    consentInfoStream = IabtcfConsentInfo.instance.consentInfo();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('IABTCF Consent Info Example'),
      ),
      body: StreamBuilder<BasicConsentInfo?>(
        stream: consentInfoStream,
        builder: (context, snapshot) => Center(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Text(
              snapshot.hasData
                  ? snapshot.data.toString()
                  : snapshot.hasError
                      ? 'Error: ${snapshot.error}'
                      : 'Loading...',
            ),
          ),
        ),
      ),
    );
  }
}
9
likes
140
pub points
88%
popularity

Publisher

verified publishergabriel.terwesten.net

Flutter plugin for reading IAB TCF v2.0 user consent information, such as made available through CMP SDKs, like Funding Choices's User Messaging Platform (UMP).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, iabtcf_consent_info_platform_interface, iabtcf_consent_info_web, meta, rxdart

More

Packages that depend on iabtcf_consent_info