blurStackEdge function

Iterable<Widget> blurStackEdge({
  1. required int count,
  2. required double edge,
  3. required EdgeDirection direction,
  4. double intensity = 0.333,
  5. double addedIntensity = 0.333,
})

Implementation

Iterable<Widget> blurStackEdge(
    {required int count,
    required double edge,
    required EdgeDirection direction,
    double intensity = 0.333,
    double addedIntensity = 0.333}) sync* {
  double l = edge / count;

  for (int i = 0; i < count; i++) {
    yield Positioned(
      left: direction == EdgeDirection.right ? null : 0,
      right: direction == EdgeDirection.left ? null : 0,
      top: direction == EdgeDirection.bottom ? null : 0,
      bottom: direction == EdgeDirection.top ? null : 0,
      height:
          direction == EdgeDirection.top || direction == EdgeDirection.bottom
              ? (l * i) + l
              : null,
      width: direction == EdgeDirection.left || direction == EdgeDirection.right
          ? (l * i) + l
          : null,
      child: ClipRect(
        child: BlurSurface(
            blur: intensity + (addedIntensity * (count - i)),
            child: Container()),
      ),
    );
  }
}