generateAudioBars method
Implementation
List<AudioBar> generateAudioBars(List<double> listOfHeights,
Color playedColor, Color unplayedColor, double playerWidth) {
_bars = [];
double barWidth = playerWidth / listOfHeights.length;
barWidth = barWidth - playerWidth * 0.0075;
for (int i = 0; i < listOfHeights.length; i++) {
_bars.add(
AudioBar(
index: i,
height: listOfHeights[i],
playedColor: playedColor,
unplayedColor: unplayedColor,
width: barWidth,
playerWidth: playerWidth,
),
);
}
currentlyAt = audioPlayer.duration!.inSeconds ~/ _bars.length;
return _bars;
}