setMethodCallHandler method
Implementation
Future<void> setMethodCallHandler(MethodCall call) async {
String? widgetId = call.arguments["widgetId"];
switch (call.method) {
case 'onAdClicked':
if ((widgetId ?? "").isNotEmpty &&
_widgetMapper.containsKey(widgetId)) {
_widgetMapper[widgetId]?.onAdClicked?.call();
}
break;
case 'onAdImpression':
if ((widgetId ?? "").isNotEmpty &&
_widgetMapper.containsKey(widgetId)) {
_widgetMapper[widgetId]?.onAdImpression?.call();
}
break;
}
}