-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed schedule days #1039
Fixed schedule days #1039
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1039 +/- ##
=======================================
- Coverage 16% 16% -0%
=======================================
Files 207 207
Lines 6487 6486 -1
=======================================
- Hits 1004 1003 -1
Misses 5483 5483 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice first contribution! Working well on my end.
I left a couple of suggestions to make the code cleaner.
uni/lib/view/schedule/schedule.dart
Outdated
final allDays = Provider.of<LocaleNotifier>(context).getWeekdaysWithLocale() | ||
..removeAt(6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of creating a method in the provider related to the relevant work days (e.g. getWorkWeekDaysWithLocale()
) and then using it as a private member of this widget class?
uni/lib/view/schedule/schedule.dart
Outdated
final tabBarViewContent = <Widget>[]; | ||
for (var i = 0; i < 5; i++) { | ||
for (var day = 0; day < 6; day++) { | ||
tabBarViewContent | ||
.add(createScheduleByDay(context, i, lectures, scheduleStatus)); | ||
.add(createScheduleByDay(context, day, lectures, scheduleStatus)); | ||
} | ||
return tabBarViewContent; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can:
- Inline this logic (it's small and not reusable)
- Make this declarative (e.g.
workDays.map((day) => createSchedule...))
uni/lib/view/schedule/schedule.dart
Outdated
@@ -50,7 +50,7 @@ class SchedulePageView extends StatefulWidget { | |||
static List<Set<Lecture>> groupLecturesByDay(List<Lecture> schedule) { | |||
final aggLectures = <Set<Lecture>>[]; | |||
|
|||
for (var i = 0; i < 5; i++) { | |||
for (var i = 0; i < 6; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you get this number without it being hardcoded?
8854c8f
to
3beb921
Compare
3beb921
to
612c025
Compare
417c250
to
bd61b50
Compare
|
||
List<String> getWorkWeekDaysWithLocale() { | ||
List<String> allDays = getWeekdaysWithLocale(); | ||
allDays.removeAt(6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Is this used to exclude sundays from the schedule?
class SchedulePage extends StatefulWidget { | ||
const SchedulePage({super.key}); | ||
|
||
@override | ||
SchedulePageState createState() => SchedulePageState(); | ||
} | ||
|
||
class SchedulePageState extends GeneralPageViewState<SchedulePage> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bdmendes not sure how pages are supposed to be done. Is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't, this widget as is will be rendered without a scaffold behind (so black background)
Superseded by #1172 |
Closes #946
Added Saturday tab on schedule page.
Review checklist
whatsnew/whatsnew-pt-PT
changelog.md
with the change