MREImageCallbackPaste class
Gives each pasted image to onImagePasted and shows nothing.
Use it when you decide what to do with the image: upload it, send it, or draw it yourself.
- Inheritance
-
- Object
- MREImagePasteBehavior
- MREImageCallbackPaste
Constructors
-
MREImageCallbackPaste({required ValueChanged<
MREPastedImage> onImagePasted, int maxBytes = mreDefaultMaxImageBytes, List<String> allowedMimeTypes = mreDefaultImageMimeTypes, void onImageRejected(MREImageRejection reason, MREPastedImage? image)?, MREClipboardImageReader reader = const MREPasteboardImageReader()}) -
Creates the behaviour.
onImagePastedis required.const
Properties
- acceptsImages → bool
-
Whether the field listens for images at all.
no setteroverride
-
allowedMimeTypes
→ List<
String> -
The image types accepted, such as
image/png.finalinherited - attachments → MREAttachmentsConfig?
-
How the field keeps and shows images, or null to keep none.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxBytes → int
-
The largest image accepted, in bytes.
finalinherited
-
onImagePasted
→ ValueChanged<
MREPastedImage> ? -
Called with each accepted image.
finalinherited
- onImageRejected → void Function(MREImageRejection reason, MREPastedImage? image)?
-
Called with the reason when an image is not accepted.
finalinherited
- reader → MREClipboardImageReader
-
Reads images from the clipboard.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
MREPastedImage image, {required int count}) → MREImageRejection? -
Returns why
imageis not accepted, or null when it is.inherited -
imageFromBytes(
Uint8List bytes, String mimeType) → MREPastedImage -
Makes an image from bytes that arrived with a
mimeType, for example from a keyboard. The bytes decide the type when they are recognized.inherited -
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