-
-
Notifications
You must be signed in to change notification settings - Fork 591
FAQ
The CustomSlidableAction
and SlidableAction
widgets have an autoClose
constructor parameter with a default value to true
.
If you don't want your action to be closed automatically, set the autoClose
value to false
.
By default, a Slidable
closes when the nearest Scrollable
widget starts to scroll. To prevent this, you can pass in false
to its closeOnScroll
constructor parameter.
By default, a Slidable
is not dismissible. To be dismissed, you have to set a DismissiblePane
to the dismissible
constructor parameter of any ActionPane
:
Slidable(
// A key is mandatory when using a dismissible.
key: ValueKey(item),
// You can choose how which action panes respond to dismiss.
startActionPane: ActionPane(
// A pane can dismiss the Slidable.
dismissible: DismissiblePane(onDismissed: () {}),
)
),
Just set the dismissible
to the action pane you want to be dismissed and not to the other.
You can set the confirmDismiss
callback of the dismissal to show a dialog letting the user deciding if they want to confirm the action.
You will have to set the same groupTag
value to all the Slidable
s that share the same group and add a SlidableAutoCloseBehavior
above your Slidable
s.
In the snippet below, the first two Slidable
s have the same group, so only one of them can be open, while the last Slidable
is independent of the others.
SlidableAutoCloseBehavior(
child: ListView(
children: [
Slidable(
groupTag: '0',
),
Slidable(
groupTag: '0',
),
Slidable(
groupTag: '1',
),
],
),
)
You can get a SlidableController
inside the child of the Slidable
. This controller can be used to open the enclosing Slidable
programmatically for example by calling openEndActionPane()
or openStartActionPane()
.