I’m trying to add a gradient border to a Container widget in Flutter, but I’m not sure how to achieve this effect since Flutter doesn’t support gradient borders natively. I want the gradient to be applied to the border only, not the entire container. Could someone provide an example of how to create a gradient border around a Container or any other widget in Flutter?
2
Answers
For this, you can put the container in a
DecoratedBox
and apply the gradient.gradient_borders: ^1.0.0
use this in pubspec.yamlflutter pub get