setCallbacks method
Future<void>
setCallbacks({
- ConsentCallback? onOpen,
- ConsentCallback? onClose,
- ConsentCallback? onNotOpened,
- ConsentErrorCallback? onError,
- ConsentButtonClickedCallback? onButtonClicked,
override
Sets up callbacks for consent events.
Implementation
@override
Future<void> setCallbacks({
ConsentCallback? onOpen,
ConsentCallback? onClose,
ConsentCallback? onNotOpened,
ConsentErrorCallback? onError,
ConsentButtonClickedCallback? onButtonClicked,
}) async {
this.onOpen = onOpen;
this.onClose = onClose;
this.onNotOpened = onNotOpened;
this.onError = onError;
this.onButtonClicked = onButtonClicked;
// Notify native side to set up callbacks
methodChannel.setMethodCallHandler(_handleMethodCall);
await methodChannel.invokeMethod('setCallbacks');
}