Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you animate a failed action? #9

Open
tawani opened this issue May 31, 2021 · 3 comments
Open

How do you animate a failed action? #9

tawani opened this issue May 31, 2021 · 3 comments

Comments

@tawani
Copy link

tawani commented May 31, 2021

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

@juanagu
Copy link

juanagu commented Dec 15, 2021

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

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

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

@tawani
Copy link
Author

tawani commented Dec 18, 2021

@juanagu
animate failure vs animate success

@juskek
Copy link

juskek commented Jul 26, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants