Skip to content

Commit

Permalink
perf: faster dialog opening
Browse files Browse the repository at this point in the history
comes by not waiting color extraction, instead extracts synchronously then rebuilds
MSOB7YY committed Dec 30, 2023
1 parent cc61d73 commit e67c281
Showing 6 changed files with 1,426 additions and 1,304 deletions.
9 changes: 7 additions & 2 deletions lib/controller/current_color.dart
Original file line number Diff line number Diff line change
@@ -219,8 +219,13 @@ class CurrentColor {
}

/// Equivalent to calling [getTrackColors] with [delightnedAndAlpha == true]
Future<Color> getTrackDelightnedColor(Track track, {bool fallbackToPlayerStaticColor = false}) async {
final nc = await getTrackColors(track, fallbackToPlayerStaticColor: fallbackToPlayerStaticColor, delightnedAndAlpha: true);
Future<Color> getTrackDelightnedColor(Track track, {bool fallbackToPlayerStaticColor = false, bool useIsolate = _defaultUseIsolate}) async {
final nc = await getTrackColors(
track,
fallbackToPlayerStaticColor: fallbackToPlayerStaticColor,
delightnedAndAlpha: true,
useIsolate: useIsolate,
);
return nc.color;
}

Loading

0 comments on commit e67c281

Please sign in to comment.