I can't seem to access publisherConsents in the return. I can print it but I can't access it? Any ideas? I'm using the demo code.
I'd like to create a wrapper that takes a widget, checks for consent and decides whether the it can load.
import 'package:flutter/material.dart';
import 'package:iabtcf_consent_info/iabtcf_consent_info.dart';
class ConsentGate extends StatefulWidget {
const ConsentGate({Key? key, required this.child}) : super(key: key);
final Widget child;
@override
State<ConsentGate> createState() => _ConsentGateState();
}
class _ConsentGateState extends State<ConsentGate> {
BasicConsentInfo? consentInfo;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
consentInfo = await _getConsentInfo();
});
super.initState();
}
Future<BasicConsentInfo?> _getConsentInfo() async {
BasicConsentInfo? consent =
await IabtcfConsentInfo.instance.currentConsentInfo();
setState(() {
consentInfo = consent;
});
return consent;
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Text(consentInfo.toString());
}
}
I'd like to have a conditional check in the build but I can't access the data. I can see the data being printed but I'm unsure how to access it.

I can't seem to access
publisherConsentsin the return. I can print it but I can't access it? Any ideas? I'm using the demo code.I'd like to create a wrapper that takes a widget, checks for consent and decides whether the it can load.
I'd like to have a conditional check in the
buildbut I can't access the data. I can see the data being printed but I'm unsure how to access it.