MockFeedPlacement class

A test double for FeedPlacement, with no real WebView/platform view involved — entirely standalone; FeedPlacement itself is untouched.

Mirrors FeedPlacement's public constructor and callbacks exactly (see FeedPlacementBuilder), so it renders a plain SizedBox in its place, empty until a simulated fill as the real widget is, and lets a test fire FeedPlacement's callbacks synchronously via MockFeedPlacementState, reached through a GlobalKey:

final key = GlobalKey<MockFeedPlacementState>();
await tester.pumpWidget(MockFeedPlacement(key: key, config: someConfig));
key.currentState!.fireOrganicClick(Uri.parse('https://example.com'));

This only helps test YOUR OWN code that reacts to Feed's callbacks — it says nothing about Feed's real WebView/bridge behaviour, which stays integration/device-test territory.

Inheritance

Constructors

MockFeedPlacement({Key? key, required FeedPlacementConfig config, double? maxHeight, double contentBottomPadding = 0, void onEvent(TeadsAdEvent event, Map<String, dynamic>? data)?, void onUnsupported(TeadsAdError error)?, void onFullScreenChange(bool fullScreen)?, void onOrganicClick(Uri organicUrl)?, FeedPlacementController? controller})
const

Properties

config → FeedPlacementConfig
final
contentBottomPadding → double
final
controller → FeedPlacementController?
Accepted for constructor parity with FeedPlacement.controller. The mock never calls into it; pass a MockFeedPlacementController to see what your code calls.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxHeight → double?
final
onEvent → void Function(TeadsAdEvent event, Map<String, dynamic>? data)?
final
onFullScreenChange → void Function(bool fullScreen)?
final
onOrganicClick → void Function(Uri organicUrl)?
final
onUnsupported → void Function(TeadsAdError error)?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<MockFeedPlacement>
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

Constants

filledHeight → const double
The height the mock takes once MockFeedPlacementState.fireEvent has delivered fill, before contentBottomPadding and maxHeight: a stand-in for the content height a real feed would report.