Incular logoIncular
API ReferenceNavigation & Scrolling

Animated & Ordered Slivers

Reorderable, animated, and tree slivers with controllers.

Reorderable

TypePurpose
SliverReorderControllerorder, move_item, reorder, set_item_count
SliverReorderableListDrag-reorderable lazy list
ReorderableListBox-view reorderable sibling
ReorderableDragStartListenerLong-press vs immediate drag handles
use incular::prelude::*;

fn main() {
    let controller = SliverReorderController::new(3);
    controller.move_item(0, 2);
    println!("order len: {}", controller.order().len());
    println!("revision: {}", controller.revision());
}

Animated

use incular::prelude::*;
use std::time::Instant;

fn main() {
    let controller = SliverAnimatedListController::new(3);
    controller.insert_at(0, Instant::now());
    println!("animating: {}", controller.is_animating());
    controller.tick(Instant::now());
    println!("ticked");
}

Tree

use incular::prelude::*;

fn main() {
    let mut node = TreeSliverNode::new(Text::new("root"));
    node.add_child(TreeSliverNode::new(Text::new("kid")));
    node.set_expanded(true);
    println!("depth: {}", node.depth());
}

TreeSliver::new(roots, builder) renders the tree (controller(), row_extent, indentation, on_node_toggle); TreeRowAnimation { value, expanding } drives row expand/collapse visuals. ReorderableDelayedDragStartListener starts drags after a long-press instead of immediately (vs ReorderableDragStartListener).

KeepAlive / AutomaticKeepAlive with KeepAliveHandle preserve offscreen state; KeepAliveRegistry tracks live handles. KeepAliveNotification::new(handle) is consumed by AutomaticKeepAlive. TreeSliverController: toggle_node / expand_node / collapse_node (each with _at(now) variants) / expand_all / collapse_all / tick(now) / is_active / active_index_for; TreeSliverNodeId(u64) is the stable identity. AnimatedItemBuilder / AnimatedRemovedItemBuilder are Rc<dyn Fn…> aliases for live and outgoing item builders.

Related: SliverList.

On this page