-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature/library rooms #658
Feature/library rooms #658
Conversation
…ect-schrodinger into feature/library-rooms
This is now switched to providers. Note: I used two routes for the reservation and rooms. Therefore, two items will appear in the drawer. |
uni/lib/view/library/library.dart
Outdated
final TabController? tabController = DefaultTabController.of(context); | ||
if (widget.startOnOccupation) { | ||
tabController!.index = 1; | ||
} |
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.
Should this be part of the state of the LibraryPageViewState and not getBody method context?
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 I meant here is, should the final TabController? tabController be declared at LibraryPageViewState and not the getBody function?
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.
Overall, it's a great progress to UNI and a great feature that it's not so easy to implement, so congratulations on that! I just have some minor feedback below, to make the code more maintainable and clean.
import 'package:uni/model/entities/time_utilities.dart'; | ||
|
||
class ReservationRow extends StatelessWidget { | ||
final LibraryReservation? reservation; |
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.
I think you can remove the nullable type, since this can only be built if a reservation exists in library_reservations_tab.dart. And it makes the code more readable too and with less null checks, in this file.
'''CREATE TABLE RESERVATION( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
room TEXT, | ||
startDate INT, |
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.
Make the startDate use the ISO 8601 standard instead of an unix epoch to improve database consistency between models, since Exams already use it and Schedules will use it.
Thank you for the reviews. Made changes according to your suggestions. I didn't use |
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.
✅ 🛫
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.
LGTM 🚀
Closes #627
Fetched the reserved library rooms (gabinetes) from the website and displayed them in the library page.
This uses changes from #618.
If anyone wants to test this, rooms can be reserved here.
To view the currently reserved rooms, I added a card to the library page. The remove button is only a placeholder for now. Functionality will be added later (#656).
Moreover, when there's no rooms to display:
Review checklist
whatsnew/whatsnew-pt-PT
changelog.md
with the change