tc_mobile_flutter_plugin_mock 0.0.1
tc_mobile_flutter_plugin_mock: ^0.0.1 copied to clipboard
A test implementation of flutter plugin.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:tc_mobile_flutter_plugin/tc_mobile_flutter_plugin.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _tcMobileFlutterPlugin = TcMobileFlutterPlugin();
@override
void initState() {
super.initState();
_tcMobileFlutterPlugin.initTCConsent();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Colors.blue),
),
onPressed: () {_tcMobileFlutterPlugin.initTCConsent();},
child: Text('init TCConsent'),
),
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Colors.blue),
),
onPressed: () {_tcMobileFlutterPlugin.acceptAll();},
child: Text('Accept All Consent'),
),
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Colors.blue),
),
onPressed: () {_tcMobileFlutterPlugin.refuseAll();},
child: Text('Refuse All Consent'),
),
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Colors.blue),
),
onPressed: () {_tcMobileFlutterPlugin.showPrivacyCenter();},
child: Text('Show Privacy Center'),
),
],
),
),
),
);
}
}