flutter_slidable icon indicating copy to clipboard operation
flutter_slidable copied to clipboard

Slidable Can't be dismissed Programmatically

Open Joe15975 opened this issue 2 years ago • 4 comments

tried for hours to dismiss slidable programmatically for nothing

Joe15975 avatar Nov 29 '22 13:11 Joe15975

Have you tried:

SlidableAction(
  autoClose: false,
  onPressed: (context) {
    final controller = Slidable.of(context);
    controller?.dismiss(
      ResizeRequest(const Duration(milliseconds: 300), () => {}),
      duration: const Duration(milliseconds: 300),
    );
  },
  backgroundColor: theme.colorScheme.error,
  foregroundColor: theme.colorScheme.onError,
  icon: Icons.delete_rounded,
  label: "Remove",
),

autoClose: false is important.

Petri-Oosthuizen avatar Dec 09 '22 09:12 Petri-Oosthuizen

SlidableAction().autoClose needs to be false, spent hours on this, thank you

davidbassey avatar Dec 31 '22 16:12 davidbassey

Thanks a ton i searched for long time and couldn't find a solution but this works

‫في السبت، 31 ديسمبر 2022 في 6:23 م تمت كتابة ما يلي بواسطة ‪David Bassey‬‏ @.***‬‏>:‬

SlidableAction().autoClose needs to be false, spent hours on this, thank you

— Reply to this email directly, view it on GitHub https://github.com/letsar/flutter_slidable/issues/391#issuecomment-1368248391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOUJVPDKTDPVCA75ISA4BLWQBMWLANCNFSM6AAAAAASOPDOQ4 . You are receiving this because you authored the thread.Message ID: @.***>

Joe15975 avatar Jan 01 '23 14:01 Joe15975