DotField constructor

DotField({
  1. required Size size,
  2. int density = 100,
  3. double minSpeed = 10,
  4. double maxSpeed = 20,
  5. double dotSize = 2.0,
  6. Color dotColor = Colors.teal,
  7. Color lineColor = Colors.teal,
  8. double threshold = 25,
  9. double sideStrength = 10,
  10. double maxLineLength = 75,
  11. double lineWidth = .5,
})

Implementation

DotField({
  required this.size,
  this.density = 100,
  this.minSpeed = 10,
  this.maxSpeed = 20,
  this.dotSize = 2.0,
  this.dotColor = Colors.teal,
  this.lineColor = Colors.teal,
  this.threshold = 25,
  this.sideStrength = 10,
  this.maxLineLength = 75,
  this.lineWidth = .5,
}) {
  var numberOfDots = (.00001 * size.width * size.height).round() * density;
  for (var i = 0; i < numberOfDots; i++) {
    dots.add(
      Dot.generateSimilarDot(
        color: dotColor,
        size: dotSize,
        minSpeed: minSpeed,
        maxSpeed: maxSpeed,
        rangeOfMotion: size,
      ),
    );
  }
}