TextBoxController class
The TextBoxController is responsible for managing text boxes on each PDF page. It handles actions like adding, removing, selecting, resizing, and updating text boxes.
- Inheritance
-
- Object
- ChangeNotifier
- TextBoxController
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addTextBox(
) → TextBox? - Adds a new text box on the current page and records the action in history.
-
adjustPages(
int pageIndex, {bool isAdd = true}) → Future< void> - Adjusts the page data when a page is added or removed.
-
clear(
) → void - Clears all content (text boxes, history, undo stack) for the current page.
-
clearAllPages(
) → dynamic - Clears all pages' content (text boxes, history, undo stack).
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getAllTextBoxes(
) → Map< int, List< TextBox> > -
getTextBoxes(
) → List< TextBox> -
hasClearContent(
) → bool - Checks if there is any content (history or undo stack) for the current page.
-
hasContent(
{bool isRedo = false}) → bool - Checks if there is any content in history or text boxes for the current page.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
redo(
) → void - Performs redo by reapplying the last undone action.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeTextBox(
TextBox textBox) → void - Removes a text box from the current page and records the action in history.
-
resizeTextBox(
TextBox textBox, Offset delta) → void - Resizes a text box based on the delta values and ensures the width/height do not shrink below a threshold.
-
selectTextBox(
Offset tapPosition) → void - Selects a text box based on the tap position and triggers a UI update if selected.
-
setPage(
int page) → void - Sets the current page for the controller and initializes the necessary data structures.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → void - Performs undo by removing the last action from history and applying the reverse action.
-
updateTextBox(
TextBox textBox, String newText, double newFontSize, Color newColor) → void - Updates the properties of a text box (text, font size, color).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited