Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 571 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 571 Bytes

Generate a gradient using a custom curve function.


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(),
    ),
  ),
)