MockImageModelV3 class

A controllable mock image model for testing.

final model = MockImageModelV3(
  images: [Uint8List.fromList([0, 1, 2])],
);
final result = await generateImage(model: model, prompt: 'A cat');
expect(result.image.uint8Array, isNotEmpty);

Constructors

MockImageModelV3({List<Uint8List> images = const [], Object? doGenerateError, String provider = 'mock', String modelId = 'mock-image-model'})

Properties

doGenerateError Object?
If set, doGenerate throws this instead of returning images.
final
generateCalls List<ImageModelV3CallOptions>
All call options passed to doGenerate in the order they were called.
final
hashCode int
The hash code for this object.
no setterinherited
images List<Uint8List>
The image bytes to return from every call.
final
modelId String
final
provider String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
specificationVersion String
no setter

Methods

doGenerate(ImageModelV3CallOptions options) Future<ImageModelV3GenerateResult>
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