gdpr_dialog_flutter 1.0.2 copy "gdpr_dialog_flutter: ^1.0.2" to clipboard
gdpr_dialog_flutter: ^1.0.2 copied to clipboard

Library for use GDPR dialog from user for personalized ads and non personalized ads.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String status = 'none';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              ElevatedButton(
                child: Text('Show dialog'),
                onPressed: () {
                  GdprDialogFlutter.instance.resetDecision();
                  GdprDialogFlutter.instance
                      .showDialog(
                          isForTest: true,
                          testDeviceId: '5C442443C9D17BA56185F8FC6EBD37DB')
                      .then((onValue) {
                    setState(() => status = 'dialog result == $onValue');
                  });
                },
              ),
              ElevatedButton(
                child: Text('Get consent status'),
                onPressed: () => GdprDialogFlutter.instance
                    .getConsentStatus()
                    .then((value) =>
                        setState(() => status = 'consent status == $value')),
              ),
              Container(height: 50),
              Text(status),
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
160
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

Library for use GDPR dialog from user for personalized ads and non personalized ads.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on gdpr_dialog_flutter