FakeMonolensPlatform class
An in-memory MonolensPlatform.
Records what it was asked to do and answers from files, so a test asserts on the request — the crop rectangle in pixels, the trim range in milliseconds — rather than on bytes it would have to decode.
- Implemented types
Constructors
- FakeMonolensPlatform({Duration exportDuration = Duration.zero})
Properties
-
cancellations
→ List<
String> -
final
- defaultInfo ↔ MediaInfo Function(String path)
-
What an unregistered path probes as.
getter/setter pair
- exportDuration ↔ Duration
-
How long a fake export takes. Zero completes on the next microtask; a
non-zero value gives a test room to cancel mid-flight.
getter/setter pair
-
files
→ Map<
String, MediaInfo> -
Canned probe answers, keyed by path. Unknown paths get defaultInfo.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
imageEdits
→ List<
ImageEditRequest> -
final
- nextImageEditError ↔ Object?
-
When set, the next call of the matching kind throws this instead.
getter/setter pair
- nextTrimError ↔ Object?
-
getter/setter pair
-
probes
→ List<
String> -
final
-
progress
→ Stream<
TrimProgress> -
Export progress for every in-flight job, keyed by job id. Broadcast, so
several concurrent exports can each be observed.
no setteroverride
-
progressTicks
↔ List<
double> -
Progress values emitted during an export, before it completes.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
trims
→ List<
VideoTrimRequest> -
final
Methods
-
cacheDirectory(
) → Future< String> -
The app's cache directory — where exports are written.
override
-
cancel(
String jobId) → Future< void> -
Asks the platform to abandon
jobId. The matching trimVideo future completes with amonolens/cancelledPlatformException.override -
dispose(
) → void -
editImage(
ImageEditRequest request) → Future< MediaInfo> -
override
-
install(
) → void - Installs this as the platform and restores the default on teardown.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
probe(
String path) → Future< MediaInfo> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
trimVideo(
VideoTrimRequest request, String jobId) → Future< MediaInfo> -
Exports the trimmed range. Progress for
jobIdarrives on progress while this is in flight.override -
videoThumbnails(
String path, List< int> atMs, int maxDimension) → Future<List< Uint8List> > -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
uninstall(
) → void