BaseAd

Base class for all ad controls in Flet Ads package.

Platform Support

  • Raises FletUnsupportedPlatformException on web and non-mobile platforms.
  • Properties

  • request: AdRequest - Targeting information for fetching an Ad. Defaults to AdRequest().
  • unit_id: str - Ad unit ID for this ad.
  • Events

  • on_click: ControlEventHandler | None - Called when the ad is clicked.
  • on_close: ControlEventHandler | None - Called when the full-screen view is closed. Use to restart paused interactions.
  • on_error: ControlEventHandler | None - Called when an ad request fails. Event data contains error information.
  • on_impression: ControlEventHandler | None - Called when an impression occurs on this ad.
  • on_load: ControlEventHandler | None - Called when the ad is loaded successfully.
  • on_open: ControlEventHandler | None - Called when the ad opens a full-screen view/overlay. Use to pause time-sensitive interactions.