diff --git a/lib/timetable/entity/issue.dart b/lib/timetable/entity/issue.dart index b25b0e253..38fc6a289 100644 --- a/lib/timetable/entity/issue.dart +++ b/lib/timetable/entity/issue.dart @@ -32,11 +32,9 @@ class TimetableCbeIssue implements TimetableIssue { /// Credit by Examination class TimetablePatchOutOfRangeIssue implements TimetableIssue { final int patchIndex; - final int? inPatchSetIndex; const TimetablePatchOutOfRangeIssue({ required this.patchIndex, - this.inPatchSetIndex, }); static bool detect(SitTimetable timetable, TimetablePatch patch) { @@ -52,14 +50,9 @@ class TimetablePatchOutOfRangeIssue implements TimetableIssue { return false; } - TimetablePatchEntry locate(SitTimetable timetable) { + TimetablePatch locate(SitTimetable timetable) { final patch = timetable.patches[patchIndex]; - final inPatchSetIndex = this.inPatchSetIndex; - if (inPatchSetIndex != null && patch is TimetablePatchSet) { - return patch.patches[inPatchSetIndex]; - } else { - return patch; - } + return patch as TimetablePatch; } } @@ -132,16 +125,6 @@ extension SitTimetable4IssueX on SitTimetable { patchIndex: i, )); } - } else if (patch is TimetablePatchSet) { - for (var j = 0; j < patch.patches.length; j++) { - final inner = patch.patches[j]; - if (TimetablePatchOutOfRangeIssue.detect(this, inner)) { - issues.add(TimetablePatchOutOfRangeIssue( - patchIndex: i, - inPatchSetIndex: j, - )); - } - } } } } diff --git a/lib/timetable/entity/patch.dart b/lib/timetable/entity/patch.dart index 0aadfef7b..08b1a5017 100644 --- a/lib/timetable/entity/patch.dart +++ b/lib/timetable/entity/patch.dart @@ -49,8 +49,6 @@ sealed class TimetablePatchEntry { String l10n(); - String get name; - @override String toString() => toDartCode(); @@ -163,9 +161,6 @@ sealed class TimetablePatch extends TimetablePatchEntry { @JsonKey() TimetablePatchType get type; - @override - String get name => type.l10n(); - const TimetablePatch(); factory TimetablePatch.fromJson(Map json) { @@ -196,7 +191,6 @@ sealed class TimetablePatch extends TimetablePatchEntry { @JsonSerializable() @CopyWith() class TimetablePatchSet extends TimetablePatchEntry { - @override final String name; final List patches; diff --git a/lib/timetable/widgets/issue.dart b/lib/timetable/widgets/issue.dart index be4c47734..891680bc5 100644 --- a/lib/timetable/widgets/issue.dart +++ b/lib/timetable/widgets/issue.dart @@ -204,8 +204,8 @@ class _TimetablePatchOutOfRangeIssueWidgetState extends State