pub struct SliverReorderableListState { /* private fields */ }Expand description
The state for a sliver list that allows the user to interactively reorder the list items.
An app that needs to start a new item drag or cancel an existing one can refer to the
SliverReorderableList’s state with a global key, and call
list_key.current_state::<SliverReorderableListState>(app).unwrap().cancel_reorder(app).
ReorderableDragStartListener and ReorderableDelayedDragStartListener refer to their
SliverReorderableList with the static SliverReorderableList::of method.
Implementations§
Source§impl SliverReorderableListState
impl SliverReorderableListState
Sourcepub fn start_item_drag_reorder(
self: Handle<Self>,
app: &mut App,
index: i32,
event: PointerDownEvent,
recognizer: MultiDragRecognizerRef,
)
pub fn start_item_drag_reorder( self: Handle<Self>, app: &mut App, index: i32, event: PointerDownEvent, recognizer: MultiDragRecognizerRef, )
Initiate the dragging of the item at index that was started with the pointer down
event.
The given recognizer will be used to recognize and start the drag item tracking and
lead to either an item reorder, or a canceled drag.
Most applications will not use this directly, but will wrap the item (or part of the
item, like a drag handle) in either a ReorderableDragStartListener or
ReorderableDelayedDragStartListener which call this method when they detect the
gesture that triggers a drag start.
Sourcepub fn cancel_reorder(self: Handle<Self>, app: &mut App)
pub fn cancel_reorder(self: Handle<Self>, app: &mut App)
Cancel any item drag in progress.
This should be called before any major changes to the item list occur so that any item drags will not get confused by changes to the underlying list.
If a drag operation is in progress, this will immediately reset the list to back to its pre-drag state.
If no drag is active, this will do nothing.
Trait Implementations§
Source§impl State for SliverReorderableListState
impl State for SliverReorderableListState
Source§type Widget = SliverReorderableList
type Widget = SliverReorderableList
State<T> type argument.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &SliverReorderableList,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &SliverReorderableList, )
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.Source§impl TickerProviderObject for SliverReorderableListState
impl TickerProviderObject for SliverReorderableListState
Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
Source§impl TickerProviderStateMixin for SliverReorderableListState
impl TickerProviderStateMixin for SliverReorderableListState
Source§fn ticker_provider_data(
self: Handle<Self>,
app: &App,
) -> &TickerProviderStateMixinData
fn ticker_provider_data( self: Handle<Self>, app: &App, ) -> &TickerProviderStateMixinData
Source§fn ticker_provider_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TickerProviderStateMixinData
fn ticker_provider_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TickerProviderStateMixinData
ticker_provider_data.Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
TickerProviderStateMixin.debugFillProperties, which a state’s own body calls
where Dart’s mixin adds its line.Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
TickerProvider::create_ticker: creates a ticker with the given callback.