Skip to content
Articles
Article

Flutter: Animated Gradients with Custom Hooks

by paddo paddo.org

5 min read

When faced with the task of coming up with a re-usable "Animated Gradient" widget, I faced one problem, a gradient isn't actually a widget - I can't go and make an AnimatedWidget that I can use inside a BoxDecoration in my UI somewhere. What I wanted was an actual gradient that simply took care of its own state management... not a widget, stateful or otherwise. Enter hooks Since discovering hooks for flutter [https://pub.dev/packages/flutter_hooks], I've become a huge fan, I'm making heavy use

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

Supported by