From e28276626828b5e1f58885d59714076c16a170e1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 13 May 2026 13:55:56 -0400 Subject: [PATCH] =?UTF-8?q?fix(flutter):=20analyzer=20issues=20from=20#396?= =?UTF-8?q?=20=E2=80=94=20unused=20import=20+=20AsyncValue=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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) --- flutter_client/lib/player/album_color_extractor.dart | 1 - flutter_client/lib/player/now_playing_screen.dart | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/flutter_client/lib/player/album_color_extractor.dart b/flutter_client/lib/player/album_color_extractor.dart index 3fe56fdd..d1a134c8 100644 --- a/flutter_client/lib/player/album_color_extractor.dart +++ b/flutter_client/lib/player/album_color_extractor.dart @@ -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'; diff --git a/flutter_client/lib/player/now_playing_screen.dart b/flutter_client/lib/player/now_playing_screen.dart index d1752cd3..1b0038ee 100644 --- a/flutter_client/lib/player/now_playing_screen.dart +++ b/flutter_client/lib/player/now_playing_screen.dart @@ -92,7 +92,7 @@ class _NowPlayingScreenState extends ConsumerState { // 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.