ShapesGenerator.randomly constructor
ShapesGenerator.randomly({
- required double maxWidth,
- required double maxHeight,
- required bool enableXMovements,
- required bool enableYMovements,
- required double maxSize,
- required double minSize,
- required double maxOpacity,
- required double minOpacity,
- required List<
ItemBehaviour> behaviours, - required List<
Color> colors, - required double maxSpeed,
- required double minSpeed,
Implementation
ShapesGenerator.randomly({
required this.maxWidth,
required this.maxHeight,
required this.enableXMovements,
required this.enableYMovements,
required this.maxSize,
required this.minSize,
required this.maxOpacity,
required this.minOpacity,
required List<ItemBehaviour> behaviours,
required List<Color> colors,
required this.maxSpeed,
required this.minSpeed,
}) {
this.behaviours = [];
this.colors = [];
for (ItemBehaviour b in behaviours) {
this.behaviours.add(b);
this.behaviours.add(b);
}
for (Color c in colors) {
this.colors.add(c);
this.colors.add(c);
}
this.colors.shuffle();
this.behaviours.shuffle();
}