FakeBifoldPlatform class
A BifoldPlatform whose fold state and capabilities a test drives by hand.
BifoldScope.fake covers a fixed state, and pumping a new one covers a
transition. This covers what neither can: the stream itself — ordering,
late arrivals, a capability resolving after the first frame.
final platform = FakeBifoldPlatform();
BifoldPlatform.instance = platform;
addTearDown(platform.dispose);
await tester.pumpWidget(const BifoldScope(child: MyApp()));
platform.emit(FoldInfoFakes.partiallyOpen(viewSize: size));
await tester.pump();
- Inheritance
-
- Object
- PlatformInterface
- BifoldPlatform
- FakeBifoldPlatform
Constructors
- FakeBifoldPlatform({FoldInfo initial = FoldInfo.unsupported, BifoldCapabilities capabilities = BifoldCapabilities.unresolved})
-
Creates a fake platform reporting
initialuntil told otherwise.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
capabilitiesStream(
) → Stream< BifoldCapabilities> -
Emits capabilities as they are established.
override
-
debugDescribeNativeApi(
) → Future< String?> -
Describes the fold APIs the running OS exposes.
override
-
dispose(
) → Future< void> -
Closes both streams. Call from
addTearDown. -
emit(
FoldInfo info) → void - Pushes a new fold state to every listener.
-
emitCapabilities(
BifoldCapabilities capabilities) → void - Pushes new capabilities to every listener.
-
foldInfoStream(
) → Stream< FoldInfo> -
Emits the fold state whenever it changes.
override
-
getCapabilities(
) → Future< BifoldCapabilities> -
Reads what this device can do, once.
override
-
getFoldInfo(
) → Future< FoldInfo> -
Reads the current fold state once.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited