Skip to content

Commit

Permalink
overlapping subjs optimization that idk why i didn't try before
Browse files Browse the repository at this point in the history
watch me discover why i didn't try this before as i commit a revert in 20 mins
  • Loading branch information
user5522 committed Jun 3, 2024
1 parent 0480302 commit b5856c0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions lib/components/timetable_views/grid_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ class TimetableGridView extends HookConsumerWidget {
},
).toList();

/// this basically finds overlapping subjects and puts them in the overlapping subjects [StateNotifier]
Future.delayed(
Duration.zero,
() async {
final overlappingSubjectsNotifier =
ref.read(overlappingSubjectsProvider.notifier);

overlappingSubjectsNotifier
.addInBulk(findOverlappingSubjects(subjects));
},
);

final double screenWidth = MediaQuery.of(context).size.width;
final bool isPortrait =
MediaQuery.of(context).orientation == Orientation.portrait;
Expand Down Expand Up @@ -149,6 +137,8 @@ class TimetableGridView extends HookConsumerWidget {
),
);

overlappingSubjects.addAll(findOverlappingSubjects(subjects));

// overlapping subjects
if (overlappingSubjects.isNotEmpty &&
overlappingSubjects.any(
Expand Down

0 comments on commit b5856c0

Please sign in to comment.