before method

  1. @override
void before(
  1. Canvas canvas,
  2. Size size
)
override

Before we draw this layer

Implementation

@override
void before(Canvas canvas, Size size) {
  canvas.drawPoints(
      PointMode.points,
      _particleList
          .take(_particleList.length ~/ 2)
          .map((e) => Offset(e.x * size.width, e.y * size.height))
          .toList(),
      Paint()
        ..color = Colors.white54
        ..strokeCap = StrokeCap.round
        ..strokeJoin = StrokeJoin.round
        ..strokeWidth = 3);

  canvas.drawPoints(
      PointMode.points,
      _particleList
          .skip(_particleList.length ~/ 2)
          .map((e) => Offset(e.x * size.width, e.y * size.height))
          .toList(),
      Paint()
        ..color = Colors.grey
        ..strokeCap = StrokeCap.round
        ..strokeJoin = StrokeJoin.round
        ..strokeWidth = 2);
}