flutter_slidable icon indicating copy to clipboard operation
flutter_slidable copied to clipboard

Migration from 0.6.0 to 1.0: iconWidget, SlidableController and freezes

Open mrdc opened this issue 3 years ago • 7 comments

Hello,

Thanks for good widget!

I'm migrating from 0.6.0 to 1.0.0-dev.9 and have noticed some issues:

  1. No iconWidget in 1.0.0-dev.9? I'm using it for popUpMenu.
  2. No controller: SlidableController? Using it to manually close slidable.
  3. Narrow SlidableAction tile, so label doesn't fit and I see ... . In 0.6.0 it was OK. 1.0.0-dev.9: Untitled BTW startActionPane has 2 tiles. Maybe it somehow related.
  4. Freeze when Slidable is closing after the click (happens not for every SlidableAction, can't figure out what causes it, the same issue was in 0.6.0) - I'll provide video later.

Thanks!

mrdc avatar Sep 30 '21 19:09 mrdc

Hello!

Thanks for the kind words.

  1. Some widgets have been renamed: look at https://github.com/letsar/flutter_slidable/wiki/Migration-from-version-0.6.0-to-version-1.0.0#actions for the new name.
  2. You can get a real controller now from any Slidable's child by calling Slidable.of(context).
  3. Can you provide an example and what you expected? The appearance of the SlidableAction changed, but you can totally make your own actions if the appearance does not fit you needs.
  4. Can you provide an example? I don't see any freeze in my tests.

letsar avatar Nov 11 '21 15:11 letsar

@letsar

You are welcome)

  1. BTW I've used this migration guide. It looks like iconWidget is missing in versions 1.0+. SlidableAction() has only icon property, which is compatible with IconData, not Widget.
  2. Thanks - will test it.
  3. Will update with a demo a little bit later.
  4. I have extracted this snippet to show the general idea (I'll add the example later as part of point 3) :
onPressed: (context) async {
          //some code
            showDialog(
                context: context,
                builder: (BuildContext context) {
                  return 
                    return SimpleDialog(...)
              }
        )
  }

So, when Slidable is clicked and SimpleDialog is shown, 'Slidable' closes and some animation frames are missing... This happens not for every SimpleDialog, which makes it harder to debug.

mrdc avatar Nov 12 '21 10:11 mrdc

Looks like there is no way to set custom icon widget like SvgPicture and custom label text style

maverick-2013 avatar Dec 11 '21 19:12 maverick-2013

I think you should let users use a custom widget instead of an icon, it makes sense to use an Svg sometimes, is there any plan about this?

imtoori avatar Jan 10 '22 11:01 imtoori

Second the request to add back custom widget support. Otherwise, users using a custom widget are stuck on 0.6.0 and cannot migrate.

rayliverified avatar Feb 25 '22 22:02 rayliverified

@letsar Can you please help me , how can i close the sliadable outside the widget . Slidable.of(context).close not working for me and how can i send state to the slidable widget , below 1.0.0 version using SlidableState what should use instead of it.

gopibathini avatar Apr 06 '22 10:04 gopibathini

@imtoori, @searchy2 you can use CustomSlidableAction for that ;-). @gopibathini you would need to the get the controller of the enclosing Slidable and provide it to the parent if you want to be able to do this.

letsar avatar Jul 10 '22 13:07 letsar