ImClipboard class final
Reads and writes images through the operating system clipboard.
All images crossing the Dart boundary are PNG encoded. Clipboard reads distinguish an unsupported platform from a supported but currently empty clipboard through ClipboardReadResult.supported.
Constructors
- ImClipboard()
-
Creates an image clipboard client.
const
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
-
isSupported(
) → Future< bool> - Whether this platform provides an image clipboard implementation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readFiles(
) → Future< ClipboardReadResult< List< >String> > - Reads existing absolute file paths advertised by the clipboard.
-
readImage(
) → Future< ClipboardReadResult< ClipboardImage> > - Reads the first image on the clipboard as PNG.
-
readImageInfo(
) → Future< ClipboardReadResult< ClipboardImageInfo> > - Reads image dimensions without transferring PNG bytes over native channels.
-
toString(
) → String -
A string representation of this object.
inherited
-
writeEncodedImage(
Uint8List encodedBytes, {ClipboardImageFormat? format, String? token}) → Future< bool> -
Replaces the clipboard with an image encoded in any supported
format. -
writeGeneratedPng(
Uint8List pngBytes, {String? token}) → Future< bool> - Copies PNG bytes produced by the application's own encoder.
-
writeImage(
Uint8List pngBytes, {String? token}) → Future< bool> -
Replaces the clipboard with
pngBytes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- maxDecodedPixels → const int
- Largest image decoded while transcoding to PNG.
- maxEncodedBytes → const int
- Largest encoded image accepted by the plugin.