From 43c7620b4cc3e3406496cf94bc82e732bf91c8e0 Mon Sep 17 00:00:00 2001 From: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:05:59 +0800 Subject: [PATCH] fix: cacheIndex --- lib/pages/setting/pages/bar_set.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/setting/pages/bar_set.dart b/lib/pages/setting/pages/bar_set.dart index eb6b92193..51b730df4 100644 --- a/lib/pages/setting/pages/bar_set.dart +++ b/lib/pages/setting/pages/bar_set.dart @@ -28,8 +28,8 @@ class _BarSetPageState extends State { .map((e) => Pair(first: e, second: cache?.contains(e.index) ?? true)) .toList(); if (cache != null && cache.isNotEmpty) { + final cacheIndex = {for (var (k, v) in cache.indexed) v: k}; list.sort((a, b) { - final cacheIndex = {for (var (k, v) in cache.indexed) v: k}; final indexA = cacheIndex[a.first.index] ?? cacheIndex.length; final indexB = cacheIndex[b.first.index] ?? cacheIndex.length; return indexA.compareTo(indexB);