flutter-slide-to-act icon indicating copy to clipboard operation
flutter-slide-to-act copied to clipboard

How do you animate a failed action?

Open tawani opened this issue 3 years ago • 3 comments

How do you animate a failed action when the onSubmit process fails. For example calling a webservice?

tawani avatar May 31 '21 14:05 tawani

Hello @tawani, You have to use a GlobalKey<SlideActionState> and then call key.currentState!.reset().

final _slideToActKey = GlobalKey<SlideActionState>();
...
Widget build(BuildContext context){
return SlideAction(
      key: _slideToActKey,
     ...
    );
}
...

void _onSubmit(){
...
 _slideToActKey.currentState!.reset();
}

juanagu avatar Dec 15 '21 09:12 juanagu

@juanagu animate failure vs animate success

tawani avatar Dec 18 '21 02:12 tawani

Hey, great package!

Would love to see the capability of changing the icon on failed action, e.g,. a cross instead of a tick if slide to act fails.

juskek avatar Jul 26 '22 09:07 juskek