first commit
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled

This commit is contained in:
Zakaria
2026-05-18 14:15:38 -04:00
commit 1563409cb1
382 changed files with 45347 additions and 0 deletions
@@ -0,0 +1,30 @@
import 'package:file_sizes/file_sizes.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import '../../models/finamp_models.dart';
import '../../services/downloads_helper.dart';
class AlbumFileSize extends StatelessWidget {
const AlbumFileSize({Key? key, required this.downloadedParent})
: super(key: key);
final DownloadedParent downloadedParent;
@override
Widget build(BuildContext context) {
DownloadsHelper downloadsHelper = GetIt.instance<DownloadsHelper>();
int totalSize = 0;
for (final item in downloadedParent.downloadedChildren.values) {
DownloadedSong? downloadedSong =
downloadsHelper.getDownloadedSong(item.id);
if (downloadedSong?.mediaSourceInfo.size != null) {
totalSize += downloadedSong!.mediaSourceInfo.size!;
}
}
return Text(FileSize.getSize(totalSize));
}
}