LavaPainterData constructor
LavaPainterData({
- double width = 200.0,
- double widthTolerance = 0.0,
- bool growAndShrink = false,
- double growthRate = 20.0,
- double growthRateTolerance = 0.0,
- double blurLevel = 25.0,
- int numBlobs = 5,
- Color backgroundColor = Colors.transparent,
- required List<
Color> colors, - bool allSameColor = false,
- bool fadeBetweenColors = true,
- bool changeColorsTogether = false,
- double speed = 20.0,
- double speedTolerance = 0.0,
Creates a new LavaPainterData object.
A wave background is a background that has gently flowing sine waves that move across the screen in a certain direction.
Duration will not affect this painter in the same way it does others. The
speed of the lava blobs is determined by the speed parameter. The
speedTolerance parameter is used to give the lava blobs a bit of
randomness in their movement speed. The duration will only affect the rate
at which the blobs change color.
Implementation
LavaPainterData({
this.width = 200.0,
this.widthTolerance = 0.0,
this.growAndShrink = false,
this.growthRate = 20.0,
this.growthRateTolerance = 0.0,
this.blurLevel = 25.0,
this.numBlobs = 5,
this.backgroundColor = Colors.transparent,
required List<Color> colors,
this.allSameColor = false,
this.fadeBetweenColors = true,
this.changeColorsTogether = false,
this.speed = 20.0,
this.speedTolerance = 0.0,
}) : assert(width > 0.0),
assert(width - widthTolerance > 0.0),
assert(growthRate >= 0.0),
assert(growthRate - growthRateTolerance >= 0.0),
assert(blurLevel >= 0.0),
assert(numBlobs > 0),
assert(colors.isNotEmpty, true),
assert(speed >= 0),
assert(speed - speedTolerance >= 0),
_colors = colors,
_blobs = [] {
for (int i = 0; i < numBlobs; i++) {
_blobs.add(
Lava(
width: width,
widthTolerance: widthTolerance,
growAndShrink: growAndShrink,
growthRate: growthRate,
growthRateTolerance: growthRateTolerance,
blurLevel: blurLevel,
colors: colors,
allSameColor: allSameColor,
fadeBetweenColors: fadeBetweenColors,
changeColorsTogether: changeColorsTogether,
speed: speed,
speedTolerance: speedTolerance,
),
);
}
}