contour_gradient 1.2.3
contour_gradient: ^1.2.3 copied to clipboard
A ShapeBorder and InputBorder that paint a gradient along the length of any OutlinedBorder shape, for containers, buttons, cards, chips and text fields.
1.2.3 #
- Separate edges of a
LinearBorder, such as a top and a bottom edge, now each run the whole gradient, so they look alike. They used to share it one after the other. Edges that meet at a corner still form one line.
1.2.2 #
- Fixed
startOffsetmoving the gradient anticlockwise, the opposite of what the documentation says. Increasing it now moves the gradient clockwise, so animations of it turn the other way than before: to keep the old direction, animate from 0.0 to -1.0 instead of to 1.0.
1.2.1 #
- Use contour_gradient version 1.2.0 in the example app
1.2.0 #
- Much faster animated borders. Geometry is cached and the gradient is
applied on the GPU, and no Flutter shape needs
Canvas.saveLayerany more: rounded, beveled and linear borders are clipped, and stroked shapes such asStarBorderare colored by a bundled fragment shader. On a Galaxy S24, 240 animated stars went from 13 to over 100 frames per second, and from 1.6 GB of graphics memory to 159 MB. Custom shapes are still masked in layers. - Borders now sample curves at the device's resolution.
- Fixed the inner edge of small
BeveledRectangleBorders. - Edges may differ from 1.1.0 by a fraction of a pixel, which golden tests may notice. No API changes.
1.1.0 #
- Added
withGradient, an extension onOutlinedBorderthat paints any shape with a gradient along its border, keeping the shape's own side:const StadiumBorder(side: BorderSide(width: 2)).withGradient(colors). The README and the example now use it. TheContourGradientBorderconstructor is unchanged, and is still the way to make aconstborder.
1.0.3 #
- Added a showcase GIF to the package page on pub.dev.
1.0.2 #
- Behavior change: on closed borders the gradient no longer blends from
the last color back into the first. It runs from the first color to the
last, with a hard edge where its end meets its start. To keep the previous
look, repeat the first color at the end of
colors: with evenly spaced colors,[a, b, c, a]looks the same as[a, b, c]did before. Withstops, the border is now the first color before the first stop and the last color after the last stop.
1.0.1 #
- Fixed a
BeveledRectangleBordershape's border being twice as wide as its side, as Flutter's ownBeveledRectangleBorderpaints it. It is now as wide as its side everywhere, on the bevels too.
1.0.0 #
Initial release.
ContourGradientBorder: anOutlinedBorderthat paints a gradient along the length of anyOutlinedBordershape. Supportsstops, hard stops, andstartOffsetfor moving the gradient along the border. On closed borders the gradient wraps around and evenly spaced colors each get the same share of the border.- A
LinearBordershape runs the gradient along only the edges it draws, so an underline shows the whole gradient from left to right. Unlike Flutter's ownLinearBorder, its edges are painted in the right place when the box does not start at the origin, as in aContainer, and without a faint line where two edges meet. ContourGradientInputBorder: the same forInputDecoration, with a gap for floating labels likeOutlineInputBorder.- Both borders interpolate, so they work with implicit animations, and animate
to and from plain
OutlinedBorders andOutlineInputBorders.
