flutter_miniplayer/example/lib/utils.dart

17 lines
412 B
Dart
Raw Normal View History

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