fix(flutter): analyzer issues from #396 — unused import + AsyncValue API

Two issues caught by flutter analyze --fatal-infos:

- dart:ui import in album_color_extractor.dart was redundant because
  flutter/painting re-exports the Color it provides. Dropped.
- valueOrNull isn't on AsyncValue in this Riverpod version (the
  AsyncValue<Color?> nesting may also have confused the resolver).
  Switched to asData?.value which always returns the wrapped value
  on AsyncData and null on Loading/Error.

(palette_generator's "discontinued" warning is non-fatal informational
in pub; CI didn't fail on it. The package still works; alternative
swaps deferred until it actually breaks.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 13:55:56 -04:00
parent 046ee8d576
commit e282766268
2 changed files with 1 additions and 2 deletions
@@ -13,7 +13,6 @@
// obsidian color for the gradient when null.
import 'dart:io';
import 'dart:ui';
import 'package:flutter/painting.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -92,7 +92,7 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
// before the polish landed. Tweens to the new color on track change
// via AnimatedContainer.
final dominantAsync = ref.watch(albumColorProvider(albumId));
final dominant = dominantAsync.valueOrNull ?? fs.obsidian;
final dominant = dominantAsync.asData?.value ?? fs.obsidian;
// 0.55 alpha keeps the color present without overwhelming contrast
// on the title / artist text below. The lower half of the screen
// stays obsidian for control legibility.