Vector4.random constructor Null safety

Vector4.random(
  1. [Random? rng]
)

Generate random vector in the range (0, 0, 0, 0) to (1, 1, 1, 1). You can optionally pass your own random number generator.

Implementation

factory Vector4.random([math.Random? rng]) {
  rng ??= math.Random();
  return Vector4(
      rng.nextDouble(), rng.nextDouble(), rng.nextDouble(), rng.nextDouble());
}