MockBannerController class
A test double for BannerController, with no MethodChannel involved.
Extends BannerController rather than merely implementing BannerApi so
this can be substituted into BannerPlacement.controller directly — that
parameter is typed as the concrete BannerController, not BannerApi
(see the doc comment there for why: attach/detach are internal
plumbing the widget calls that aren't part of BannerApi). attach and
detach are inherited as-is; they only set/clear an internal channel
reference and are harmless without a live channel. toggleDarkMode is
overridden to record calls instead of buffering/invoking a channel, so
the "no MethodChannel involved" claim stays literally true — this mock
never buffers a call the way the real controller does while unattached.
- Inheritance
-
- Object
- BannerController
- MockBannerController
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastDarkMode ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toggleDarkModeCallCount ↔ int
-
getter/setter pair
Methods
-
attach(
int viewId) → void -
Wires this controller to its now-created platform view. Called by
BannerPlacement once the view id is known.
inherited
-
detach(
) → void -
Releases the platform-view channel. Called by BannerPlacement
whenever it stops owning this controller's current attachment: on
dispose()(the widget instance is gone for good) and when swapped out indidUpdateWidget(a different controller takes over the live view). Further calls buffer again rather than throwing — a caller-supplied controller can still be reused for a LATER widget instance the caller constructs, which re-attaches it explicitly, but that is the caller's doing, not this widget silently keeping a dead attachment alive.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toggleDarkMode(
bool darkMode) → Future< void> -
Toggles dark mode on an already-loaded banner.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited