InteractiveController<T> class
abstract
A unified base controller for managing interactive entities T.
Combines:
- Transaction Management: Undo/Redo/Merge via TransactionMixin.
- CRUD Operations: Add/Remove/Update via CRUDMixin.
- Interaction Management: Selection, Hover, Long Press via InteractionMixin.
- Drag Management: Drag operations via DragMixin.
- Logic Delegation: Uses EntityLogic for type-specific operations.
- Inheritance
-
- Object
- ChangeNotifier
- InteractiveController
- Mixed-in types
-
- TransactionMixin<
T> - CRUDMixin<
T> - InteractionMixin<
T> - DragMixin<
T>
- TransactionMixin<
- Implementers
Constructors
Properties
- activeItem → T?
-
no setter
- activeKey → Key?
-
no setterinherited
-
activeKeys
→ Set<
Key> -
Interaction state sets.
finalinherited
-
activeKeysView
→ Set<
Key> -
no setterinherited
- canRedo → bool
-
Whether redo is available.
no setterinherited
- canUndo → bool
-
Whether undo is available.
no setterinherited
-
current
→ List<
T> -
no setter
-
events
→ Stream<
InteractiveEvent< T> > -
Stream of all interactive events.
no setter
- hasActive → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasHovered → bool
-
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasUnsavedChanges → bool
-
no setter
-
history
→ HistoryManager<
T> -
Must be implemented by the using class to provide access to the history manager.
no setteroverride
- hoveredKey → Key?
-
no setterinherited
-
hoveredKeys
→ Set<
Key> -
finalinherited
-
hoveredKeysView
→ Set<
Key> -
no setterinherited
-
internalCurrent
→ List<
T> -
no setter
-
internalInitial
→ List<
T> -
no setter
-
internalSaved
→ List<
T> -
no setter
- isEditing → bool
-
no setter
-
logic
↔ EntityLogic<
T> -
Must be implemented to provide type-specific logic.
latefinaloverride-getter
- longPressedItem → T?
-
no setter
-
longPressedKeys
→ Set<
Key> -
finalinherited
-
longPressedKeysView
→ Set<
Key> -
no setterinherited
-
onActiveCallback
→ ValueChanged<
T> ? -
no setteroverride
-
onAddedCallback
→ ValueChanged<
T> ? -
Callbacks for CRUD operations (optional).
no setteroverride
-
onHoverCallback
→ ValueChanged<
T> ? -
no setteroverride
-
onLongPressCallback
→ ValueChanged<
T> ? -
no setteroverride
-
onRemovedCallback
→ ValueChanged<
T> ? -
no setteroverride
-
onTapCallback
→ ValueChanged<
T> ? -
Callbacks for interactions (optional).
no setteroverride
-
onUpdatedCallback
→ ValueChanged<
T> ? -
no setteroverride
-
options
→ InteractiveOptions<
T> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
spatialIndex
→ SpatialIndex<
T> -
Spatial index for fast range queries.
final
-
transientKeys
→ Set<
Key> -
finalinherited
-
transientState
→ ValueListenable<
TransientState< T> ?> -
Exposes transient state as a listenable.
no setterinherited
-
transientStateNotifier
→ ValueNotifier<
TransientState< T> ?> -
Transient state for drag operations.
finalinherited
- version → int
-
no setter
Methods
-
abort(
) → void -
Abort all changes and reverts to the initial state.
override
-
add(
T item, {bool notify = true}) → void -
Adds an item to the collection.
override
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
calculateDelta(
{required List< T> oldState, required List<T> newState, required Object keySelector(T), required bool hasSpatialChange(T, T)}) → EntityDelta<T> -
Gets the delta between old and new states.
inherited
-
clearHover(
[T? item]) → void -
override
-
clearLongPress(
[T? item]) → void -
inherited
-
deselect(
[T? item]) → void -
override
-
discard(
) → void -
Discards all changes and reverts to the saved state.
override
-
dispose(
) → void -
Discards any resources used by the object.
override
-
disposeDrag(
) → void -
inherited
-
emitEvent(
dynamic itemOrEvent) → void -
Emits an event based on the provided item or context.
This is called by mixins to emit type-safe events.
override
-
endDrag(
) → void -
Ends the drag operation and commits the change.
inherited
-
ensureIndexFresh(
) → void - Ensures spatial index is up-to-date before querying. Call this before any spatial operations.
-
exitEditMode(
) → void -
findByKey(
Key key) → T? -
Finds an item by key.
override
-
hover(
T item) → void -
override
-
isActive(
T item) → bool -
inherited
-
isActiveKey(
Key? key) → bool -
inherited
-
isHovered(
T item) → bool -
inherited
-
isHoveredKey(
Key? key) → bool -
inherited
-
isLongPressed(
T item) → bool -
inherited
-
isLongPressedKey(
Key? key) → bool -
inherited
-
isTransient(
T item) → bool -
Checks if an item is in transient state.
inherited
-
isTransientKey(
Key? key) → bool -
Checks if a key is in transient state.
inherited
-
longPress(
T item) → void -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Must be implemented to notify listeners.
inherited
-
perform(
Op< T> op, {bool merge = false, bool notify = true}) → void -
performOp(
Op< T> op, {bool merge = false}) → void -
Must be implemented to perform operations.
override
-
redo(
) → void -
Redo the previously undone operation.
override
-
refreshInteractionReferences(
Set< Key> currentKeys) → void -
inherited
-
remove(
Key key, {VoidCallback? onBeforeRemove}) → void -
Removes an item by key.
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
save(
{bool erase = false}) → void -
Saves the current state.
override
-
scheduleAutoSave(
) → void -
select(
T item) → void -
override
-
setCallbacks(
{ValueChanged< T> ? onAdded, ValueChanged<T> ? onRemoved, ValueChanged<T> ? onUpdated, ValueChanged<EntityDelta< ? onSaved, ValueChanged<T> >T> ? onTap, ValueChanged<T> ? onActive, ValueChanged<T> ? onHover, ValueChanged<T> ? onLongPress}) → void -
setEditMode(
bool enable) → void -
setEditModeCallback(
ValueChanged< bool> ? callback) → void -
setItems(
List< T> items, {required bool resetHistory}) → void -
Sets the entire collection.
override
-
setOptions(
InteractiveOptions< T> options) → void - Updates the controller configuration options.
-
startDrag(
T item, LatLng origin) → void -
Starts a drag operation.
inherited
-
startEditMode(
) → void -
tap(
T item) → void -
override
-
toggleEditMode(
) → void -
toggleSelect(
T item) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → void -
Undo the last operation.
override
-
update(
Key key, T newItem, {bool merge = false}) → void -
Updates an item.
override
-
updateDrag(
LatLng current) → void -
Updates the current drag position.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited