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, fixed-size SizedBox in its place 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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MockFeedPlacement
Constructors
-
MockFeedPlacement({Key? key, required FeedPlacementConfig config, double? maxHeight, void onEvent(TeadsAdEvent event, Map<
String, dynamic> ? data)?, void onUnsupported(TeadsAdError error)?, void onFullScreenChange(bool fullScreen)?, void onOrganicClick(Uri organicUrl)?}) -
const
Properties
- config → FeedPlacementConfig
-
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