CustomActionPane function

ActionPane CustomActionPane({
  1. required String name,
  2. required Function onDelete,
})

Implementation

ActionPane CustomActionPane({required String name, required Function onDelete}) {
  return ActionPane(
    motion: const ScrollMotion(),
    children: [
      SlidableAction(
        flex: 1,
        onPressed: (_) {
          onDelete();
        },
        backgroundColor: Colors.red,
        foregroundColor: Colors.white,
        icon: Icons.delete,
        label: name,
        // label: S.of(context).delete,
      ),
    ],
  );
}