Skip to content

Commit

Permalink
修复
Browse files Browse the repository at this point in the history
  • Loading branch information
jhqwqmc committed Aug 25, 2024
1 parent 3e7e0af commit f74aacd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/lib/models/entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Entry {
}
}
if (item is List) {
item.replaceRange(0, item.length, item.map(mapper).whereNotNull());
item.replaceRange(0, item.length, item.map(mapper).where((element) => element != null).toList());
}
}

Expand All @@ -287,7 +287,7 @@ class Entry {
}
}
if (item is List) {
final index = last.asInt;
final index = int.tryParse(last);
if (index == null || index < 0 || index >= item.length) {
return;
}
Expand Down
30 changes: 15 additions & 15 deletions app/lib/models/materials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ part "materials.freezed.dart";
part "materials.g.dart";

enum MaterialProperty {
item(TWIcons.magicWand, Colors.blue, "物品"),
block(TWIcons.cube, Colors.green, "方块"),
solid(TWIcons.square, Colors.brown, "固体"),
transparent(TWIcons.squareOutline, Colors.white, "透明"),
intractable(TWIcons.handPointUp, Colors.pink, "其他"),
occluding(TWIcons.eye, Colors.black, "不透明"),
record(TWIcons.recordVinyl, Colors.grey, "唱片"),
tool(TWIcons.hammer, Colors.teal, "工具"),
weapon(TWIcons.swords, Colors.red, "武器"),
armor(TWIcons.armor, Colors.blue, "盔甲"),
flammable(TWIcons.fire, Colors.red, "易燃"),
burnable(TWIcons.wallFire, Colors.orange, "可燃"),
edible(TWIcons.burger, Colors.yellow, "食物"),
fuel(TWIcons.gasPump, Colors.purple, "燃料"),
ore(TWIcons.ore, Colors.amber, "矿石"),
item(TWIcons.magicWand, Colors.blue, "Item"),
block(TWIcons.cube, Colors.green, "Block"),
solid(TWIcons.square, Colors.brown, "Solid"),
transparent(TWIcons.squareOutline, Colors.white, "Transparent"),
intractable(TWIcons.handPointUp, Colors.pink, "Intractable"),
occluding(TWIcons.eye, Colors.black, "Occluding"),
record(TWIcons.recordVinyl, Colors.grey, "Record"),
tool(TWIcons.hammer, Colors.teal, "Tool"),
weapon(TWIcons.swords, Colors.red, "Weapon"),
armor(TWIcons.armor, Colors.blue, "Armor"),
flammable(TWIcons.fire, Colors.red, "Flammable"),
burnable(TWIcons.wallFire, Colors.orange, "Burnable"),
edible(TWIcons.burger, Colors.yellow, "Edible"),
fuel(TWIcons.gasPump, Colors.purple, "Fuel"),
ore(TWIcons.ore, Colors.amber, "Ore"),
;

const MaterialProperty(this.icon, this.color, this.name);
Expand Down
6 changes: 3 additions & 3 deletions app/lib/widgets/components/app/cinematic_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ List<Segment> _allSegments(_AllSegmentsRef ref, String entryId) {
final paths = ref.watch(_segmentPathsProvider(entryId));
return paths.keys
.map((path) => ref.watch(_segmentsProvider(entryId, path)))
.whereNotNull()
.where((element) => true)
.expand((x) => x)
.toList();
}
Expand Down Expand Up @@ -386,7 +386,7 @@ String _longestEntryName(_LongestEntryNameRef ref) {
final entryIds = ref.watch(_cinematicEntryIdsProvider);
final names = entryIds
.map((entryId) => ref.watch(entryNameProvider(entryId)))
.whereNotNull()
.where((element) => true)
.toList() +
["追踪时长"];
return names.isEmpty
Expand Down Expand Up @@ -534,7 +534,7 @@ int _totalSequenceFrames(_TotalSequenceFramesRef ref) {
final entryIds = ref.watch(_cinematicEntryIdsProvider);
final frames = entryIds
.map((entryId) => ref.watch(_endingFrameProvider(entryId)))
.whereNotNull()
.where((element) => true)
.toList();
return frames.map((frame) => frame).maxOrNull ?? 0;
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/widgets/components/app/entry_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Fuzzy<EntryDefinition> _fuzzyEntries(_FuzzyEntriesRef ref) {
blueprint: blueprint,
entry: entry,
);
}).whereNotNull();
}).where((element) => true);
}).toList();

return Fuzzy(
Expand Down

0 comments on commit f74aacd

Please sign in to comment.