flutter_miniplayer/example/lib/utils.dart

15 lines
367 B
Dart
Raw Normal View History

2021-03-06 11:48:10 +01:00
class AudioObject {
final String title, subtitle, img;
const AudioObject(this.title, this.subtitle, this.img);
}
double valueFromPercentageInRange(
2021-03-06 15:26:00 +01:00
{required final double min, max, percentage}) {
2021-03-06 11:48:10 +01:00
return percentage * (max - min) + min;
}
2021-03-06 15:26:00 +01:00
double percentageFromValueInRange({required final double min, max, value}) {
2021-03-06 11:48:10 +01:00
return (value - min) / (max - min);
}