flutter_slidable icon indicating copy to clipboard operation
flutter_slidable copied to clipboard

Same actions width

Open erperejildo opened this issue 4 years ago • 5 comments

How can I have a specific width for the actions? Right now the spaces is shared by all of them:

Screenshot 2021-08-05 at 17 40 46

erperejildo avatar Aug 05 '21 15:08 erperejildo

You have to change the extentRatio of the ActionPane according on the number of actions you want to display.

letsar avatar Aug 06 '21 09:08 letsar

You have to change the extentRatio of the ActionPane according on the number of actions you want to display.

I tried values from 0 to 1 but didn't see any difference

erperejildo avatar Aug 09 '21 21:08 erperejildo

Mmh did you change the extentRatio for the right one? Can you send the code to reproduce this issue?

letsar avatar Aug 10 '21 06:08 letsar

I maybe expressed myself wrong. I see differences but what I mean is that I cannot change the with for each icon to have same with on different SlidableAction.

So on the image I shared, the second one is ok, but the first line should be wider since all elements should have same with and we have one more.

If for example each icon is 50px the first line should be 50px more. I need to have same gaps and widths, but different length if the list of icons is different

erperejildo avatar Aug 10 '21 09:08 erperejildo

If the extentRatio of the pane is 0.4 for 4 actions, then you need to set the extentRatio of the pane to 0.3 for 3 actions if you want them to have the same size. In a more general way, you need to set extentRatioUnit * actionCount (which are values for you to be set) for each ActionPane. Is it more clear?

letsar avatar Jul 10 '22 10:07 letsar