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:
@@ -13,7 +13,6 @@
|
|||||||
// obsidian color for the gradient when null.
|
// obsidian color for the gradient when null.
|
||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.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
|
// before the polish landed. Tweens to the new color on track change
|
||||||
// via AnimatedContainer.
|
// via AnimatedContainer.
|
||||||
final dominantAsync = ref.watch(albumColorProvider(albumId));
|
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
|
// 0.55 alpha keeps the color present without overwhelming contrast
|
||||||
// on the title / artist text below. The lower half of the screen
|
// on the title / artist text below. The lower half of the screen
|
||||||
// stays obsidian for control legibility.
|
// stays obsidian for control legibility.
|
||||||
|
|||||||
Reference in New Issue
Block a user