fix: resolve analyzer warnings

- Fix empty catch block in track_provider.dart with comment
- Replace deprecated withOpacity() with withValues(alpha:) in library_settings_page.dart
This commit is contained in:
zarzet
2026-02-03 23:15:32 +07:00
parent 99e0d3d361
commit 3eb2fdd7fa
2 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -556,7 +556,8 @@ class TrackNotifier extends Notifier<TrackState> {
final tracks = List<Track>.from(state.tracks);
tracks[index] = updatedTrack;
state = state.copyWith(tracks: tracks);
} catch (e) {
} catch (_) {
// Silently ignore update failures - track may have been removed
}
}
@@ -443,7 +443,7 @@ class _LibraryHeroCard extends StatelessWidget {
boxShadow: [
if (!isDark)
BoxShadow(
color: colorScheme.shadow.withOpacity(0.05),
color: colorScheme.shadow.withValues(alpha: 0.05),
blurRadius: 20,
offset: const Offset(0, 4),
),
@@ -459,7 +459,7 @@ class _LibraryHeroCard extends StatelessWidget {
child: Icon(
Icons.library_music,
size: 200,
color: colorScheme.primary.withOpacity(0.05),
color: colorScheme.primary.withValues(alpha: 0.05),
),
),
Positioned(
@@ -470,7 +470,7 @@ class _LibraryHeroCard extends StatelessWidget {
height: 150,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: colorScheme.secondaryContainer.withOpacity(0.3),
color: colorScheme.secondaryContainer.withValues(alpha: 0.3),
),
),
),
@@ -574,7 +574,7 @@ class _LibraryHeroCard extends StatelessWidget {
Icon(
Icons.history,
size: 14,
color: colorScheme.onSurfaceVariant.withOpacity(0.7),
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.7),
),
const SizedBox(width: 6),
Text(
@@ -583,7 +583,7 @@ class _LibraryHeroCard extends StatelessWidget {
),
style: TextStyle(
fontSize: 12,
color: colorScheme.onSurfaceVariant.withOpacity(0.7),
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.7),
),
),
],