格式化代码

This commit is contained in:
rang 2025-10-25 10:38:56 +08:00
parent a28547685b
commit b3a9d76c78
24 changed files with 611 additions and 451 deletions

View file

@ -25,8 +25,9 @@ class LibraryItemMetadata extends HookConsumerWidget {
if (book == null) {
return null;
}
final duration =
book.audioFiles.map((e) => e.duration).reduce((value, element) => value + element);
final duration = book.audioFiles
.map((e) => e.duration)
.reduce((value, element) => value + element);
final hours = duration.inHours;
final minutes = duration.inMinutes.remainder(60);
return '${hours}h ${minutes}m';
@ -41,8 +42,9 @@ class LibraryItemMetadata extends HookConsumerWidget {
if (book == null) {
return null;
}
final size =
book.audioFiles.map((e) => e.metadata.size).reduce((value, element) => value + element);
final size = book.audioFiles
.map((e) => e.metadata.size)
.reduce((value, element) => value + element);
if (size / 1024 / 1024 < 1024) {
return '${(size / 1024 / 1024).toStringAsFixed(2)} MB';
}
@ -98,7 +100,10 @@ class LibraryItemMetadata extends HookConsumerWidget {
return VerticalDivider(
indent: 6,
endIndent: 6,
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.6),
color: Theme.of(context)
.colorScheme
.onSurface
.withValues(alpha: 0.6),
);
},
),