consentsdkgotrust 2.0.0+1
consentsdkgotrust: ^2.0.0+1 copied to clipboard
Consent Sdk from GO Trust
Getting Started #
Consent SDK GoTrust consentsdkgotrust is a Flutter plugin that provides an easy-to-use interface for integrating consent management functionality within your Flutter applications. This SDK enables developers to streamline user consent processes for legal compliance and personalized user experiences.
Features Consent Management: Collect and manage user consents effectively. Cross-Platform Support: Works seamlessly on both iOS and Android. Customizable UI: Design the consent flow to align with your app’s branding. Lightweight and Efficient: Ensures minimal impact on app performance. Installation Add the following dependency to your pubspec.yaml file:
yaml Copy code dependencies: consentsdkgotrust: ^1.0.1+4 Then, run the following command:
bash Copy code flutter pub get Usage Import the Package dart Copy code import 'package:consentsdkgotrust/consentsdkgotrust.dart'; Initialize the SDK Initialize the SDK before using it, typically in your app's main() function: import 'package:flutter/material.dart'; import 'package:consentsdkgotrust/consentsdkgotrust.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( initialRoute: '/', routes: { '/': (context) => const ConsentFormScreen("2901", "parvesh@appvintech.com"), '/prefcenter': (context) => const SubjectIdentityLoginScreen( cid: "29", pfid: "3", sVal: "parvesh@appvintech.com", ), }, debugShowCheckedModeBanner: false, ); } }
class ConsentFormScreen extends StatelessWidget { final String id; final String email;
const ConsentFormScreen(this.id, this.email, {Key? key}) : super(key: key);
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Consent Form')), body: Center( child: ElevatedButton( onPressed: () { Navigator.pushNamed(context, '/prefcenter'); }, child: const Text('Go to Preference Center'), ), ), ); } }
class SubjectIdentityLoginScreen extends StatelessWidget { final String cid; final String pfid; final String sVal;
const SubjectIdentityLoginScreen({ required this.cid, required this.pfid, required this.sVal, Key? key, }) : super(key: key);
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Preference Center')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('CID: $cid'), Text('PFID: $pfid'), Text('Email: $sVal'), ], ), ), ); } }
Platform Support Platform Support Android ✅ iOS ✅ License This package is licensed under the MIT License.
Contributing Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests on the GitHub repository.
Support For any issues or questions, please contact support@example.com.