AddStreamVideoWidget class

A widget that displays a VAST video advertisement.

Fetches a VAST XML response from the AddStream network and plays the video creative, firing all standard IAB tracking events automatically.

Requires AddStreamGlobal.initialize to be called before use.

Example:

AddStreamVideoWidget(
  zoneId: 'your-zone-id',
  autoPlay: true,
  onAdClosed: () => print('Ad closed'),
)
Inheritance

Constructors

AddStreamVideoWidget({Key? key, required String zoneId, VoidCallback? onAdLoaded, VoidCallback? onVideoReady, dynamic onAdFailed(Object error)?, VoidCallback? onAdClosed, dynamic onTrackingEvent(String eventType)?, Widget? loadingWidget, Widget? errorWidget, EdgeInsetsGeometry? margin, double borderRadius = 8.0})
Creates an AddStream video ad widget.
const

Properties

borderRadius → double
The border radius of the video ad container in logical pixels.
final
errorWidget → Widget?
A custom widget to display when the video ad fails to load.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingWidget → Widget?
A custom widget to display while the video ad is loading.
final
margin → EdgeInsetsGeometry?
The margin around the video ad widget.
final
onAdClosed → VoidCallback?
Called when the user dismisses the video ad via the close button.
final
onAdFailed → dynamic Function(Object error)?
Called when the video ad fails to load or initialize.
final
onAdLoaded → VoidCallback?
Called when the video ad is successfully loaded and ready to play.
final
onTrackingEvent → dynamic Function(String eventType)?
Called whenever an IAB VAST tracking event fires.
final
onVideoReady → VoidCallback?
Called when the first video frame is actually rendered on screen.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
zoneId → String
The zone ID for the video ad placement.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<AddStreamVideoWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited