pub struct SliverReorderableList {Show 14 fields
pub key: Option<KeyRef>,
pub item_builder: IndexedWidgetBuilder,
pub find_child_index_callback: Option<ChildIndexGetter>,
pub item_count: i32,
pub on_reorder: Option<ReorderCallback>,
pub on_reorder_item: Option<ReorderCallback>,
pub on_reorder_start: Option<ReorderIndexCallback>,
pub on_reorder_end: Option<ReorderIndexCallback>,
pub proxy_decorator: Option<ReorderItemProxyDecorator>,
pub item_extent: Option<f64>,
pub item_extent_builder: Option<ItemExtentBuilder>,
pub prototype_item: Option<WidgetRef>,
pub auto_scroller_velocity_scalar: f64,
pub drag_boundary_provider: Option<ReorderDragBoundaryProvider>,
}Expand description
A sliver list that allows the user to interactively reorder the list items.
It is up to the application to wrap each child (or an internal part of the child) with a
drag listener that will recognize the start of an item drag and then start the reorder by
calling SliverReorderableListState::start_item_drag_reorder. This is most easily
achieved by wrapping each child in a ReorderableDragStartListener or a
ReorderableDelayedDragStartListener. These will take care of recognizing the start of a
drag gesture and call the list state’s start item drag method.
This widget’s SliverReorderableListState can be used to manually start an item reorder,
or cancel a current drag that’s already underway. To refer to the
SliverReorderableListState either provide a GlobalKey or use the static
SliverReorderableList::of method from an item’s build method.
See also:
ReorderableList, a regular widget list that allows the user to reorder its items.ReorderableListView, a Material Design list that allows the user to reorder its items.
Fields§
§key: Option<KeyRef>§item_builder: IndexedWidgetBuilderCalled, as needed, to build list item widgets; see ReorderableList::item_builder.
find_child_index_callback: Option<ChildIndexGetter>Called to find the new index of a child based on its key in case of reordering.
item_count: i32The number of items in the list; see ReorderableList::item_count.
on_reorder: Option<ReorderCallback>See ReorderableList::on_reorder. Deprecated: use
on_reorder_item.
on_reorder_item: Option<ReorderCallback>§on_reorder_start: Option<ReorderIndexCallback>§on_reorder_end: Option<ReorderIndexCallback>§proxy_decorator: Option<ReorderItemProxyDecorator>§item_extent: Option<f64>§item_extent_builder: Option<ItemExtentBuilder>§prototype_item: Option<WidgetRef>§auto_scroller_velocity_scalar: f64The velocity scalar per pixel over scroll of the auto scroller.
Defaults to 50 if not set or set to None.
drag_boundary_provider: Option<ReorderDragBoundaryProvider>Implementations§
Source§impl SliverReorderableList
impl SliverReorderableList
Sourcepub fn new(
item_builder: impl Fn(&mut App, BuildContext, i32) -> WidgetRef + 'static,
item_count: i32,
) -> SliverReorderableList
pub fn new( item_builder: impl Fn(&mut App, BuildContext, i32) -> WidgetRef + 'static, item_count: i32, ) -> SliverReorderableList
Creates a sliver list that allows the user to interactively reorder its items.
The item_count must be greater than or equal to zero.
Sourcepub fn from_builder(
item_builder: IndexedWidgetBuilder,
item_count: i32,
) -> SliverReorderableList
pub fn from_builder( item_builder: IndexedWidgetBuilder, item_count: i32, ) -> SliverReorderableList
new from a shared builder, which ReorderableList passes on.
Sourcepub fn key(self, key: KeyRef) -> SliverReorderableList
pub fn key(self, key: KeyRef) -> SliverReorderableList
Dart SliverReorderableList(key:).
Sourcepub fn find_child_index_callback(
self,
find_child_index_callback: impl Fn(&KeyRef) -> Option<i32> + 'static,
) -> SliverReorderableList
pub fn find_child_index_callback( self, find_child_index_callback: impl Fn(&KeyRef) -> Option<i32> + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(findChildIndexCallback:).
Sourcepub fn on_reorder(
self,
on_reorder: impl Fn(&mut App, i32, i32) + 'static,
) -> SliverReorderableList
👎Deprecated: Use the on_reorder_item callback instead. The on_reorder_item callback adjusts the new_index parameter for a removed item at the old_index.
pub fn on_reorder( self, on_reorder: impl Fn(&mut App, i32, i32) + 'static, ) -> SliverReorderableList
Use the on_reorder_item callback instead. The on_reorder_item callback adjusts the new_index parameter for a removed item at the old_index.
Dart SliverReorderableList(onReorder:).
Sourcepub fn on_reorder_item(
self,
on_reorder_item: impl Fn(&mut App, i32, i32) + 'static,
) -> SliverReorderableList
pub fn on_reorder_item( self, on_reorder_item: impl Fn(&mut App, i32, i32) + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(onReorderItem:).
Sourcepub fn on_reorder_start(
self,
on_reorder_start: impl Fn(&mut App, i32) + 'static,
) -> SliverReorderableList
pub fn on_reorder_start( self, on_reorder_start: impl Fn(&mut App, i32) + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(onReorderStart:).
Sourcepub fn on_reorder_end(
self,
on_reorder_end: impl Fn(&mut App, i32) + 'static,
) -> SliverReorderableList
pub fn on_reorder_end( self, on_reorder_end: impl Fn(&mut App, i32) + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(onReorderEnd:).
Sourcepub fn item_extent(self, item_extent: f64) -> SliverReorderableList
pub fn item_extent(self, item_extent: f64) -> SliverReorderableList
Dart SliverReorderableList(itemExtent:).
Sourcepub fn item_extent_builder(
self,
item_extent_builder: ItemExtentBuilder,
) -> SliverReorderableList
pub fn item_extent_builder( self, item_extent_builder: ItemExtentBuilder, ) -> SliverReorderableList
Dart SliverReorderableList(itemExtentBuilder:).
Sourcepub fn prototype_item<K>(
self,
prototype_item: impl IntoWidget<K>,
) -> SliverReorderableList
pub fn prototype_item<K>( self, prototype_item: impl IntoWidget<K>, ) -> SliverReorderableList
Dart SliverReorderableList(prototypeItem:).
Sourcepub fn proxy_decorator(
self,
proxy_decorator: impl Fn(&mut App, WidgetRef, i32, AnimationRef<f64>) -> WidgetRef + 'static,
) -> SliverReorderableList
pub fn proxy_decorator( self, proxy_decorator: impl Fn(&mut App, WidgetRef, i32, AnimationRef<f64>) -> WidgetRef + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(proxyDecorator:).
Sourcepub fn drag_boundary_provider(
self,
drag_boundary_provider: impl Fn(&mut App, BuildContext) -> Option<Box<dyn DragBoundaryDelegate<Rect>>> + 'static,
) -> SliverReorderableList
pub fn drag_boundary_provider( self, drag_boundary_provider: impl Fn(&mut App, BuildContext) -> Option<Box<dyn DragBoundaryDelegate<Rect>>> + 'static, ) -> SliverReorderableList
Dart SliverReorderableList(dragBoundaryProvider:).
Sourcepub fn auto_scroller_velocity_scalar(self, value: f64) -> SliverReorderableList
pub fn auto_scroller_velocity_scalar(self, value: f64) -> SliverReorderableList
Dart SliverReorderableList(autoScrollerVelocityScalar:).
Sourcepub fn of(
app: &App,
context: BuildContext,
) -> Handle<SliverReorderableListState>
pub fn of( app: &App, context: BuildContext, ) -> Handle<SliverReorderableListState>
The state from the closest instance of this class that encloses the given context.
This method is typically used by SliverReorderableList item widgets to start or
cancel an item drag operation.
If no SliverReorderableList surrounds the context given, this function will panic.
This method can be expensive (it walks the element tree).
See also:
maybe_of, a similar function that will returnNoneif noSliverReorderableListancestor is found.
Sourcepub fn maybe_of(
app: &App,
context: BuildContext,
) -> Option<Handle<SliverReorderableListState>>
pub fn maybe_of( app: &App, context: BuildContext, ) -> Option<Handle<SliverReorderableListState>>
The state from the closest instance of this class that encloses the given context.
This method is typically used by SliverReorderableList item widgets that insert or
remove items in response to user input.
If no SliverReorderableList surrounds the context given, this function will return
None.
This method can be expensive (it walks the element tree).
See also:
of, a similar function that will panic if noSliverReorderableListancestor is found.
Trait Implementations§
Source§impl Debug for SliverReorderableList
impl Debug for SliverReorderableList
Source§impl StatefulWidget for SliverReorderableList
impl StatefulWidget for SliverReorderableList
Source§type State = SliverReorderableListState
type State = SliverReorderableListState
Source§fn create_state(&self) -> SliverReorderableListState
fn create_state(&self) -> SliverReorderableListState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for SliverReorderableList
impl !Send for SliverReorderableList
impl !Sync for SliverReorderableList
impl !UnwindSafe for SliverReorderableList
impl Forget for SliverReorderableList
impl Freeze for SliverReorderableListwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, i32) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, i32) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&KeyRef) -> Option<i32>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&KeyRef) -> Option<i32>>>: Freeze,
*const RcInner<dyn Fn(&mut App, i32, i32)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, i32, i32)>>: Freeze,
*const RcInner<dyn Fn(&mut App, i32)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, i32)>>: Freeze,
*const RcInner<dyn Fn(&mut App, Rc<dyn Widget>, i32, Retained<AnyAnimation<f64>>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, Rc<dyn Widget>, i32, Retained<AnyAnimation<f64>>) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(i32, SliverLayoutDimensions) -> Option<f64>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(i32, SliverLayoutDimensions) -> Option<f64>>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement) -> Option<Box<dyn DragBoundaryDelegate<Rect>>>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Option<Box<dyn DragBoundaryDelegate<Rect>>>>>: Freeze,
impl Move for SliverReorderableList
impl Unpin for SliverReorderableListwhere
Rc<dyn Key>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, i32) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&KeyRef) -> Option<i32>>: Unpin,
Rc<dyn Fn(&mut App, i32, i32)>: Unpin,
Rc<dyn Fn(&mut App, i32)>: Unpin,
Rc<dyn Fn(&mut App, Rc<dyn Widget>, i32, Retained<AnyAnimation<f64>>) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(i32, SliverLayoutDimensions) -> Option<f64>>: Unpin,
Rc<dyn Widget>: Unpin,
Rc<dyn Fn(&mut App, AnyElement) -> Option<Box<dyn DragBoundaryDelegate<Rect>>>>: Unpin,
impl UnsafeUnpin for SliverReorderableListwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, i32) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, i32) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&KeyRef) -> Option<i32>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&KeyRef) -> Option<i32>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, i32, i32)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, i32, i32)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, i32)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, i32)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, Rc<dyn Widget>, i32, Retained<AnyAnimation<f64>>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, Rc<dyn Widget>, i32, Retained<AnyAnimation<f64>>) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(i32, SliverLayoutDimensions) -> Option<f64>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(i32, SliverLayoutDimensions) -> Option<f64>>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement) -> Option<Box<dyn DragBoundaryDelegate<Rect>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Option<Box<dyn DragBoundaryDelegate<Rect>>>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.