FakeXCameraEffectsBackend class

In-memory backend for camera-effect tests. Swap in via XCameraEffectsBackend.instance = FakeXCameraEffectsBackend() before any effect code runs; restore with XCameraEffectsBackend.instance = MethodChannelXCameraEffectsBackend() in tearDown.

Records every call and answers with scripted results: set the …Error fields to drive a consumer's failure paths, and assign status to play the phases it reacts to.

Implemented types

Constructors

FakeXCameraEffectsBackend({bool supported = true, bool availableResult = true})
Creates a fake that starts out supported, available and idle.

Properties

availableError ↔ XCameraEffectsException?
If non-null, thrown by available.
getter/setter pair
availableResult ↔ bool
Result of available.
getter/setter pair
calls → List<FakeCameraEffectsCall>
Every call, in order, with the arguments it was given.
final
clearError ↔ XCameraEffectsException?
If non-null, thrown by clear.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setEffectError ↔ XCameraEffectsException?
If non-null, thrown by setEffect.
getter/setter pair
status → ValueEmitter<XCameraEffectStatus>
What a consumer observes; assign to it to drive the phases.
final
supported ↔ bool
Whether this platform family has a native processor. Elsewhere every method throws XCameraEffectsException with code unsupported.
getter/setter pairoverride-getter

Methods

available() → Future<bool>
Whether this host can effect frames — the OS version, the GPU profile and the installed bridge as well as the platform family.
override
clear() → Future<void>
Returns the effected track to its own frames, leaving status idle.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setEffect(String trackId, XCameraEffect effect) → Future<void>
Applies effect to the local video track trackId, releasing whichever track was effected before.
override
toString() → String
A string representation of this object.
inherited

Operators

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