curved_gradient 0.2.2 icon indicating copy to clipboard operation
curved_gradient: ^0.2.2 copied to clipboard

Generate a gradient using a custom curve function. Can be used in place of `LinearGradient`.

Generate a gradient using a custom curve function.

demo1

demo2

Usage #

Container(
  decoration: BoxDecoration(
    gradient: CurvedGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [Colors.grey, Colors.transparent],
      granularity: 10,
      curveGenerator: (x) => pow(sin(x * 10), 2).toDouble(),
    ),
  ),
)
2
likes
130
pub points
29%
popularity

Generate a gradient using a custom curve function. Can be used in place of `LinearGradient`.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on curved_gradient