mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-06 02:59:28 +00:00
player seek and chapter change
This commit is contained in:
parent
01b3dead49
commit
d01855c218
17 changed files with 1721 additions and 305 deletions
13
lib/shared/extensions/inverse_lerp.dart
Normal file
13
lib/shared/extensions/inverse_lerp.dart
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
extension InverseLerp on num {
|
||||
/// Returns the fraction of this value between [min] and [max].
|
||||
double inverseLerp(num min, num max) {
|
||||
return (this - min) / (max - min);
|
||||
}
|
||||
}
|
||||
|
||||
extension Lerp on double {
|
||||
/// Returns the value between [min] and [max] given the fraction [t].
|
||||
double lerp(double min, double max) {
|
||||
return min + ((max - min) * this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue