MREAttachmentsController class
The images attached to a field.
Pass one to MREImageAttachmentPaste to read or change the images from your code. Without one, the field keeps its own.
// Create the controller in initState and dispose it in dispose.
final field = MRETextField(
labelText: 'Message',
imagePaste: MREImageAttachmentPaste(controller: controller),
);
// Later: controller.images, controller.removeAt(0), controller.clear().
Dispose a controller you create.
- Inheritance
-
- Object
- ChangeNotifier
- MREAttachmentsController
Constructors
-
MREAttachmentsController({Iterable<
MREPastedImage> images = const []}) -
Creates a controller, optionally with some
imagesto start with.
Properties
- count → int
-
How many images are attached.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
images
→ List<
MREPastedImage> -
The attached images, in order.
no setter
- isEmpty → bool
-
Whether no image is attached.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
MREPastedImage image) → void -
Attaches
imageafter the others. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Removes every image.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeAt(
int index) → void -
Removes the image at
index. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
replaceAt(
int index, MREPastedImage image) → void -
Replaces the image at
indexwithimage. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited