BoardController class

A modern controller for the BoardView widget that extends ChangeNotifier and provides a clean API for controlling board state and animations.

Inheritance

Constructors

BoardController.new()

Properties

currentListIndex int
Gets the current visible list index based on scroll position
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAnimating bool
Whether the controller is currently animating
no setter
isAttached bool
Whether the controller is attached to a scrollable widget
no setter
isScrolling bool
Whether the board is currently scrolling
no setter
isSelecting bool
Whether the board is in selection mode
no setter
itemWidth double
The width of each board item/list
getter/setter pair
maxScrollExtent double
Gets the maximum scroll extent
no setter
minScrollExtent double
Gets the minimum scroll extent
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPosition double
The current scroll position of the board
no setter
selectedItems List<BoardItemSelection>
The currently selected items
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
animateToList(int listIndex, {Duration duration = const Duration(milliseconds: 400), Curve curve = Curves.ease}) Future<void>
Animates to a specific list index
animateToOffset(double offset, {Duration duration = const Duration(milliseconds: 400), Curve curve = Curves.ease}) Future<void>
Scrolls to a specific pixel offset
attachScrollController(ScrollController controller) → void
Attaches the scroll controller
clearSelection() → void
Clears all selected items
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).
override
jumpToList(int listIndex) → void
Scrolls to a specific list index instantly
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyDragCancel(int listIndex, int itemIndex) → void
Notifies about drag cancel
notifyDragEnd(int fromListIndex, int fromItemIndex, int toListIndex, int toItemIndex) → void
Notifies about drag end
notifyDragStart(int listIndex, int itemIndex) → void
Notifies about drag start
notifyLayoutChange(Size boardSize) → void
Notifies about layout change
notifyListeners() → void
Call all the registered listeners.
inherited
notifyListReorder(int fromIndex, int toIndex) → void
Notifies about list reorder
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setCallbacks(BoardCallbacks? callbacks) → void
Sets the callbacks for state changes
setSelectionMode(bool selecting) → void
Enables or disables selection mode
toggleItemSelection(int listIndex, int itemIndex, Widget item) → void
Selects or deselects an item
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited