flutter-slide-to-act
flutter-slide-to-act copied to clipboard
How do you animate a failed action?
How do you animate a failed action when the onSubmit process fails. For example calling a webservice?
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 animate failure vs animate success
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.