♻️ Refactor lyrics fetching

This commit is contained in:
2025-12-19 00:16:23 +08:00
parent a37d762b1b
commit e820fb08de
8 changed files with 53 additions and 263 deletions

View File

@@ -732,7 +732,7 @@ class LibraryScreen extends HookConsumerWidget {
if (await file.exists()) {
final stat = await file.stat();
final sizeInMB = (stat.size / (1024 * 1024)).toStringAsFixed(2);
fileSize = '${sizeInMB} MB';
fileSize = '$sizeInMB MB';
dateAdded = stat.modified.toString().split(
' ',
)[0]; // Just the date part
@@ -752,7 +752,9 @@ class LibraryScreen extends HookConsumerWidget {
}
});
final screenSize = MediaQuery.of(context).size;
if (!context.mounted) return;
final screenSize = MediaQuery.sizeOf(context);
showDialog(
context: context,

View File

@@ -371,7 +371,12 @@ class _CoverView extends StatelessWidget {
child: Column(
children: [
Expanded(
child: Center(child: _PlayerCoverArt(metadataAsync: metadataAsync)),
child: Padding(
padding: const EdgeInsets.only(bottom: 32),
child: Center(
child: _PlayerCoverArt(metadataAsync: metadataAsync),
),
),
),
_PlayerControls(
player: player,
@@ -456,7 +461,7 @@ class _PlayerCoverArt extends StatelessWidget {
loading: () => const Center(child: CircularProgressIndicator()),
error: (_, _) => Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant,
color: Theme.of(context).colorScheme.surfaceContainer,
borderRadius: BorderRadius.circular(24),
),
child: Center(

View File

@@ -160,40 +160,6 @@ class SettingsScreen extends ConsumerWidget {
),
),
),
const SizedBox(height: 16),
// Supported Formats Section
Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Supported Formats',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 8),
Wrap(
spacing: 8,
runSpacing: 4,
children: settings.supportedFormats.map((format) {
return Chip(
label: Text(format.toUpperCase()),
backgroundColor: Theme.of(
context,
).primaryColor.withOpacity(0.1),
);
}).toList(),
),
],
),
),
),
],
),
),