flutter_slidable
flutter_slidable copied to clipboard
Migration from 0.6.0 to 1.0: iconWidget, SlidableController and freezes
Hello,
Thanks for good widget!
I'm migrating from 0.6.0
to 1.0.0-dev.9
and have noticed some issues:
- No
iconWidget
in1.0.0-dev.9
? I'm using it forpopUpMenu
. - No
controller: SlidableController
? Using it to manually close slidable. - Narrow
SlidableAction
tile, so label doesn't fit and I see...
. In 0.6.0 it was OK. 1.0.0-dev.9:BTW startActionPane has 2 tiles. Maybe it somehow related.
- Freeze when
Slidable
is closing after the click (happens not for everySlidableAction
, can't figure out what causes it, the same issue was in 0.6.0) - I'll provide video later.
Thanks!
Hello!
Thanks for the kind words.
- 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.
- You can get a real controller now from any Slidable's child by calling
Slidable.of(context)
. - 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.
- Can you provide an example? I don't see any freeze in my tests.
@letsar
You are welcome)
- BTW I've used this migration guide. It looks like
iconWidget
is missing in versions 1.0+.SlidableAction()
has onlyicon
property, which is compatible withIconData
, notWidget
. - Thanks - will test it.
- Will update with a demo a little bit later.
- 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.
Looks like there is no way to set custom icon widget like SvgPicture and custom label text style
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?
Second the request to add back custom widget support. Otherwise, users using a custom widget are stuck on 0.6.0 and cannot migrate.
@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.
@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.