adBadgeConfiguration property

AdBadgeConfiguration? get adBadgeConfiguration

The configuration for ad badges.

Implementation

AdBadgeConfiguration? get adBadgeConfiguration => _adBadgeConfiguration;
set adBadgeConfiguration (AdBadgeConfiguration? adBadgeConfiguration)

Implementation

set adBadgeConfiguration(AdBadgeConfiguration? adBadgeConfiguration) {
  final valueHasChanged = _adBadgeConfiguration?.badgeTextType !=
          adBadgeConfiguration?.badgeTextType ||
      _adBadgeConfiguration?.backgroundColor !=
          adBadgeConfiguration?.backgroundColor ||
      _adBadgeConfiguration?.textColor != adBadgeConfiguration?.textColor;

  _adBadgeConfiguration = adBadgeConfiguration;

  final nativeMethodName =
      FireworkSDKNativeMethodName.setAdBadgeConfiguration.name;
  Map<String, dynamic> arg = {};
  if (adBadgeConfiguration != null) {
    arg = AdBadgeConfigurationUtil.toJson(adBadgeConfiguration);
  }
  FWMethodChannelUtil.getFirewokSDKChannel()
      .invokeMethod(nativeMethodName, arg)
      .then((_) {
    if (valueHasChanged) {
      FWEventBus.getInstance().fire(
        FWEvent(
          eventName: FWEventName.adBadgeConfigurationUpdated,
        ),
      );
    }
  });
}