mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-09 12:39:29 +00:00
progress visibility on item page
This commit is contained in:
parent
be7f5daa88
commit
865a662b56
21 changed files with 1009 additions and 765 deletions
11
lib/shared/extensions/duration_format.dart
Normal file
11
lib/shared/extensions/duration_format.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extension DurationFormat on Duration {
|
||||
/// formats the duration of the book as `10h 30m`
|
||||
///
|
||||
/// will add up all the durations of the audio files first
|
||||
/// then convert them to the given format
|
||||
String get formattedBinary {
|
||||
final hours = inHours;
|
||||
final minutes = inMinutes.remainder(60);
|
||||
return '${hours}h ${minutes}m';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue