mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix get block color
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -107,7 +107,7 @@ abstract class Pref {
|
|||||||
|
|
||||||
static List<Pair<SegmentType, SkipType>> get blockSettings {
|
static List<Pair<SegmentType, SkipType>> get blockSettings {
|
||||||
final list = _setting.get(SettingBoxKey.blockSettings) as List?;
|
final list = _setting.get(SettingBoxKey.blockSettings) as List?;
|
||||||
if (list == null) {
|
if (list == null || list.length != SegmentType.values.length) {
|
||||||
return SegmentType.values
|
return SegmentType.values
|
||||||
.map((i) => Pair(first: i, second: SkipType.skipOnce))
|
.map((i) => Pair(first: i, second: SkipType.skipOnce))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -116,8 +116,7 @@ abstract class Pref {
|
|||||||
.map(
|
.map(
|
||||||
(item) => Pair(
|
(item) => Pair(
|
||||||
first: item,
|
first: item,
|
||||||
second: SkipType
|
second: SkipType.values[list[item.index]],
|
||||||
.values[list.getOrNull(item.index) ?? SkipType.skipOnce.index],
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
@@ -125,7 +124,7 @@ abstract class Pref {
|
|||||||
|
|
||||||
static List<Color> get blockColor {
|
static List<Color> get blockColor {
|
||||||
final list = _setting.get(SettingBoxKey.blockColor) as List?;
|
final list = _setting.get(SettingBoxKey.blockColor) as List?;
|
||||||
if (list == null) {
|
if (list == null || list.length != SegmentType.values.length) {
|
||||||
return SegmentType.values.map((i) => i.color).toList();
|
return SegmentType.values.map((i) => i.color).toList();
|
||||||
}
|
}
|
||||||
return SegmentType.values.map(
|
return SegmentType.values.map(
|
||||||
|
|||||||
Reference in New Issue
Block a user