moveTo method
Moves this item to section and/or index.
Dispatches to the controller as follows:
• section != null, index != null
→ SectionedListController.moveItem with both args
• section != null, index == null
→ SectionedListController.moveItem (appends to section)
• section == null, index != null
→ SectionedListController.moveItemInSection
• section == null, index == null
→ no-op
No animate parameter: the underlying TreeController.moveNode /
TreeController.reorderChildren are repositioning ops — nothing
animates. Matches the controller-level signatures.
Implementation
void moveTo({K? section, int? index}) {
if (section != null) {
controller.moveItem(key, toSection: section, index: index);
} else if (index != null) {
controller.moveItemInSection(key, index);
}
// both null → no-op.
}