Hey there in order to open one tile at a time using the flutter_slidable package. You need to use the same Slidable controller for all tiles. From your code, it seems like you are instantiating new Slidable controllers for each tile. What you should do is to instantiate the SlidableController from the parent widget and pass it on to the tile widget.
This is the parent widget
...
String title = 'Customers';
final SlidableController slidableController = SlidableController();
@override
Widget build(BuildContext context) {
return ScaffoldBody(
centerTitle: true,
title: title,
drawer: CustomerScreen.isOrderAdding == true ? null : AppDrawer(),
body: FutureBuilder(
future: _refreshCustomers(context),
builder: (ctx, snapshot) =>
snapshot.connectionState == ConnectionState.waiting
? Center(
child: Center(
child: Image(
image: AssetImage('assets/img/LoadingCartoon.gif'),
),
),
)
: RefreshIndicator(
onRefresh: () => _refreshCustomers(context),
child: Consumer<CustomerHttps>(
builder: (ctx, customerData, _) => Padding(
padding: EdgeInsets.all(5),
child: ListView.builder(
itemCount: customerData.items.length,
itemBuilder: (_, i) => CustomerTile(
slidableController: slidableController,
id: customerData.items[i].id,
name: customerData.items[i].name,
),
),
),
),
),
),
);
In my slidable Tile widget (child widget)
final String id;
final String name;
final SlidableController slidableController;
CustomerTile({
this.id,
this.name,
this.slidableController,
});
Widget build(BuildContext context) {
return CustomerScreen.isOrderAdding
? Container(
padding: EdgeInsets.only(bottom: 9),
child: Material(
elevation: 5,
borderRadius: BorderRadius.all(Radius.circular(10)),
color: Colors.white,
child: InkWell(
borderRadius: BorderRadius.all(Radius.circular(10)),
splashColor: Theme.of(context).primaryColor,
onTap: () {
//clears any products and signature saved after selecting a new customer
var provider =
Provider.of<AddingProductOrder>(context, listen: false);
provider.clear();
Navigator.of(context).pushNamed(
EditOrderScreen.routeName,
arguments: [id, 'selection'],
);
},
child: Container(
width: double.infinity,
child: ListTile(
title: Text(name,
style: TextStyle(color: Colors.black),
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: false),
leading: Icon(
Icons.person,
color: Theme.of(context).primaryColor,
),
),
),
),
),
)
: Slidable(
key: Key(id),
actionPane: SlidableDrawerActionPane(),
controller: slidableController,
actionExtentRatio: 0.25,
child: Container(...