From 3077511db01793f655e7c56d42b46d970040f203 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 14 Nov 2022 22:29:50 +0000 Subject: [PATCH 01/45] feat: library reservations fetcher --- .../fetchers/library_reservation_fetcher.dart | 32 +++++++++++++++++ uni/lib/controller/load_info.dart | 3 ++ .../app_library_reservation.dart | 27 +++++++++++++++ .../parsers/parser_library_reservation.dart | 24 +++++++++++++ uni/lib/model/app_state.dart | 4 ++- .../model/entities/library_reservation.dart | 34 +++++++++++++++++++ uni/lib/redux/action_creators.dart | 24 +++++++++++++ uni/lib/redux/actions.dart | 11 ++++++ uni/lib/redux/reducers.dart | 14 ++++++++ 9 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 uni/lib/controller/fetchers/library_reservation_fetcher.dart create mode 100644 uni/lib/controller/local_storage/app_library_reservation.dart create mode 100644 uni/lib/controller/parsers/parser_library_reservation.dart create mode 100644 uni/lib/model/entities/library_reservation.dart diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart new file mode 100644 index 000000000..7cce862e2 --- /dev/null +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -0,0 +1,32 @@ +import 'package:http/http.dart'; +import 'package:uni/controller/fetchers/session_dependant_fetcher.dart'; +import 'package:uni/controller/networking/network_router.dart'; +import 'package:uni/controller/parsers/parser_library_reservation.dart'; +import 'package:uni/model/app_state.dart'; +import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/model/entities/session.dart'; +import 'package:redux/redux.dart'; + +/// Get the library rooms' reservations from the website +class LibraryReservationsFetcherHtml implements SessionDependantFetcher { + @override + List getEndpoints(Session session) { + // TO DO: Implement parsers for all faculties + // and dispatch for different fetchers + final String url = + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; + return [url]; + } + + Future> getReservations( + Store store) async { + final Session session = store.state.content['session']; + final String baseUrl = getEndpoints(session)[0]; + final Future response = + NetworkRouter.getWithCookies(baseUrl, {}, session); + final List reservations = + await response.then((response) => getReservationsFromHtml(response)); + + return reservations; + } +} diff --git a/uni/lib/controller/load_info.dart b/uni/lib/controller/load_info.dart index b55baa1ce..addcdc388 100644 --- a/uni/lib/controller/load_info.dart +++ b/uni/lib/controller/load_info.dart @@ -52,6 +52,7 @@ Future loadRemoteUserInfoToState(Store store) async { lastUpdate = Completer(), restaurants = Completer(), libraryOccupation = Completer(), + libraryReservations = Completer(), calendar = Completer(); store.dispatch(getUserInfo(userInfo)); @@ -60,6 +61,7 @@ Future loadRemoteUserInfoToState(Store store) async { store.dispatch(getUserBusTrips(trips)); store.dispatch(getRestaurantsFromFetcher(restaurants)); store.dispatch(getLibraryOccupationFromFetcher(libraryOccupation)); + store.dispatch(getLibraryReservationsFromFetcher(libraryReservations)); store.dispatch(getCalendarFromFetcher(calendar)); final Tuple2 userPersistentInfo = @@ -80,6 +82,7 @@ Future loadRemoteUserInfoToState(Store store) async { trips.future, restaurants.future, libraryOccupation.future, + libraryReservations.future, calendar.future ]); allRequests.then((futures) { diff --git a/uni/lib/controller/local_storage/app_library_reservation.dart b/uni/lib/controller/local_storage/app_library_reservation.dart new file mode 100644 index 000000000..18e838d7f --- /dev/null +++ b/uni/lib/controller/local_storage/app_library_reservation.dart @@ -0,0 +1,27 @@ +import 'package:uni/model/entities/library_reservation.dart'; + +import 'app_database.dart'; + +class LibraryReservationDatabase extends AppDatabase { + LibraryReservationDatabase() + : super('reservations.db', + [ + '''CREATE TABLE RESERVATION( + id INTEGER PRIMARY KEY AUTOINCREMENT, + room TEXT, + startDate INT, + duration INT + ) + ''' + ]); + + void saveReservations(List reservations) async { + final db = await getDatabase(); + db.transaction((txn) async { + await txn.delete('RESERVATION'); + for (var reservation in reservations) { + await txn.insert('RESERVATION', reservation.toMap()); + } + }); + } +} \ No newline at end of file diff --git a/uni/lib/controller/parsers/parser_library_reservation.dart b/uni/lib/controller/parsers/parser_library_reservation.dart new file mode 100644 index 000000000..ffd7872c3 --- /dev/null +++ b/uni/lib/controller/parsers/parser_library_reservation.dart @@ -0,0 +1,24 @@ +import 'package:http/http.dart'; +import 'package:html/dom.dart'; +import 'package:html/parser.dart'; +import 'package:uni/model/entities/library_reservation.dart'; + +Future> getReservationsFromHtml(Response response) async { + final document = parse(response.body); + + final List reservationHtml = + document.getElementsByClassName('d interior'); + + return reservationHtml.map( (element) { + final String? room = element.children[5].firstChild?.text; + final String? date = element.children[0].firstChild?.text; + final String? hour = element.children[2].firstChild?.text; + final DateTime startDate = DateTime.parse('$date $hour'); + final String? durationHtml = element.children[4].firstChild?.text; + final Duration duration = Duration( + hours: int.parse(durationHtml!.substring(0,2)), + minutes: int.parse(durationHtml.substring(3,5)) + ); + return LibraryReservation(room!, startDate, duration); + }).toList(); +} \ No newline at end of file diff --git a/uni/lib/model/app_state.dart b/uni/lib/model/app_state.dart index 4d9c4d845..37f0c90c8 100644 --- a/uni/lib/model/app_state.dart +++ b/uni/lib/model/app_state.dart @@ -40,7 +40,9 @@ class AppState { 'lastUserInfoUpdateTime': null, 'locationGroups': [], 'libraryOccupation': null, - 'libraryOccupationStatus': RequestStatus.none + 'libraryOccupationStatus': RequestStatus.none, + 'libraryReservations': null, + 'libraryReservationsStatus': RequestStatus.none }; } diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart new file mode 100644 index 000000000..1c8567d85 --- /dev/null +++ b/uni/lib/model/entities/library_reservation.dart @@ -0,0 +1,34 @@ + +/// Private room reservation from the library +class LibraryReservation { + String room; + DateTime startDate; + Duration duration; + + LibraryReservation(this.room, this.startDate, this.duration); + + Map toMap() { + final Map map = { + 'room' : room, + 'startDate' : startDate.millisecondsSinceEpoch, + 'duration' : duration.inHours, + }; + return map; + } + + @override + String toString() { + return '$room, $startDate, $duration'; + } + + @override + bool operator == (Object other){ + return other is LibraryReservation + && room == other.room + && (startDate.compareTo(other.startDate) == 0) + && (duration.compareTo(other.duration) == 0); + } + + @override + int get hashCode => Object.hash(room, startDate, duration); +} \ No newline at end of file diff --git a/uni/lib/redux/action_creators.dart b/uni/lib/redux/action_creators.dart index 8d5d39589..244f2ab0f 100644 --- a/uni/lib/redux/action_creators.dart +++ b/uni/lib/redux/action_creators.dart @@ -11,6 +11,7 @@ import 'package:uni/controller/fetchers/departures_fetcher.dart'; import 'package:uni/controller/fetchers/exam_fetcher.dart'; import 'package:uni/controller/fetchers/fees_fetcher.dart'; import 'package:uni/controller/fetchers/library_occupation_fetcher.dart'; +import 'package:uni/controller/fetchers/library_reservation_fetcher.dart'; import 'package:uni/controller/fetchers/location_fetcher/location_fetcher_asset.dart'; import 'package:uni/controller/fetchers/print_fetcher.dart'; import 'package:uni/controller/fetchers/profile_fetcher.dart'; @@ -28,6 +29,7 @@ import 'package:uni/controller/local_storage/app_exams_database.dart'; import 'package:uni/controller/local_storage/app_last_user_info_update_database.dart'; import 'package:uni/controller/local_storage/app_lectures_database.dart'; import 'package:uni/controller/local_storage/app_library_occupation_database.dart'; +import 'package:uni/controller/local_storage/app_library_reservation.dart'; import 'package:uni/controller/local_storage/app_refresh_times_database.dart'; import 'package:uni/controller/local_storage/app_restaurant_database.dart'; import 'package:uni/controller/local_storage/app_shared_preferences.dart'; @@ -45,6 +47,7 @@ import 'package:uni/model/entities/course_unit.dart'; import 'package:uni/model/entities/exam.dart'; import 'package:uni/model/entities/lecture.dart'; import 'package:uni/model/entities/library_occupation.dart'; +import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/location_group.dart'; import 'package:uni/model/entities/profile.dart'; import 'package:uni/model/entities/restaurant.dart'; @@ -351,6 +354,27 @@ ThunkAction getLibraryOccupationFromFetcher(Completer action) { }; } +ThunkAction getLibraryReservationsFromFetcher(Completer action){ + return (Store store) async{ + try{ + store.dispatch(SetLibraryReservationsStatusAction(RequestStatus.busy)); + + final List reservations = + await LibraryReservationsFetcherHtml().getReservations(store); + // Updates local database according to information fetched -- Reservations + final LibraryReservationDatabase db = LibraryReservationDatabase(); + db.saveReservations(reservations); + store.dispatch(SetLibraryReservationsAction(reservations)); + store.dispatch(SetLibraryReservationsStatusAction(RequestStatus.successful)); + + } catch(e){ + Logger().e('Failed to get Reservations: ${e.toString()}'); + store.dispatch(SetLibraryReservationsStatusAction(RequestStatus.failed)); + } + action.complete(); + }; +} + ThunkAction getCalendarFromFetcher(Completer action) { return (Store store) async { try { diff --git a/uni/lib/redux/actions.dart b/uni/lib/redux/actions.dart index 375bc589f..16c30941c 100644 --- a/uni/lib/redux/actions.dart +++ b/uni/lib/redux/actions.dart @@ -5,6 +5,7 @@ import 'package:uni/model/entities/course_unit.dart'; import 'package:uni/model/entities/exam.dart'; import 'package:uni/model/entities/lecture.dart'; import 'package:uni/model/entities/library_occupation.dart'; +import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/location_group.dart'; import 'package:uni/model/entities/profile.dart'; import 'package:uni/model/entities/restaurant.dart'; @@ -52,6 +53,16 @@ class SetLibraryOccupationStatusAction { SetLibraryOccupationStatusAction(this.status); } +class SetLibraryReservationsAction { + List reservations; + SetLibraryReservationsAction(this.reservations); +} + +class SetLibraryReservationsStatusAction { + RequestStatus status; + SetLibraryReservationsStatusAction(this.status); +} + class SetRestaurantsAction { List restaurants; SetRestaurantsAction(this.restaurants); diff --git a/uni/lib/redux/reducers.dart b/uni/lib/redux/reducers.dart index 99d7f8129..b92fffb9c 100644 --- a/uni/lib/redux/reducers.dart +++ b/uni/lib/redux/reducers.dart @@ -73,6 +73,10 @@ AppState appReducers(AppState state, dynamic action) { return setLibraryOccupationAction(state, action); } else if (action is SetLibraryOccupationStatusAction) { return setLibraryOccupationStatus(state, action); + } else if(action is SetLibraryReservationsAction){ + return setLibraryReservationsAction(state, action); + } else if(action is SetLibraryReservationsStatusAction){ + return setLibraryReservationsStatusAction(state, action); } return state; @@ -106,6 +110,16 @@ AppState setLibraryOccupationStatus( return state.cloneAndUpdateValue('libraryOccupationStatus', action.status); } +AppState setLibraryReservationsAction(AppState state, SetLibraryReservationsAction action) { + Logger().i('setting library reservations: ${action.reservations.length}'); + return state.cloneAndUpdateValue('reservations', action.reservations); +} + +AppState setLibraryReservationsStatusAction(AppState state, SetLibraryReservationsStatusAction action) { + Logger().i('setting library reservations status: ${action.status}%'); + return state.cloneAndUpdateValue('reservationsStatus', action.status); +} + AppState setCalendarAction(AppState state, SetCalendarAction action) { Logger().i('setting calendar: ${action.calendar.length.toString()}'); return state.cloneAndUpdateValue('calendar', action.calendar); From c23cf3dd4816b4bfd9b92b9bb76f5d8169592919 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 11 Dec 2022 11:24:20 +0000 Subject: [PATCH 02/45] Display reserved library rooms --- .../app_library_reservation.dart | 2 +- uni/lib/view/library/library.dart | 3 + .../widgets/library_reservations_card.dart | 104 ++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 uni/lib/view/library/widgets/library_reservations_card.dart diff --git a/uni/lib/controller/local_storage/app_library_reservation.dart b/uni/lib/controller/local_storage/app_library_reservation.dart index 18e838d7f..05df8fbce 100644 --- a/uni/lib/controller/local_storage/app_library_reservation.dart +++ b/uni/lib/controller/local_storage/app_library_reservation.dart @@ -1,6 +1,6 @@ import 'package:uni/model/entities/library_reservation.dart'; -import 'app_database.dart'; +import 'package:uni/controller/local_storage/app_database.dart'; class LibraryReservationDatabase extends AppDatabase { LibraryReservationDatabase() diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index d93ea8174..849371f06 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -9,6 +9,8 @@ import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; import 'package:uni/view/common_widgets/request_dependent_widget_builder.dart'; import 'package:uni/view/library/widgets/library_occupation_card.dart'; +import 'package:uni/view/library/widgets/library_reservations_card.dart'; + class LibraryPageView extends StatefulWidget { const LibraryPageView({Key? key}) : super(key: key); @@ -51,6 +53,7 @@ class LibraryPageViewState extends GeneralPageViewState { content = [ const PageTitle(name: 'Biblioteca'), LibraryOccupationCard(), + LibraryReservationsCard(), ]; if (occupation != null) { content.add(const PageTitle(name: 'Pisos')); diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart new file mode 100644 index 000000000..27f39a298 --- /dev/null +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_redux/flutter_redux.dart'; +import 'package:intl/intl.dart'; +import 'package:tuple/tuple.dart'; +import 'package:uni/model/app_state.dart'; +import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/utils/drawer_items.dart'; +import 'package:uni/view/common_widgets/generic_card.dart'; +import 'package:uni/view/common_widgets/request_dependent_widget_builder.dart'; + +class LibraryReservationsCard extends GenericCard { + LibraryReservationsCard({Key? key}) : super(key: key); + + const LibraryReservationsCard.fromEditingInformation( + Key key, bool editingMode, Function()? onDelete) + : super.fromEditingInformation(key, editingMode, onDelete); + + @override + onClick(BuildContext context) => + Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}'); + + @override + String getTitle() => 'Gabinetes Reservados'; + + @override + Widget buildCardContent(BuildContext context) { + return StoreConnector, RequestStatus>>( + converter: (store) => Tuple2(store.state.content['reservations'], + store.state.content['reservationsStatus']), + builder: (context, room) { + return RequestDependentWidgetBuilder( + context: context, + status: room.item2, + contentGenerator: generateRoom, + content: room.item1, + contentChecker: room.item2 == RequestStatus.successful && + room.item1.isNotEmpty, + onNullContent: Center( + child: Text('Não há salas reservadas!', + style: Theme.of(context).textTheme.headline6, + textAlign: TextAlign.center))); + }); + } + + Widget generateRoom(reservations, context) { + final List rooms = []; + + for (LibraryReservation reservation in reservations) { + final String hoursStart = + DateFormat('HH:mm').format(reservation.startDate); + final String hoursEnd = DateFormat('HH:mm') + .format(reservation.startDate.add(reservation.duration)); + rooms.add(Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + border: + Border.all(color: Theme.of(context).dividerColor, width: 0.5), + borderRadius: const BorderRadius.all(Radius.circular(7))), + margin: const EdgeInsets.all(8), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column(children: [ + Text( + hoursStart, + style: Theme.of(context).textTheme.bodyText1, + ), + Text( + hoursEnd, + style: Theme.of(context).textTheme.bodyText1, + ) + ]), + Column( + children: [ + Text(reservation.room, + //textAlign: TextAlign.center, + style: Theme.of(context).textTheme.headline5?.apply( + color: Theme.of(context).colorScheme.tertiary)), + Text( + DateFormat('dd/MM/yyyy').format(reservation.startDate), + style: Theme.of(context).textTheme.headline5, + ), + ], + ), + IconButton( + constraints: const BoxConstraints( + minHeight: kMinInteractiveDimension / 3, + minWidth: kMinInteractiveDimension / 3), + icon: const Icon(Icons.close), + iconSize: 24, + color: Colors.grey, + alignment: Alignment.centerRight, + tooltip: 'Cancelar reserva', + onPressed: () => {}, + ), + ]))); + } + + return Column(children: rooms); + } +} From cfec53e71bf4bd6b852daa95259e31fd7e96bbf4 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 11 Dec 2022 11:28:50 +0000 Subject: [PATCH 03/45] Merge branch 'feature/library-rooms' --- uni/windows/flutter/generated_plugins.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/windows/flutter/generated_plugins.cmake b/uni/windows/flutter/generated_plugins.cmake index a7e9181a9..e35ed28ba 100644 --- a/uni/windows/flutter/generated_plugins.cmake +++ b/uni/windows/flutter/generated_plugins.cmake @@ -3,7 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST - connectivity_plus + connectivity_plus_windows sentry_flutter url_launcher_windows ) From 76cfe7998bb45f1086cad80ee4dd5297b0e39c75 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 30 Jan 2023 18:16:21 +0000 Subject: [PATCH 04/45] Added library reservations card to main page --- uni/lib/utils/favorite_widget_type.dart | 1 + uni/lib/view/home/widgets/main_cards_list.dart | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/uni/lib/utils/favorite_widget_type.dart b/uni/lib/utils/favorite_widget_type.dart index 36510473f..21cde7ca6 100644 --- a/uni/lib/utils/favorite_widget_type.dart +++ b/uni/lib/utils/favorite_widget_type.dart @@ -4,6 +4,7 @@ enum FavoriteWidgetType { printBalance, account, libraryOccupation(faculties: {"feup"}), + libraryReservations(faculties: {"feup"}), busStops; final Set? faculties; diff --git a/uni/lib/view/home/widgets/main_cards_list.dart b/uni/lib/view/home/widgets/main_cards_list.dart index c4614fa2d..b6a4ddb91 100644 --- a/uni/lib/view/home/widgets/main_cards_list.dart +++ b/uni/lib/view/home/widgets/main_cards_list.dart @@ -6,6 +6,7 @@ import 'package:uni/model/entities/session.dart'; import 'package:uni/redux/actions.dart'; import 'package:uni/utils/favorite_widget_type.dart'; import 'package:uni/view/library/widgets/library_occupation_card.dart'; +import 'package:uni/view/library/widgets/library_reservations_card.dart'; import 'package:uni/view/profile/widgets/account_info_card.dart'; import 'package:uni/view/home/widgets/exit_app_dialog.dart'; import 'package:uni/view/home/widgets/bus_stop_card.dart'; @@ -28,7 +29,9 @@ class MainCardsList extends StatelessWidget { FavoriteWidgetType.busStops: (k, em, od) => BusStopCard.fromEditingInformation(k, em, od), FavoriteWidgetType.libraryOccupation: (k, em, od) => - LibraryOccupationCard.fromEditingInformation(k, em, od) + LibraryOccupationCard.fromEditingInformation(k, em, od), + FavoriteWidgetType.libraryReservations: (k, em, od) => + LibraryReservationsCard.fromEditingInformation(k, em, od) }; MainCardsList({super.key}); From 36980a7eef9670188a6301493e2b2b62f4c847bd Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 30 Jan 2023 21:10:43 +0000 Subject: [PATCH 05/45] Added tabs to library page --- uni/lib/main.dart | 87 ++++++-------- uni/lib/view/library/library.dart | 108 ++++++------------ .../widgets/library_occupation_tab.dart | 88 ++++++++++++++ .../widgets/library_reservations_card.dart | 2 +- .../widgets/library_reservations_tab.dart | 51 +++++++++ 5 files changed, 206 insertions(+), 130 deletions(-) create mode 100644 uni/lib/view/library/widgets/library_occupation_tab.dart create mode 100644 uni/lib/view/library/widgets/library_reservations_tab.dart diff --git a/uni/lib/main.dart b/uni/lib/main.dart index aaf8a9203..6da0a1afc 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -30,7 +30,6 @@ import 'package:uni/view/library/library.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/useful_info/useful_info.dart'; - SentryEvent? beforeSend(SentryEvent event) { return event.level == SentryLevel.info ? event : null; } @@ -95,64 +94,46 @@ class MyAppState extends State { navigatorKey: NavigationService.navigatorKey, onGenerateRoute: (RouteSettings settings) { final Map> transitions = { - '/${DrawerItem.navPersonalArea.title}' : - PageTransition.makePageTransition( - page: const HomePageView(), - settings: settings), - - '/${DrawerItem .navSchedule.title}' : - PageTransition.makePageTransition( - page: const SchedulePage(), - settings: settings), - - '/${DrawerItem.navExams.title}' : - PageTransition.makePageTransition( - page: const ExamsPageView(), - settings: settings), - - '/${DrawerItem.navStops.title}' : - PageTransition.makePageTransition( + '/${DrawerItem.navPersonalArea.title}': + PageTransition.makePageTransition( + page: const HomePageView(), settings: settings), + '/${DrawerItem.navSchedule.title}': + PageTransition.makePageTransition( + page: const SchedulePage(), settings: settings), + '/${DrawerItem.navExams.title}': + PageTransition.makePageTransition( + page: const ExamsPageView(), settings: settings), + '/${DrawerItem.navStops.title}': + PageTransition.makePageTransition( page: const BusStopNextArrivalsPage(), settings: settings), - - '/${DrawerItem.navCourseUnits.title}' : - PageTransition.makePageTransition( - page: const CourseUnitsPageView(), + '/${DrawerItem.navCourseUnits.title}': + PageTransition.makePageTransition( + page: const CourseUnitsPageView(), settings: settings), - - '/${DrawerItem.navLocations.title}' : - PageTransition.makePageTransition( - page: const LocationsPage(), + '/${DrawerItem.navLocations.title}': + PageTransition.makePageTransition( + page: const LocationsPage(), settings: settings), + '/${DrawerItem.navCalendar.title}': + PageTransition.makePageTransition( + page: const CalendarPageView(), settings: settings), + '/${DrawerItem.navLibrary.title}': + PageTransition.makePageTransition( + page: const LibraryPageView(), settings: settings), - - '/${DrawerItem.navCalendar.title}' : - PageTransition.makePageTransition( - page: const CalendarPageView(), - settings: settings), - - '/${DrawerItem.navLibrary.title}' : - PageTransition.makePageTransition( - page: const LibraryPageView(), - settings: settings), - - '/${DrawerItem.navUsefulInfo.title}' : - PageTransition.makePageTransition( - page: const UsefulInfoPageView(), - settings: settings), - - '/${DrawerItem.navAbout.title}' : - PageTransition.makePageTransition( - page: const AboutPageView(), - settings: settings), - - '/${DrawerItem.navBugReport.title}' : - PageTransition.makePageTransition( - page: const BugReportPageView(), + '/${DrawerItem.navUsefulInfo.title}': + PageTransition.makePageTransition( + page: const UsefulInfoPageView(), settings: settings), + '/${DrawerItem.navAbout.title}': + PageTransition.makePageTransition( + page: const AboutPageView(), settings: settings), + '/${DrawerItem.navBugReport.title}': + PageTransition.makePageTransition( + page: const BugReportPageView(), settings: settings, maintainState: false), - - '/${DrawerItem.navLogOut.title}' : - LogoutRoute.buildLogoutRoute() + '/${DrawerItem.navLogOut.title}': + LogoutRoute.buildLogoutRoute() }; return transitions[settings.name]; diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index 24169b0b6..a552bb128 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; -import 'package:percent_indicator/linear_percent_indicator.dart'; import 'package:tuple/tuple.dart'; import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_occupation.dart'; +import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/page_title.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; -import 'package:uni/view/library/widgets/library_occupation_card.dart'; +import 'package:uni/view/library/widgets/library_occupation_tab.dart'; -import 'package:uni/view/library/widgets/library_reservations_card.dart'; +import 'package:uni/view/library/widgets/library_reservations_tab.dart'; class LibraryPageView extends StatefulWidget { const LibraryPageView({Key? key}) : super(key: key); @@ -40,82 +40,38 @@ class LibraryPage extends StatelessWidget { const LibraryPage(this.occupation, {super.key}); + static const List tabs = [ + Tab(text: 'Ocupação'), + Tab(text: 'Gabinetes'), + ]; + @override Widget build(BuildContext context) { - if (occupation == null || occupation?.capacity == 0) { - return ListView(scrollDirection: Axis.vertical, children: [ - Center( - heightFactor: 2, - child: Text('Não existem dados para apresentar', - style: Theme.of(context).textTheme.headline6, - textAlign: TextAlign.center)) - ]); - } - return ListView( - scrollDirection: Axis.vertical, - shrinkWrap: true, - children: [ - const PageTitle(name: 'Biblioteca'), - LibraryOccupationCard(), - if (occupation != null) const PageTitle(name: 'Pisos'), - if (occupation != null) getFloorRows(context, occupation!), - LibraryReservationsCard(), + return DefaultTabController( + length: tabs.length, + child: Builder(builder: (BuildContext context) { + final TabController? tabController = DefaultTabController.of(context); + tabController!.index = 0; + return Column(children: [ + ListView( + scrollDirection: Axis.vertical, + shrinkWrap: true, + children: [ + PageTitle(name: DrawerItem.navLibrary.title), + TabBar( + controller: tabController, + physics: const BouncingScrollPhysics(), + tabs: tabs, + ), + ], + ), + Expanded( + child: TabBarView(controller: tabController, children: [ + LibraryOccupationTab(occupation), + const LibraryReservationsTab() + ])) ]); - } - - Widget getFloorRows(BuildContext context, LibraryOccupation occupation) { - final List floors = []; - for (int i = 1; i < occupation.floors.length; i += 2) { - floors.add(createFloorRow( - context, occupation.getFloor(i), occupation.getFloor(i + 1))); - } - return Column( - children: floors, - ); - } - - Widget createFloorRow( - BuildContext context, FloorOccupation floor1, FloorOccupation floor2) { - return Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - createFloorCard(context, floor1), - createFloorCard(context, floor2), - ]); - } - - Widget createFloorCard(BuildContext context, FloorOccupation floor) { - return Container( - margin: const EdgeInsets.symmetric(vertical: 10), - height: 150.0, - width: 150.0, - padding: const EdgeInsets.all(20.0), - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(10.0)), - color: Theme.of(context).cardColor, - boxShadow: const [ - BoxShadow( - color: Color.fromARGB(0x1c, 0, 0, 0), - blurRadius: 7.0, - offset: Offset(0.0, 1.0), - ) - ]), - child: - Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Text('Piso ${floor.number}', - style: Theme.of(context).textTheme.headline5), - Text('${floor.percentage}%', - style: Theme.of(context).textTheme.headline6), - Text('${floor.occupation}/${floor.capacity}', - style: Theme.of(context) - .textTheme - .headline6 - ?.copyWith(color: Theme.of(context).colorScheme.background)), - LinearPercentIndicator( - lineHeight: 7.0, - percent: floor.percentage / 100, - progressColor: Theme.of(context).colorScheme.secondary, - backgroundColor: Theme.of(context).dividerColor, - ) - ]), + }), ); } } diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart new file mode 100644 index 000000000..507ca0b62 --- /dev/null +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:percent_indicator/linear_percent_indicator.dart'; +import 'package:uni/model/entities/library_occupation.dart'; +import 'package:uni/view/common_widgets/page_title.dart'; +import 'package:uni/view/library/widgets/library_occupation_card.dart'; + +class LibraryOccupationTab extends StatelessWidget { + final LibraryOccupation? occupation; + + const LibraryOccupationTab(this.occupation, {super.key}); + + @override + Widget build(BuildContext context) { + if (occupation == null || occupation?.capacity == 0) { + return ListView(scrollDirection: Axis.vertical, children: [ + Center( + heightFactor: 2, + child: Text('Não existem dados para apresentar', + style: Theme.of(context).textTheme.headline6, + textAlign: TextAlign.center)) + ]); + } + return ListView( + scrollDirection: Axis.vertical, + shrinkWrap: true, + children: [ + LibraryOccupationCard(), + if (occupation != null) const PageTitle(name: 'Pisos'), + if (occupation != null) getFloorRows(context, occupation!), + ]); + } + + Widget getFloorRows(BuildContext context, LibraryOccupation occupation) { + final List floors = []; + for (int i = 1; i < occupation.floors.length; i += 2) { + floors.add(createFloorRow( + context, occupation.getFloor(i), occupation.getFloor(i + 1))); + } + return Column( + children: floors, + ); + } + + Widget createFloorRow( + BuildContext context, FloorOccupation floor1, FloorOccupation floor2) { + return Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ + createFloorCard(context, floor1), + createFloorCard(context, floor2), + ]); + } + + Widget createFloorCard(BuildContext context, FloorOccupation floor) { + return Container( + margin: const EdgeInsets.symmetric(vertical: 10), + height: 150.0, + width: 150.0, + padding: const EdgeInsets.all(20.0), + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(10.0)), + color: Theme.of(context).cardColor, + boxShadow: const [ + BoxShadow( + color: Color.fromARGB(0x1c, 0, 0, 0), + blurRadius: 7.0, + offset: Offset(0.0, 1.0), + ) + ]), + child: + Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + Text('Piso ${floor.number}', + style: Theme.of(context).textTheme.headline5), + Text('${floor.percentage}%', + style: Theme.of(context).textTheme.headline6), + Text('${floor.occupation}/${floor.capacity}', + style: Theme.of(context) + .textTheme + .headline6 + ?.copyWith(color: Theme.of(context).colorScheme.background)), + LinearPercentIndicator( + lineHeight: 7.0, + percent: floor.percentage / 100, + progressColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).dividerColor, + ) + ]), + ); + } +} diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 27f39a298..65743e32b 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -17,7 +17,7 @@ class LibraryReservationsCard extends GenericCard { @override onClick(BuildContext context) => - Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}'); + Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}', arguments: 1); @override String getTitle() => 'Gabinetes Reservados'; diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart new file mode 100644 index 000000000..342a413d4 --- /dev/null +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_redux/flutter_redux.dart'; +import 'package:tuple/tuple.dart'; +import 'package:uni/model/app_state.dart'; +import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/view/library/widgets/library_reservations_card.dart'; + +class LibraryReservationsTab extends StatelessWidget { + const LibraryReservationsTab({super.key}); + + @override + Widget build(BuildContext context) { + return StoreConnector?, RequestStatus>>(converter: (store) { + final List? reservations = + store.state.content['reservations']; + return Tuple2(reservations, store.state.content['reservationsStatus']); + }, builder: (context, reservationsInfo) { + if (reservationsInfo.item2 == RequestStatus.busy) { + return const Center(child: CircularProgressIndicator()); + } else { + return LibraryReservationsList(reservationsInfo.item1); + } + }); + } +} + +class LibraryReservationsList extends StatelessWidget { + final List? reservations; + + const LibraryReservationsList(this.reservations, {super.key}); + + @override + Widget build(BuildContext context) { + if (reservations == null || reservations!.isEmpty) { + return ListView(scrollDirection: Axis.vertical, children: [ + Center( + heightFactor: 2, + child: Text('Não existem dados para apresentar', + style: Theme.of(context).textTheme.headline6, + textAlign: TextAlign.center)) + ]); + } + return ListView( + scrollDirection: Axis.vertical, + shrinkWrap: true, + children: [ + LibraryReservationsCard(), + ]); + } +} From fc959280ec4b9d68f06605d6cd2257a3fd9b8357 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 19:15:32 +0000 Subject: [PATCH 06/45] Reworked library data flow --- uni/lib/main.dart | 2 +- uni/lib/view/library/library.dart | 46 ++++--------------- .../widgets/library_occupation_tab.dart | 32 ++++++++++++- .../widgets/library_reservations_card.dart | 41 ++++++++++------- 4 files changed, 65 insertions(+), 56 deletions(-) diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 6da0a1afc..008c9f0f8 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -119,7 +119,7 @@ class MyAppState extends State { page: const CalendarPageView(), settings: settings), '/${DrawerItem.navLibrary.title}': PageTransition.makePageTransition( - page: const LibraryPageView(), + page: const LibraryPage(), settings: settings), '/${DrawerItem.navUsefulInfo.title}': PageTransition.makePageTransition( diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index a552bb128..aa8fce18d 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -1,8 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:tuple/tuple.dart'; -import 'package:uni/model/app_state.dart'; -import 'package:uni/model/entities/library_occupation.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/page_title.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; @@ -10,43 +6,21 @@ import 'package:uni/view/library/widgets/library_occupation_tab.dart'; import 'package:uni/view/library/widgets/library_reservations_tab.dart'; -class LibraryPageView extends StatefulWidget { - const LibraryPageView({Key? key}) : super(key: key); +class LibraryPage extends StatefulWidget { + const LibraryPage({Key? key}) : super(key: key); @override State createState() => LibraryPageViewState(); } -class LibraryPageViewState extends GeneralPageViewState { +class LibraryPageViewState extends GeneralPageViewState { @override Widget getBody(BuildContext context) { - return StoreConnector>( - converter: (store) { - final LibraryOccupation? occupation = - store.state.content['libraryOccupation']; - return Tuple2(occupation, store.state.content['libraryOccupationStatus']); - }, builder: (context, occupationInfo) { - if (occupationInfo.item2 == RequestStatus.busy) { - return const Center(child: CircularProgressIndicator()); - } else { - return LibraryPage(occupationInfo.item1); - } - }); - } -} - -class LibraryPage extends StatelessWidget { - final LibraryOccupation? occupation; + const List tabs = [ + Tab(text: 'Ocupação'), + Tab(text: 'Gabinetes'), + ]; - const LibraryPage(this.occupation, {super.key}); - - static const List tabs = [ - Tab(text: 'Ocupação'), - Tab(text: 'Gabinetes'), - ]; - - @override - Widget build(BuildContext context) { return DefaultTabController( length: tabs.length, child: Builder(builder: (BuildContext context) { @@ -66,9 +40,9 @@ class LibraryPage extends StatelessWidget { ], ), Expanded( - child: TabBarView(controller: tabController, children: [ - LibraryOccupationTab(occupation), - const LibraryReservationsTab() + child: TabBarView(controller: tabController, children: const [ + LibraryOccupationTab(), + LibraryReservationsTab() ])) ]); }), diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index 507ca0b62..dc0e8fbae 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -1,13 +1,41 @@ import 'package:flutter/material.dart'; +import 'package:flutter_redux/flutter_redux.dart'; import 'package:percent_indicator/linear_percent_indicator.dart'; +import 'package:tuple/tuple.dart'; +import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_occupation.dart'; import 'package:uni/view/common_widgets/page_title.dart'; import 'package:uni/view/library/widgets/library_occupation_card.dart'; -class LibraryOccupationTab extends StatelessWidget { +class LibraryOccupationTab extends StatefulWidget { + const LibraryOccupationTab({Key? key}) : super(key: key); + + @override + LibraryOccupationTabState createState() => LibraryOccupationTabState(); +} + +class LibraryOccupationTabState extends State { + @override + Widget build(BuildContext context) { + return StoreConnector>( + converter: (store) { + final LibraryOccupation? occupation = + store.state.content['libraryOccupation']; + return Tuple2(occupation, store.state.content['libraryOccupationStatus']); + }, builder: (context, occupationInfo) { + if (occupationInfo.item2 == RequestStatus.busy) { + return const Center(child: CircularProgressIndicator()); + } else { + return LibraryOccupationTabView(occupationInfo.item1); + } + }); + } +} + +class LibraryOccupationTabView extends StatelessWidget { final LibraryOccupation? occupation; - const LibraryOccupationTab(this.occupation, {super.key}); + const LibraryOccupationTabView(this.occupation, {super.key}); @override Widget build(BuildContext context) { diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 65743e32b..b68da000b 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -6,7 +6,6 @@ import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; -import 'package:uni/view/common_widgets/request_dependent_widget_builder.dart'; class LibraryReservationsCard extends GenericCard { LibraryReservationsCard({Key? key}) : super(key: key); @@ -17,7 +16,7 @@ class LibraryReservationsCard extends GenericCard { @override onClick(BuildContext context) => - Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}', arguments: 1); + Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}'); @override String getTitle() => 'Gabinetes Reservados'; @@ -25,28 +24,36 @@ class LibraryReservationsCard extends GenericCard { @override Widget buildCardContent(BuildContext context) { return StoreConnector, RequestStatus>>( + Tuple2?, RequestStatus?>>( converter: (store) => Tuple2(store.state.content['reservations'], store.state.content['reservationsStatus']), - builder: (context, room) { - return RequestDependentWidgetBuilder( - context: context, - status: room.item2, - contentGenerator: generateRoom, - content: room.item1, - contentChecker: room.item2 == RequestStatus.successful && - room.item1.isNotEmpty, - onNullContent: Center( - child: Text('Não há salas reservadas!', - style: Theme.of(context).textTheme.headline6, - textAlign: TextAlign.center))); + builder: (context, roomsInfo) { + if (roomsInfo.item2 == null || roomsInfo.item2 == RequestStatus.busy) { + return const Center(child: CircularProgressIndicator()); + } else { + return RoomsList(roomsInfo.item1); + } }); } +} + +class RoomsList extends StatelessWidget { + final List? reservations; + + const RoomsList(this.reservations, {super.key}); + + @override + Widget build(context) { + if (reservations == null || reservations!.isEmpty) { + return Center( + child: Text('Não tens salas reservadas!', + style: Theme.of(context).textTheme.headline6, + textAlign: TextAlign.center)); + } - Widget generateRoom(reservations, context) { final List rooms = []; - for (LibraryReservation reservation in reservations) { + for (LibraryReservation reservation in reservations!) { final String hoursStart = DateFormat('HH:mm').format(reservation.startDate); final String hoursEnd = DateFormat('HH:mm') From af78294f9d5356ed8d3c4377caf39b0b1b6555fb Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 19:19:09 +0000 Subject: [PATCH 07/45] Fix merge conflicts --- uni/lib/main.dart | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/uni/lib/main.dart b/uni/lib/main.dart index f4e055cbb..b3caaf847 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -112,17 +112,18 @@ class MyAppState extends State { PageTransition.makePageTransition( page: const CourseUnitsPageView(), settings: settings), -<<<<<<< HEAD '/${DrawerItem.navLocations.title}': PageTransition.makePageTransition( page: const LocationsPage(), settings: settings), + '/${DrawerItem.navCantine.title}': + PageTransition.makePageTransition( + page: const RestaurantPageView(), settings: settings), '/${DrawerItem.navCalendar.title}': PageTransition.makePageTransition( page: const CalendarPageView(), settings: settings), '/${DrawerItem.navLibrary.title}': PageTransition.makePageTransition( - page: const LibraryPage(), - settings: settings), + page: const LibraryPage(), settings: settings), '/${DrawerItem.navUsefulInfo.title}': PageTransition.makePageTransition( page: const UsefulInfoPageView(), settings: settings), @@ -132,40 +133,6 @@ class MyAppState extends State { '/${DrawerItem.navBugReport.title}': PageTransition.makePageTransition( page: const BugReportPageView(), -======= - '/${DrawerItem.navLocations.title}' : - PageTransition.makePageTransition( - page: const LocationsPage(), - settings: settings), - - '/${DrawerItem.navCantine.title}': - PageTransition.makePageTransition( - page: const RestaurantPageView(), settings: settings), - - '/${DrawerItem.navCalendar.title}' : - PageTransition.makePageTransition( - page: const CalendarPageView(), - settings: settings), - - '/${DrawerItem.navLibrary.title}' : - PageTransition.makePageTransition( - page: const LibraryPageView(), - settings: settings), - - '/${DrawerItem.navUsefulInfo.title}' : - PageTransition.makePageTransition( - page: const UsefulInfoPageView(), - settings: settings), - - '/${DrawerItem.navAbout.title}' : - PageTransition.makePageTransition( - page: const AboutPageView(), - settings: settings), - - '/${DrawerItem.navBugReport.title}' : - PageTransition.makePageTransition( - page: const BugReportPageView(), ->>>>>>> e60eea61f3d8eedc7d841ed946464df56acf7714 settings: settings, maintainState: false), '/${DrawerItem.navLogOut.title}': From c2ecf16d6ef4945969cabf01a1560b68938b54a1 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 19:58:18 +0000 Subject: [PATCH 08/45] Made changes to reserved rooms card --- .../widgets/library_reservations_card.dart | 133 +++++++++++------- 1 file changed, 80 insertions(+), 53 deletions(-) diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index b68da000b..d32ec2db5 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; +import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; import 'package:tuple/tuple.dart'; import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/model/entities/time_utilities.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; @@ -28,7 +30,8 @@ class LibraryReservationsCard extends GenericCard { converter: (store) => Tuple2(store.state.content['reservations'], store.state.content['reservationsStatus']), builder: (context, roomsInfo) { - if (roomsInfo.item2 == null || roomsInfo.item2 == RequestStatus.busy) { + if (roomsInfo.item2 == null || + roomsInfo.item2 == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { return RoomsList(roomsInfo.item1); @@ -50,62 +53,86 @@ class RoomsList extends StatelessWidget { style: Theme.of(context).textTheme.headline6, textAlign: TextAlign.center)); } - final List rooms = []; - for (LibraryReservation reservation in reservations!) { - final String hoursStart = - DateFormat('HH:mm').format(reservation.startDate); - final String hoursEnd = DateFormat('HH:mm') - .format(reservation.startDate.add(reservation.duration)); - rooms.add(Container( - padding: const EdgeInsets.all(8), - decoration: BoxDecoration( - border: - Border.all(color: Theme.of(context).dividerColor, width: 0.5), - borderRadius: const BorderRadius.all(Radius.circular(7))), - margin: const EdgeInsets.all(8), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column(children: [ - Text( - hoursStart, - style: Theme.of(context).textTheme.bodyText1, - ), - Text( - hoursEnd, - style: Theme.of(context).textTheme.bodyText1, - ) - ]), - Column( - children: [ - Text(reservation.room, - //textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline5?.apply( - color: Theme.of(context).colorScheme.tertiary)), - Text( - DateFormat('dd/MM/yyyy').format(reservation.startDate), - style: Theme.of(context).textTheme.headline5, - ), - ], - ), - IconButton( - constraints: const BoxConstraints( - minHeight: kMinInteractiveDimension / 3, - minWidth: kMinInteractiveDimension / 3), - icon: const Icon(Icons.close), - iconSize: 24, - color: Colors.grey, - alignment: Alignment.centerRight, - tooltip: 'Cancelar reserva', - onPressed: () => {}, - ), - ]))); + for (int i = 0; i < reservations!.length && i < 2; i++) { + rooms.add(RoomRow(reservations![i])); } return Column(children: rooms); } } + +class RoomRow extends StatelessWidget { + final LibraryReservation? reservation; + late final String hoursStart; + late final String hoursEnd; + late final String weekDay; + late final String day; + late final String month; + + RoomRow(this.reservation, {super.key}) { + hoursStart = DateFormat('HH:mm').format(reservation!.startDate); + hoursEnd = DateFormat('HH:mm') + .format(reservation!.startDate.add(reservation!.duration)); + weekDay = TimeString.getWeekdaysStrings()[reservation!.startDate.weekday]; + day = DateFormat('dd').format(reservation!.startDate); + initializeDateFormatting(); + month = DateFormat('MMMM', 'pt').format(reservation!.startDate); + } + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + border: + Border.all(color: Theme.of(context).dividerColor, width: 0.5), + borderRadius: const BorderRadius.all(Radius.circular(7))), + margin: const EdgeInsets.all(8), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column(children: [ + Text( + hoursStart, + style: Theme.of(context).textTheme.bodyText1, + ), + Text( + hoursEnd, + style: Theme.of(context).textTheme.bodyText1, + ) + ]), + Column( + children: [ + Text(reservation!.room, + //textAlign: TextAlign.center, + style: Theme.of(context).textTheme.headline5?.apply( + color: Theme.of(context).colorScheme.tertiary)), + const Padding(padding: EdgeInsets.symmetric(vertical: 2)), + Text( + '$weekDay, $day de $month', + style: Theme.of(context).textTheme.subtitle1, + ) + ], + ), + getRemoveButton(context) + ])); + } + + Widget getRemoveButton(BuildContext context) { + return IconButton( + constraints: const BoxConstraints( + minHeight: kMinInteractiveDimension / 3, + minWidth: kMinInteractiveDimension / 3), + icon: const Icon(Icons.close), + iconSize: 24, + color: Colors.grey, + alignment: Alignment.centerRight, + tooltip: 'Cancelar reserva', + onPressed: () => {}, + ); + } +} From 7e4b92554abd6a6cb7a615fe17076843c2620595 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 20:21:46 +0000 Subject: [PATCH 09/45] Reworked library reservations' view --- .../widgets/library_reservations_card.dart | 87 ++----------------- .../widgets/library_reservations_tab.dart | 21 ++++- .../view/library/widgets/reservation_row.dart | 75 ++++++++++++++++ 3 files changed, 103 insertions(+), 80 deletions(-) create mode 100644 uni/lib/view/library/widgets/reservation_row.dart diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index d32ec2db5..cca90ee3f 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -1,13 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; -import 'package:intl/date_symbol_data_local.dart'; -import 'package:intl/intl.dart'; import 'package:tuple/tuple.dart'; import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_reservation.dart'; -import 'package:uni/model/entities/time_utilities.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; +import 'package:uni/view/library/widgets/reservation_row.dart'; class LibraryReservationsCard extends GenericCard { LibraryReservationsCard({Key? key}) : super(key: key); @@ -56,83 +54,16 @@ class RoomsList extends StatelessWidget { final List rooms = []; for (int i = 0; i < reservations!.length && i < 2; i++) { - rooms.add(RoomRow(reservations![i])); + rooms.add(Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + border: + Border.all(color: Theme.of(context).dividerColor, width: 0.5), + borderRadius: const BorderRadius.all(Radius.circular(7))), + margin: const EdgeInsets.all(8), + child: ReservationRow(reservations![i]))); } return Column(children: rooms); } } - -class RoomRow extends StatelessWidget { - final LibraryReservation? reservation; - late final String hoursStart; - late final String hoursEnd; - late final String weekDay; - late final String day; - late final String month; - - RoomRow(this.reservation, {super.key}) { - hoursStart = DateFormat('HH:mm').format(reservation!.startDate); - hoursEnd = DateFormat('HH:mm') - .format(reservation!.startDate.add(reservation!.duration)); - weekDay = TimeString.getWeekdaysStrings()[reservation!.startDate.weekday]; - day = DateFormat('dd').format(reservation!.startDate); - initializeDateFormatting(); - month = DateFormat('MMMM', 'pt').format(reservation!.startDate); - } - - @override - Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.all(8), - decoration: BoxDecoration( - border: - Border.all(color: Theme.of(context).dividerColor, width: 0.5), - borderRadius: const BorderRadius.all(Radius.circular(7))), - margin: const EdgeInsets.all(8), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column(children: [ - Text( - hoursStart, - style: Theme.of(context).textTheme.bodyText1, - ), - Text( - hoursEnd, - style: Theme.of(context).textTheme.bodyText1, - ) - ]), - Column( - children: [ - Text(reservation!.room, - //textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline5?.apply( - color: Theme.of(context).colorScheme.tertiary)), - const Padding(padding: EdgeInsets.symmetric(vertical: 2)), - Text( - '$weekDay, $day de $month', - style: Theme.of(context).textTheme.subtitle1, - ) - ], - ), - getRemoveButton(context) - ])); - } - - Widget getRemoveButton(BuildContext context) { - return IconButton( - constraints: const BoxConstraints( - minHeight: kMinInteractiveDimension / 3, - minWidth: kMinInteractiveDimension / 3), - icon: const Icon(Icons.close), - iconSize: 24, - color: Colors.grey, - alignment: Alignment.centerRight, - tooltip: 'Cancelar reserva', - onPressed: () => {}, - ); - } -} diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index 342a413d4..aec35a8ba 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -3,7 +3,7 @@ import 'package:flutter_redux/flutter_redux.dart'; import 'package:tuple/tuple.dart'; import 'package:uni/model/app_state.dart'; import 'package:uni/model/entities/library_reservation.dart'; -import 'package:uni/view/library/widgets/library_reservations_card.dart'; +import 'package:uni/view/library/widgets/reservation_row.dart'; class LibraryReservationsTab extends StatelessWidget { const LibraryReservationsTab({super.key}); @@ -45,7 +45,24 @@ class LibraryReservationsList extends StatelessWidget { scrollDirection: Axis.vertical, shrinkWrap: true, children: [ - LibraryReservationsCard(), + getReservationList(context), ]); } + + Widget getReservationList(BuildContext context) { + final List rooms = []; + + for (int i = 0; i < reservations!.length && i < 2; i++) { + rooms.add(Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, width: 1))), + margin: const EdgeInsets.all(8), + child: ReservationRow(reservations![i]))); + } + + return Column(children: rooms); + } } diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart new file mode 100644 index 000000000..29d2b8750 --- /dev/null +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; +import 'package:intl/date_symbol_data_local.dart'; +import 'package:intl/intl.dart'; +import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/model/entities/time_utilities.dart'; + +class ReservationRow extends StatelessWidget { + final LibraryReservation? reservation; + late final String hoursStart; + late final String hoursEnd; + late final String weekDay; + late final String day; + late final String month; + + ReservationRow(this.reservation, {super.key}) { + hoursStart = DateFormat('HH:mm').format(reservation!.startDate); + hoursEnd = DateFormat('HH:mm') + .format(reservation!.startDate.add(reservation!.duration)); + weekDay = TimeString.getWeekdaysStrings( + startMonday: false)[reservation!.startDate.weekday]; + day = DateFormat('dd').format(reservation!.startDate); + initializeDateFormatting(); + month = DateFormat('MMMM', 'pt').format(reservation!.startDate); + } + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column(children: [ + Text( + hoursStart, + style: Theme.of(context).textTheme.bodyText1, + ), + Text( + hoursEnd, + style: Theme.of(context).textTheme.bodyText1, + ) + ]), + Column( + children: [ + Text(reservation!.room, + //textAlign: TextAlign.center, + style: Theme.of(context) + .textTheme + .headline5 + ?.apply(color: Theme.of(context).colorScheme.tertiary)), + const Padding(padding: EdgeInsets.symmetric(vertical: 2)), + Text( + '$weekDay, $day de $month', + style: Theme.of(context).textTheme.subtitle1, + ) + ], + ), + getRemoveButton(context) + ]); + } + + Widget getRemoveButton(BuildContext context) { + return IconButton( + constraints: const BoxConstraints( + minHeight: kMinInteractiveDimension / 3, + minWidth: kMinInteractiveDimension / 3), + icon: const Icon(Icons.close), + iconSize: 24, + color: Colors.grey, + alignment: Alignment.centerRight, + tooltip: 'Cancelar reserva', + onPressed: () => {}, + ); + } +} From 53c285949a3f2be0cc596014815a69efb1b7d3cc Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 21:27:52 +0000 Subject: [PATCH 10/45] Added custom reservations route --- uni/lib/main.dart | 8 +++++++- uni/lib/utils/drawer_items.dart | 3 ++- uni/lib/view/library/library.dart | 9 ++++++--- .../view/library/widgets/library_occupation_card.dart | 2 +- .../view/library/widgets/library_reservations_card.dart | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/uni/lib/main.dart b/uni/lib/main.dart index b3caaf847..fbe4f31b9 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -121,9 +121,15 @@ class MyAppState extends State { '/${DrawerItem.navCalendar.title}': PageTransition.makePageTransition( page: const CalendarPageView(), settings: settings), - '/${DrawerItem.navLibrary.title}': + '/${DrawerItem.navLibraryOccupation.title}': PageTransition.makePageTransition( page: const LibraryPage(), settings: settings), + '/${DrawerItem.navLibraryReservations.title}': + PageTransition.makePageTransition( + page: const LibraryPage( + startOnOccupation: true, + ), + settings: settings), '/${DrawerItem.navUsefulInfo.title}': PageTransition.makePageTransition( page: const UsefulInfoPageView(), settings: settings), diff --git a/uni/lib/utils/drawer_items.dart b/uni/lib/utils/drawer_items.dart index 459d81059..f9644c2f0 100644 --- a/uni/lib/utils/drawer_items.dart +++ b/uni/lib/utils/drawer_items.dart @@ -7,7 +7,8 @@ enum DrawerItem { navLocations('Locais', faculties: {'feup'}), navCantine('Restaurantes'), navCalendar('Calendário'), - navLibrary('Biblioteca', faculties: {'feup'}), + navLibraryOccupation('Biblioteca', faculties: {'feup'}), + navLibraryReservations('Reservas', faculties: {'feup'}), navUsefulInfo('Úteis', faculties: {'feup'}), navAbout('Sobre'), navBugReport('Bugs e Sugestões'), diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index aa8fce18d..f783b8487 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -7,7 +7,8 @@ import 'package:uni/view/library/widgets/library_occupation_tab.dart'; import 'package:uni/view/library/widgets/library_reservations_tab.dart'; class LibraryPage extends StatefulWidget { - const LibraryPage({Key? key}) : super(key: key); + final bool startOnOccupation; + const LibraryPage({this.startOnOccupation = false, Key? key}) : super(key: key); @override State createState() => LibraryPageViewState(); @@ -25,13 +26,15 @@ class LibraryPageViewState extends GeneralPageViewState { length: tabs.length, child: Builder(builder: (BuildContext context) { final TabController? tabController = DefaultTabController.of(context); - tabController!.index = 0; + if (widget.startOnOccupation) { + tabController!.index = 1; + } return Column(children: [ ListView( scrollDirection: Axis.vertical, shrinkWrap: true, children: [ - PageTitle(name: DrawerItem.navLibrary.title), + PageTitle(name: DrawerItem.navLibraryOccupation.title), TabBar( controller: tabController, physics: const BouncingScrollPhysics(), diff --git a/uni/lib/view/library/widgets/library_occupation_card.dart b/uni/lib/view/library/widgets/library_occupation_card.dart index 2e2dcbd2e..779054f49 100644 --- a/uni/lib/view/library/widgets/library_occupation_card.dart +++ b/uni/lib/view/library/widgets/library_occupation_card.dart @@ -21,7 +21,7 @@ class LibraryOccupationCard extends GenericCard { @override onClick(BuildContext context) => - Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}'); + Navigator.pushNamed(context, '/${DrawerItem.navLibraryOccupation.title}'); @override Widget buildCardContent(BuildContext context) { diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index cca90ee3f..32693e941 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -15,8 +15,8 @@ class LibraryReservationsCard extends GenericCard { : super.fromEditingInformation(key, editingMode, onDelete); @override - onClick(BuildContext context) => - Navigator.pushNamed(context, '/${DrawerItem.navLibrary.title}'); + onClick(BuildContext context) => Navigator.pushNamed( + context, '/${DrawerItem.navLibraryReservations.title}'); @override String getTitle() => 'Gabinetes Reservados'; From 1aa923bf822948b5386e6e78b14ea7b99e80cc0e Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 12 Feb 2023 21:40:39 +0000 Subject: [PATCH 11/45] Small changes to library reservations --- uni/lib/model/entities/library_reservation.dart | 6 +++--- uni/lib/view/library/widgets/library_reservations_card.dart | 2 +- uni/lib/view/library/widgets/library_reservations_tab.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart index 1c8567d85..4e1b26e56 100644 --- a/uni/lib/model/entities/library_reservation.dart +++ b/uni/lib/model/entities/library_reservation.dart @@ -1,9 +1,9 @@ /// Private room reservation from the library class LibraryReservation { - String room; - DateTime startDate; - Duration duration; + final String room; + final DateTime startDate; + final Duration duration; LibraryReservation(this.room, this.startDate, this.duration); diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 32693e941..b8a55b14a 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -47,7 +47,7 @@ class RoomsList extends StatelessWidget { Widget build(context) { if (reservations == null || reservations!.isEmpty) { return Center( - child: Text('Não tens salas reservadas!', + child: Text('Não há salas reservadas!', style: Theme.of(context).textTheme.headline6, textAlign: TextAlign.center)); } diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index aec35a8ba..e8cd1b1c6 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -36,7 +36,7 @@ class LibraryReservationsList extends StatelessWidget { return ListView(scrollDirection: Axis.vertical, children: [ Center( heightFactor: 2, - child: Text('Não existem dados para apresentar', + child: Text('Não há salas reservadas', style: Theme.of(context).textTheme.headline6, textAlign: TextAlign.center)) ]); From a86709b2f37abcf1999ddaa87487ea9fcb89db5d Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 15 Mar 2023 23:06:37 +0000 Subject: [PATCH 12/45] Fixed providers issues --- uni/lib/controller/load_info.dart | 2 +- .../local_storage/app_shared_preferences.dart | 9 ++++----- uni/lib/main.dart | 3 +++ .../providers/library_reservations_provider.dart | 3 --- .../library/widgets/library_reservations_card.dart | 2 +- .../library/widgets/library_reservations_tab.dart | 12 ++++++------ 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/uni/lib/controller/load_info.dart b/uni/lib/controller/load_info.dart index 0e060f2c2..823c9dae6 100644 --- a/uni/lib/controller/load_info.dart +++ b/uni/lib/controller/load_info.dart @@ -59,7 +59,7 @@ Future loadRemoteUserInfoToState(StateProviders stateProviders) async { stateProviders.libraryOccupationProvider .getLibraryOccupation(session, libraryOccupation); stateProviders.libraryReservationsProvider - .getLibraryReservations(session, libraryOccupation); + .getLibraryReservations(session, libraryReservations); final Tuple2 userPersistentInfo = await AppSharedPreferences.getPersistentUserInfo(); diff --git a/uni/lib/controller/local_storage/app_shared_preferences.dart b/uni/lib/controller/local_storage/app_shared_preferences.dart index aa6ae8621..dfdcd79a5 100644 --- a/uni/lib/controller/local_storage/app_shared_preferences.dart +++ b/uni/lib/controller/local_storage/app_shared_preferences.dart @@ -7,7 +7,6 @@ import 'package:tuple/tuple.dart'; import 'package:uni/model/entities/exam.dart'; import 'package:uni/utils/favorite_widget_type.dart'; - /// Manages the app's Shared Preferences. /// /// This database stores the user's student number, password and favorite @@ -150,18 +149,18 @@ class AppSharedPreferences { .toList(); } - static saveHiddenExams(List newHiddenExams) async { final prefs = await SharedPreferences.getInstance(); - prefs.setStringList( - hiddenExams, newHiddenExams); + prefs.setStringList(hiddenExams, newHiddenExams); } static Future> getHiddenExams() async { final prefs = await SharedPreferences.getInstance(); - final List storedHiddenExam = prefs.getStringList(hiddenExams) ?? []; + final List storedHiddenExam = + prefs.getStringList(hiddenExams) ?? []; return storedHiddenExam; } + /// Replaces the user's exam filter settings with [newFilteredExamTypes]. static saveFilteredExams(Map newFilteredExamTypes) async { final prefs = await SharedPreferences.getInstance(); diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 2a7c003ce..51d476b93 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -89,6 +89,9 @@ Future main() async { ChangeNotifierProvider( create: (context) => stateProviders.libraryOccupationProvider), + ChangeNotifierProvider( + create: (context) => + stateProviders.libraryReservationsProvider), ChangeNotifierProvider( create: (context) => stateProviders.facultyLocationsProvider), diff --git a/uni/lib/model/providers/library_reservations_provider.dart b/uni/lib/model/providers/library_reservations_provider.dart index a144defe6..8f224fda5 100644 --- a/uni/lib/model/providers/library_reservations_provider.dart +++ b/uni/lib/model/providers/library_reservations_provider.dart @@ -1,11 +1,8 @@ import 'dart:async'; import 'package:logger/logger.dart'; -import 'package:uni/controller/fetchers/library_occupation_fetcher.dart'; import 'package:uni/controller/fetchers/library_reservation_fetcher.dart'; import 'package:uni/controller/local_storage/app_library_reservation.dart'; -import 'package:uni/controller/local_storage/app_library_reservation.dart'; -import 'package:uni/model/entities/library_occupation.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/session.dart'; import 'package:uni/model/providers/state_provider_notifier.dart'; diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 16ecb334b..8f04b99e9 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -44,7 +44,7 @@ class RoomsList extends StatelessWidget { Widget build(context) { if (reservations == null || reservations!.isEmpty) { return Center( - child: Text('Não há salas reservadas!', + child: Text('Não tens salas reservadas!', style: Theme.of(context).textTheme.headline6, textAlign: TextAlign.center)); } diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index a8825da07..175d9d5ce 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -10,15 +10,15 @@ class LibraryReservationsTab extends StatelessWidget { @override Widget build(BuildContext context) { - return Consumer ( - builder: (context, reservationsProvider, _) { - if (reservationsProvider.reservations == null - || reservationsProvider.status == RequestStatus.busy) { + return Consumer( + builder: (context, reservationsProvider, _) { + if (reservationsProvider.reservations == null || + reservationsProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { return LibraryReservationsList(reservationsProvider.reservations); } - }); + }); } } @@ -33,7 +33,7 @@ class LibraryReservationsList extends StatelessWidget { return ListView(scrollDirection: Axis.vertical, children: [ Center( heightFactor: 2, - child: Text('Não há salas reservadas', + child: Text('Não tens salas reservadas', style: Theme.of(context).textTheme.headline6, textAlign: TextAlign.center)) ]); From c2d08348e959b775912451f4b754065bf3cf577d Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 15 Mar 2023 23:21:27 +0000 Subject: [PATCH 13/45] Refactored helper functions --- .../widgets/library_occupation_tab.dart | 42 ++++++++++++------- .../widgets/library_reservations_tab.dart | 17 +++++--- .../view/library/widgets/reservation_row.dart | 9 +++- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index cdae9f09d..8f78bbf68 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -17,15 +17,15 @@ class LibraryOccupationTab extends StatefulWidget { class LibraryOccupationTabState extends State { @override Widget build(BuildContext context) { - return Consumer ( - builder: (context, occupationProvider, _) { + return Consumer( + builder: (context, occupationProvider, _) { if (occupationProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { return LibraryOccupationTabView(occupationProvider.occupation); } - }); - } + }); + } } class LibraryOccupationTabView extends StatelessWidget { @@ -50,30 +50,40 @@ class LibraryOccupationTabView extends StatelessWidget { children: [ LibraryOccupationCard(), if (occupation != null) const PageTitle(name: 'Pisos'), - if (occupation != null) getFloorRows(context, occupation!), + if (occupation != null) FloorRows(occupation!), ]); } +} - Widget getFloorRows(BuildContext context, LibraryOccupation occupation) { +class FloorRows extends StatelessWidget { + final LibraryOccupation occupation; + + const FloorRows(this.occupation, {super.key}); + + @override + Widget build(BuildContext context) { final List floors = []; for (int i = 1; i < occupation.floors.length; i += 2) { - floors.add(createFloorRow( - context, occupation.getFloor(i), occupation.getFloor(i + 1))); + floors.add(Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FloorCard(occupation.getFloor(i)), + FloorCard(occupation.getFloor(i + 1)) + ])); } return Column( children: floors, ); } +} - Widget createFloorRow( - BuildContext context, FloorOccupation floor1, FloorOccupation floor2) { - return Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - createFloorCard(context, floor1), - createFloorCard(context, floor2), - ]); - } +class FloorCard extends StatelessWidget { + final FloorOccupation floor; - Widget createFloorCard(BuildContext context, FloorOccupation floor) { + const FloorCard(this.floor, {super.key}); + + @override + Widget build(BuildContext context) { return Container( margin: const EdgeInsets.symmetric(vertical: 10), height: 150.0, diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index 175d9d5ce..f834af41c 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -16,16 +16,16 @@ class LibraryReservationsTab extends StatelessWidget { reservationsProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { - return LibraryReservationsList(reservationsProvider.reservations); + return LibraryReservationsTabView(reservationsProvider.reservations); } }); } } -class LibraryReservationsList extends StatelessWidget { +class LibraryReservationsTabView extends StatelessWidget { final List? reservations; - const LibraryReservationsList(this.reservations, {super.key}); + const LibraryReservationsTabView(this.reservations, {super.key}); @override Widget build(BuildContext context) { @@ -42,11 +42,18 @@ class LibraryReservationsList extends StatelessWidget { scrollDirection: Axis.vertical, shrinkWrap: true, children: [ - getReservationList(context), + LibraryReservationsList(reservations), ]); } +} + +class LibraryReservationsList extends StatelessWidget { + final List? reservations; + + const LibraryReservationsList(this.reservations, {super.key}); - Widget getReservationList(BuildContext context) { + @override + Widget build(BuildContext context) { final List rooms = []; for (int i = 0; i < reservations!.length && i < 2; i++) { diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 29d2b8750..1e410bf39 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -55,11 +55,16 @@ class ReservationRow extends StatelessWidget { ) ], ), - getRemoveButton(context) + const ReservationRemoveButton() ]); } +} + +class ReservationRemoveButton extends StatelessWidget { + const ReservationRemoveButton({super.key}); - Widget getRemoveButton(BuildContext context) { + @override + Widget build(BuildContext context) { return IconButton( constraints: const BoxConstraints( minHeight: kMinInteractiveDimension / 3, From ea8af13b7141b6456011f4de0e8bf58599ad4cbf Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 12 Apr 2023 13:49:28 +0100 Subject: [PATCH 14/45] Made changes according to suggestions --- uni/lib/controller/load_info.dart | 4 +++ .../app_library_reservation.dart | 30 +++++++++---------- uni/lib/main.dart | 2 +- .../model/entities/library_reservation.dart | 21 +++++++------ .../library_reservations_provider.dart | 6 ++-- uni/lib/view/library/library.dart | 16 ++++++---- .../widgets/library_occupation_tab.dart | 25 ++++++++-------- .../widgets/library_reservations_tab.dart | 8 ++--- .../view/library/widgets/reservation_row.dart | 14 ++++----- 9 files changed, 66 insertions(+), 60 deletions(-) diff --git a/uni/lib/controller/load_info.dart b/uni/lib/controller/load_info.dart index 823c9dae6..090f91554 100644 --- a/uni/lib/controller/load_info.dart +++ b/uni/lib/controller/load_info.dart @@ -128,6 +128,10 @@ void loadLocalUserInfoToState(StateProviders stateProviders, stateProviders.lastUserInfoProvider.updateStateBasedOnLocalTime(); stateProviders.calendarProvider.updateStateBasedOnLocalCalendar(); stateProviders.profileStateProvider.updateStateBasedOnLocalCourseUnits(); + stateProviders.libraryOccupationProvider + .updateStateBasedOnLocalOccupation(); + stateProviders.libraryReservationsProvider + .updateStateBasedOnLocalReservations(); } stateProviders.facultyLocationsProvider.getFacultyLocations(Completer()); diff --git a/uni/lib/controller/local_storage/app_library_reservation.dart b/uni/lib/controller/local_storage/app_library_reservation.dart index 07e351ed7..aa514f6e1 100644 --- a/uni/lib/controller/local_storage/app_library_reservation.dart +++ b/uni/lib/controller/local_storage/app_library_reservation.dart @@ -5,42 +5,42 @@ import 'package:uni/controller/local_storage/app_database.dart'; class LibraryReservationDatabase extends AppDatabase { LibraryReservationDatabase() - : super('reservations.db', - [ - '''CREATE TABLE RESERVATION( + : super('reservations.db', [ + '''CREATE TABLE RESERVATION( id INTEGER PRIMARY KEY AUTOINCREMENT, room TEXT, - startDate INT, - duration INT + startDate TEXT, + duration_hours INT, + duration_minutes INT ) ''' - ]); + ]); void saveReservations(List reservations) async { final db = await getDatabase(); db.transaction((txn) async { await txn.delete('RESERVATION'); - for (var reservation in reservations) { + for (var reservation in reservations) { await txn.insert('RESERVATION', reservation.toMap()); } }); } - + Future> reservations() async { final Database db = await getDatabase(); - final List> maps = await db.query('reservation'); + final List> items = await db.query('RESERVATION'); final List reservations = []; - for (int i = 0; i < maps.length; i++) { + for (int i = 0; i < items.length; i++) { + final int minutes = items[i]['duration']; reservations.add(LibraryReservation( - maps[i]['room'], - maps[i]['startDate'], - maps[i]['duration'] - )); + items[i]['room'], + DateTime.parse(items[i]['startDate']), + Duration(hours: minutes ~/ 60, minutes: minutes % 60))); } return reservations; } -} \ No newline at end of file +} diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 51d476b93..c982cbaf5 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -172,7 +172,7 @@ class MyAppState extends State { '/${DrawerItem.navLibraryReservations.title}': PageTransition.makePageTransition( page: const LibraryPage( - startOnOccupation: true, + startOnOccupationTab: true, ), settings: settings), '/${DrawerItem.navUsefulInfo.title}': diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart index 4e1b26e56..40fde4e64 100644 --- a/uni/lib/model/entities/library_reservation.dart +++ b/uni/lib/model/entities/library_reservation.dart @@ -1,4 +1,3 @@ - /// Private room reservation from the library class LibraryReservation { final String room; @@ -9,9 +8,9 @@ class LibraryReservation { Map toMap() { final Map map = { - 'room' : room, - 'startDate' : startDate.millisecondsSinceEpoch, - 'duration' : duration.inHours, + 'room': room, + 'startDate': startDate.toIso8601String(), + 'duration': duration.inMinutes, }; return map; } @@ -22,13 +21,13 @@ class LibraryReservation { } @override - bool operator == (Object other){ - return other is LibraryReservation - && room == other.room - && (startDate.compareTo(other.startDate) == 0) - && (duration.compareTo(other.duration) == 0); + bool operator ==(Object other) { + return other is LibraryReservation && + room == other.room && + (startDate.compareTo(other.startDate) == 0) && + (duration.compareTo(other.duration) == 0); } @override - int get hashCode => Object.hash(room, startDate, duration); -} \ No newline at end of file + int get hashCode => Object.hash(room, startDate, duration); +} diff --git a/uni/lib/model/providers/library_reservations_provider.dart b/uni/lib/model/providers/library_reservations_provider.dart index 8f224fda5..ff74b2f5e 100644 --- a/uni/lib/model/providers/library_reservations_provider.dart +++ b/uni/lib/model/providers/library_reservations_provider.dart @@ -21,14 +21,14 @@ class LibraryReservationsProvider extends StateProviderNotifier { updateStatus(RequestStatus.busy); final List reservations = - await LibraryReservationsFetcherHtml() - .getReservations(session); + await LibraryReservationsFetcherHtml().getReservations(session); + + notifyListeners(); final LibraryReservationDatabase db = LibraryReservationDatabase(); db.saveReservations(reservations); _reservations = reservations; - notifyListeners(); updateStatus(RequestStatus.successful); } catch (e) { Logger().e('Failed to get Reservations: ${e.toString()}'); diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index f783b8487..8a5d15f65 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -7,26 +7,30 @@ import 'package:uni/view/library/widgets/library_occupation_tab.dart'; import 'package:uni/view/library/widgets/library_reservations_tab.dart'; class LibraryPage extends StatefulWidget { - final bool startOnOccupation; - const LibraryPage({this.startOnOccupation = false, Key? key}) : super(key: key); + final bool startOnOccupationTab; + const LibraryPage({this.startOnOccupationTab = false, Key? key}) : super(key: key); @override State createState() => LibraryPageViewState(); } class LibraryPageViewState extends GeneralPageViewState { - @override - Widget getBody(BuildContext context) { - const List tabs = [ + late final List tabs; + + LibraryPageViewState() { + tabs = const [ Tab(text: 'Ocupação'), Tab(text: 'Gabinetes'), ]; + } + @override + Widget getBody(BuildContext context) { return DefaultTabController( length: tabs.length, child: Builder(builder: (BuildContext context) { final TabController? tabController = DefaultTabController.of(context); - if (widget.startOnOccupation) { + if (widget.startOnOccupationTab) { tabController!.index = 1; } return Column(children: [ diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index 8f78bbf68..b745fe161 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -49,8 +49,10 @@ class LibraryOccupationTabView extends StatelessWidget { shrinkWrap: true, children: [ LibraryOccupationCard(), - if (occupation != null) const PageTitle(name: 'Pisos'), - if (occupation != null) FloorRows(occupation!), + if (occupation != null) ...[ + const PageTitle(name: 'Pisos'), + FloorRows(occupation!), + ] ]); } } @@ -62,17 +64,14 @@ class FloorRows extends StatelessWidget { @override Widget build(BuildContext context) { - final List floors = []; - for (int i = 1; i < occupation.floors.length; i += 2) { - floors.add(Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FloorCard(occupation.getFloor(i)), - FloorCard(occupation.getFloor(i + 1)) - ])); - } - return Column( - children: floors, + return GridView.count( + crossAxisCount: 2, + shrinkWrap: true, + padding: const EdgeInsets.symmetric(horizontal: 25), + crossAxisSpacing: 25, + mainAxisSpacing: 5, + physics: const NeverScrollableScrollPhysics(), + children: occupation.floors.map((floor) => FloorCard(floor)).toList(), ); } } diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index f834af41c..6cbacf4ae 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -42,13 +42,13 @@ class LibraryReservationsTabView extends StatelessWidget { scrollDirection: Axis.vertical, shrinkWrap: true, children: [ - LibraryReservationsList(reservations), + LibraryReservationsList(reservations!), ]); } } class LibraryReservationsList extends StatelessWidget { - final List? reservations; + final List reservations; const LibraryReservationsList(this.reservations, {super.key}); @@ -56,7 +56,7 @@ class LibraryReservationsList extends StatelessWidget { Widget build(BuildContext context) { final List rooms = []; - for (int i = 0; i < reservations!.length && i < 2; i++) { + for (int i = 0; i < reservations.length && i < 2; i++) { rooms.add(Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( @@ -64,7 +64,7 @@ class LibraryReservationsList extends StatelessWidget { bottom: BorderSide( color: Theme.of(context).dividerColor, width: 1))), margin: const EdgeInsets.all(8), - child: ReservationRow(reservations![i]))); + child: ReservationRow(reservations[i]))); } return Column(children: rooms); diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 1e410bf39..ea645f83f 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -5,7 +5,7 @@ import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/time_utilities.dart'; class ReservationRow extends StatelessWidget { - final LibraryReservation? reservation; + final LibraryReservation reservation; late final String hoursStart; late final String hoursEnd; late final String weekDay; @@ -13,14 +13,14 @@ class ReservationRow extends StatelessWidget { late final String month; ReservationRow(this.reservation, {super.key}) { - hoursStart = DateFormat('HH:mm').format(reservation!.startDate); + hoursStart = DateFormat('HH:mm').format(reservation.startDate); hoursEnd = DateFormat('HH:mm') - .format(reservation!.startDate.add(reservation!.duration)); + .format(reservation.startDate.add(reservation.duration)); weekDay = TimeString.getWeekdaysStrings( - startMonday: false)[reservation!.startDate.weekday]; - day = DateFormat('dd').format(reservation!.startDate); + startMonday: false)[reservation.startDate.weekday]; + day = DateFormat('dd').format(reservation.startDate); initializeDateFormatting(); - month = DateFormat('MMMM', 'pt').format(reservation!.startDate); + month = DateFormat('MMMM', 'pt').format(reservation.startDate); } @override @@ -42,7 +42,7 @@ class ReservationRow extends StatelessWidget { ]), Column( children: [ - Text(reservation!.room, + Text(reservation.room, //textAlign: TextAlign.center, style: Theme.of(context) .textTheme From aad69aba5a96d82f3c66f9974e7eecdef8c2889e Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 12 Apr 2023 14:07:30 +0100 Subject: [PATCH 15/45] Finished requested changes --- uni/lib/model/providers/library_reservations_provider.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uni/lib/model/providers/library_reservations_provider.dart b/uni/lib/model/providers/library_reservations_provider.dart index ff74b2f5e..bd6b488f1 100644 --- a/uni/lib/model/providers/library_reservations_provider.dart +++ b/uni/lib/model/providers/library_reservations_provider.dart @@ -11,7 +11,7 @@ import 'package:uni/model/request_status.dart'; class LibraryReservationsProvider extends StateProviderNotifier { List? _reservations; - List? get reservations => _reservations; + List get reservations => _reservations ?? []; void getLibraryReservations( Session session, @@ -23,11 +23,10 @@ class LibraryReservationsProvider extends StateProviderNotifier { final List reservations = await LibraryReservationsFetcherHtml().getReservations(session); - notifyListeners(); - final LibraryReservationDatabase db = LibraryReservationDatabase(); db.saveReservations(reservations); + notifyListeners(); _reservations = reservations; updateStatus(RequestStatus.successful); } catch (e) { From 9723a9b2518625936bed5cdcac533c459267f7fe Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 12 Apr 2023 14:51:54 +0100 Subject: [PATCH 16/45] Fixed linter issues --- uni/lib/view/library/widgets/library_reservations_card.dart | 3 +-- uni/lib/view/library/widgets/library_reservations_tab.dart | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 8f04b99e9..1dd4fcfb3 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -25,8 +25,7 @@ class LibraryReservationsCard extends GenericCard { Widget buildCardContent(BuildContext context) { return Consumer ( builder: (context, reservationsProvider, _) { - if (reservationsProvider.reservations == null - || reservationsProvider.status == RequestStatus.busy) { + if (reservationsProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { return RoomsList(reservationsProvider.reservations); diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index 6cbacf4ae..4af366f32 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -12,8 +12,7 @@ class LibraryReservationsTab extends StatelessWidget { Widget build(BuildContext context) { return Consumer( builder: (context, reservationsProvider, _) { - if (reservationsProvider.reservations == null || - reservationsProvider.status == RequestStatus.busy) { + if (reservationsProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { return LibraryReservationsTabView(reservationsProvider.reservations); From 7456117912adfd931be5237f005b5610a4811b79 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 26 Apr 2023 14:51:01 +0100 Subject: [PATCH 17/45] Finished reservations --- .../fetchers/library_reservation_fetcher.dart | 4 +- .../app_library_reservation.dart | 1 + .../parsers/parser_library_reservation.dart | 26 +++++-- .../model/entities/library_reservation.dart | 13 ++-- .../library_reservations_provider.dart | 22 ++++++ .../view/library/widgets/reservation_row.dart | 73 ++++++++++++++++--- 6 files changed, 112 insertions(+), 27 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index ee286c029..4c17449de 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -16,8 +16,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { return [url]; } - Future> getReservations( - Session session) async { + Future> getReservations(Session session) async { final String baseUrl = getEndpoints(session)[0]; final Future response = NetworkRouter.getWithCookies(baseUrl, {}, session); @@ -26,4 +25,5 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { return reservations; } + } diff --git a/uni/lib/controller/local_storage/app_library_reservation.dart b/uni/lib/controller/local_storage/app_library_reservation.dart index aa514f6e1..52858b1c7 100644 --- a/uni/lib/controller/local_storage/app_library_reservation.dart +++ b/uni/lib/controller/local_storage/app_library_reservation.dart @@ -36,6 +36,7 @@ class LibraryReservationDatabase extends AppDatabase { for (int i = 0; i < items.length; i++) { final int minutes = items[i]['duration']; reservations.add(LibraryReservation( + items[i]['id'], items[i]['room'], DateTime.parse(items[i]['startDate']), Duration(hours: minutes ~/ 60, minutes: minutes % 60))); diff --git a/uni/lib/controller/parsers/parser_library_reservation.dart b/uni/lib/controller/parsers/parser_library_reservation.dart index ffd7872c3..511ed6520 100644 --- a/uni/lib/controller/parsers/parser_library_reservation.dart +++ b/uni/lib/controller/parsers/parser_library_reservation.dart @@ -9,16 +9,28 @@ Future> getReservationsFromHtml(Response response) asyn final List reservationHtml = document.getElementsByClassName('d interior'); - return reservationHtml.map( (element) { - final String? room = element.children[5].firstChild?.text; - final String? date = element.children[0].firstChild?.text; - final String? hour = element.children[2].firstChild?.text; + + final List idHtml = + document.querySelectorAll('tbody > tr') + .where((element) => ( + element.children.length == 12 + && element.children[11].firstChild!.text == 'Reservado' + )).toList(); + + final List result = []; + for (int i = 0; i < reservationHtml.length && i < idHtml.length; i++) { + final String? room = reservationHtml[i].children[5].firstChild!.text; + final String? date = reservationHtml[i].children[0].firstChild!.text; + final String? hour = reservationHtml[i].children[2].firstChild!.text; + final String? idRef = idHtml[i].children[11].firstChild!.attributes['href']; + final String id = idRef!.split('=')[1]; final DateTime startDate = DateTime.parse('$date $hour'); - final String? durationHtml = element.children[4].firstChild?.text; + final String? durationHtml = reservationHtml[i].children[4].firstChild!.text; final Duration duration = Duration( hours: int.parse(durationHtml!.substring(0,2)), minutes: int.parse(durationHtml.substring(3,5)) ); - return LibraryReservation(room!, startDate, duration); - }).toList(); + result.add(LibraryReservation(id, room!, startDate, duration)); + } + return result; } \ No newline at end of file diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart index 40fde4e64..94224de3e 100644 --- a/uni/lib/model/entities/library_reservation.dart +++ b/uni/lib/model/entities/library_reservation.dart @@ -1,13 +1,15 @@ /// Private room reservation from the library class LibraryReservation { + final String _id; final String room; final DateTime startDate; final Duration duration; - LibraryReservation(this.room, this.startDate, this.duration); + LibraryReservation(this._id, this.room, this.startDate, this.duration); Map toMap() { final Map map = { + 'id': id, 'room': room, 'startDate': startDate.toIso8601String(), 'duration': duration.inMinutes, @@ -15,17 +17,16 @@ class LibraryReservation { return map; } + String get id => _id; + @override String toString() { - return '$room, $startDate, $duration'; + return '$_id, $room, $startDate, $duration'; } @override bool operator ==(Object other) { - return other is LibraryReservation && - room == other.room && - (startDate.compareTo(other.startDate) == 0) && - (duration.compareTo(other.duration) == 0); + return other is LibraryReservation && _id == other.id; } @override diff --git a/uni/lib/model/providers/library_reservations_provider.dart b/uni/lib/model/providers/library_reservations_provider.dart index bd6b488f1..f9dc5d166 100644 --- a/uni/lib/model/providers/library_reservations_provider.dart +++ b/uni/lib/model/providers/library_reservations_provider.dart @@ -1,8 +1,10 @@ import 'dart:async'; +import 'package:http/http.dart'; import 'package:logger/logger.dart'; import 'package:uni/controller/fetchers/library_reservation_fetcher.dart'; import 'package:uni/controller/local_storage/app_library_reservation.dart'; +import 'package:uni/controller/networking/network_router.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/session.dart'; import 'package:uni/model/providers/state_provider_notifier.dart'; @@ -43,4 +45,24 @@ class LibraryReservationsProvider extends StateProviderNotifier { _reservations = reservations; notifyListeners(); } + + Future cancelReservation(Session session, String id) async { + final url = + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; + + final Map headers = {}; + headers['cookie'] = session.cookies; + headers['content-type'] = 'application/x-www-form-urlencoded'; + + final Response response = + await NetworkRouter.getWithCookies(url, {}, session); + + if (response.statusCode == 200) { + _reservations! + .remove(_reservations!.firstWhere((element) => element.id == id)); + notifyListeners(); + return true; + } + return false; + } } diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index ea645f83f..8009a26d5 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -1,8 +1,16 @@ import 'package:flutter/material.dart'; +import 'package:http/http.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:uni/controller/fetchers/library_reservation_fetcher.dart'; import 'package:uni/model/entities/library_reservation.dart'; +import 'package:uni/model/entities/session.dart'; import 'package:uni/model/entities/time_utilities.dart'; +import 'package:uni/model/providers/library_reservations_provider.dart'; +import 'package:uni/model/providers/session_provider.dart'; +import 'package:uni/model/providers/state_providers.dart'; +import 'package:uni/view/common_widgets/toast_message.dart'; class ReservationRow extends StatelessWidget { final LibraryReservation reservation; @@ -55,26 +63,67 @@ class ReservationRow extends StatelessWidget { ) ], ), - const ReservationRemoveButton() + ReservationRemoveButton(reservation) ]); } } class ReservationRemoveButton extends StatelessWidget { - const ReservationRemoveButton({super.key}); + final LibraryReservation reservation; + + const ReservationRemoveButton(this.reservation, {super.key}); @override Widget build(BuildContext context) { return IconButton( - constraints: const BoxConstraints( - minHeight: kMinInteractiveDimension / 3, - minWidth: kMinInteractiveDimension / 3), - icon: const Icon(Icons.close), - iconSize: 24, - color: Colors.grey, - alignment: Alignment.centerRight, - tooltip: 'Cancelar reserva', - onPressed: () => {}, - ); + constraints: const BoxConstraints( + minHeight: kMinInteractiveDimension / 3, + minWidth: kMinInteractiveDimension / 3), + icon: const Icon(Icons.close), + iconSize: 24, + color: Colors.grey, + alignment: Alignment.centerRight, + tooltip: 'Cancelar reserva', + onPressed: () { + showDialog( + context: context, + builder: (BuildContext toastContext) { + return AlertDialog( + content: Text( + 'Queres cancelar este pedido?', + style: Theme.of(context).textTheme.subtitle1, + ), + actions: [ + Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + TextButton( + onPressed: () => Navigator.of(toastContext).pop(), + child: const Text('Voltar')), + ElevatedButton( + child: const Text('Cancelar'), + onPressed: () async { + cancelReservation(context, reservation.id); + }) + ]) + ], + ); + }); + }); + } + + cancelReservation(context, String id) async { + final Session session = + Provider.of(context, listen: false).session; + + final stateProviders = StateProviders.fromContext(context); + final bool result = await stateProviders.libraryReservationsProvider + .cancelReservation(session, id); + + if (result) { + Navigator.of(context).pop(false); + return ToastMessage.success(context, 'A reserva foi cancelada!'); + } else { + return ToastMessage.error( + context, 'Ocorreu um erro ao cancelar a reserva!'); + } } } From 68939933e90e54d3691d1efedaa878325139416d Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 26 Apr 2023 15:48:36 +0100 Subject: [PATCH 18/45] Fixed linter issues --- uni/lib/view/library/widgets/reservation_row.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 8009a26d5..094581afd 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -1,13 +1,10 @@ import 'package:flutter/material.dart'; -import 'package:http/http.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; -import 'package:uni/controller/fetchers/library_reservation_fetcher.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/entities/session.dart'; import 'package:uni/model/entities/time_utilities.dart'; -import 'package:uni/model/providers/library_reservations_provider.dart'; import 'package:uni/model/providers/session_provider.dart'; import 'package:uni/model/providers/state_providers.dart'; import 'package:uni/view/common_widgets/toast_message.dart'; @@ -99,7 +96,7 @@ class ReservationRemoveButton extends StatelessWidget { onPressed: () => Navigator.of(toastContext).pop(), child: const Text('Voltar')), ElevatedButton( - child: const Text('Cancelar'), + child: const Text('Confirmar'), onPressed: () async { cancelReservation(context, reservation.id); }) From 1a553fc7041adb641c58f8fc7fa325834917f060 Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 9 May 2023 09:07:46 +0100 Subject: [PATCH 19/45] Removed nullable type from RoomList --- .../view/library/widgets/library_reservations_card.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 1dd4fcfb3..51ceb1927 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -35,13 +35,13 @@ class LibraryReservationsCard extends GenericCard { } class RoomsList extends StatelessWidget { - final List? reservations; + final List reservations; const RoomsList(this.reservations, {super.key}); @override Widget build(context) { - if (reservations == null || reservations!.isEmpty) { + if (reservations.isEmpty) { return Center( child: Text('Não tens salas reservadas!', style: Theme.of(context).textTheme.headline6, @@ -49,7 +49,7 @@ class RoomsList extends StatelessWidget { } final List rooms = []; - for (int i = 0; i < reservations!.length && i < 2; i++) { + for (int i = 0; i < reservations.length && i < 2; i++) { rooms.add(Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( @@ -57,7 +57,7 @@ class RoomsList extends StatelessWidget { Border.all(color: Theme.of(context).dividerColor, width: 0.5), borderRadius: const BorderRadius.all(Radius.circular(7))), margin: const EdgeInsets.all(8), - child: ReservationRow(reservations![i]))); + child: ReservationRow(reservations[i]))); } return Column(children: rooms); From 34aac7246da9a519206fa1b7df7a43036768d99d Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 21 Jun 2023 11:17:50 +0100 Subject: [PATCH 20/45] Remove redundant reservation duration from db --- uni/lib/controller/local_storage/app_library_reservation.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uni/lib/controller/local_storage/app_library_reservation.dart b/uni/lib/controller/local_storage/app_library_reservation.dart index aa514f6e1..43e89a193 100644 --- a/uni/lib/controller/local_storage/app_library_reservation.dart +++ b/uni/lib/controller/local_storage/app_library_reservation.dart @@ -10,8 +10,7 @@ class LibraryReservationDatabase extends AppDatabase { id INTEGER PRIMARY KEY AUTOINCREMENT, room TEXT, startDate TEXT, - duration_hours INT, - duration_minutes INT + duration INT ) ''' ]); From 4c0f4b029780159ed1e9ecb79aa258905c167f88 Mon Sep 17 00:00:00 2001 From: luis Date: Sat, 26 Aug 2023 09:27:37 +0100 Subject: [PATCH 21/45] Merge branch 'develop' --- .../fetchers/library_reservation_fetcher.dart | 3 +- .../parsers/parser_library_reservation.dart | 14 ++-- uni/lib/main.dart | 13 ++-- .../lazy/library_reservations_provider.dart | 8 +-- uni/lib/view/library/library.dart | 66 +++++++++++++++---- .../widgets/library_occupation_card.dart | 4 +- .../widgets/library_occupation_tab.dart | 6 ++ .../widgets/library_reservations_card.dart | 43 +++++++----- .../widgets/library_reservations_tab.dart | 33 +++++----- 9 files changed, 121 insertions(+), 69 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index ee286c029..2826c7c2d 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -16,8 +16,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { return [url]; } - Future> getReservations( - Session session) async { + Future> getReservations(Session session) async { final String baseUrl = getEndpoints(session)[0]; final Future response = NetworkRouter.getWithCookies(baseUrl, {}, session); diff --git a/uni/lib/controller/parsers/parser_library_reservation.dart b/uni/lib/controller/parsers/parser_library_reservation.dart index ffd7872c3..f5230a5f0 100644 --- a/uni/lib/controller/parsers/parser_library_reservation.dart +++ b/uni/lib/controller/parsers/parser_library_reservation.dart @@ -3,22 +3,22 @@ import 'package:html/dom.dart'; import 'package:html/parser.dart'; import 'package:uni/model/entities/library_reservation.dart'; -Future> getReservationsFromHtml(Response response) async { +Future> getReservationsFromHtml( + Response response) async { final document = parse(response.body); final List reservationHtml = - document.getElementsByClassName('d interior'); + document.getElementsByClassName('d interior'); - return reservationHtml.map( (element) { + return reservationHtml.map((element) { final String? room = element.children[5].firstChild?.text; final String? date = element.children[0].firstChild?.text; final String? hour = element.children[2].firstChild?.text; final DateTime startDate = DateTime.parse('$date $hour'); final String? durationHtml = element.children[4].firstChild?.text; final Duration duration = Duration( - hours: int.parse(durationHtml!.substring(0,2)), - minutes: int.parse(durationHtml.substring(3,5)) - ); + hours: int.parse(durationHtml!.substring(0, 2)), + minutes: int.parse(durationHtml.substring(3, 5))); return LibraryReservation(room!, startDate, duration); }).toList(); -} \ No newline at end of file +} diff --git a/uni/lib/main.dart b/uni/lib/main.dart index ec1f3dbbe..0208aef8a 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -133,8 +133,8 @@ Future main() async { create: (context) => stateProviders.libraryOccupationProvider, ), ChangeNotifierProvider( - create: (context) => - stateProviders.libraryReservationsProvider,), + create: (context) => stateProviders.libraryReservationsProvider, + ), ChangeNotifierProvider( create: (context) => stateProviders.facultyLocationsProvider, ), @@ -231,10 +231,11 @@ class MyAppState extends State { ), '/${DrawerItem.navLibraryReservations.title}': PageTransition.makePageTransition( - page: const LibraryPageView( - startOnOccupationTab: true, - ), - settings: settings,), + page: const LibraryPageView( + startOnOccupationTab: false, + ), + settings: settings, + ), '/${DrawerItem.navUsefulInfo.title}': PageTransition.makePageTransition( page: const UsefulInfoPageView(), diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 63bd6556f..d2d172b24 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -17,8 +17,8 @@ class LibraryReservationsProvider extends StateProviderNotifier { @override Future loadFromStorage() async { - final LibraryReservationDatabase db = LibraryReservationDatabase(); - final List reservations = await db.reservations(); + final db = LibraryReservationDatabase(); + final reservations = await db.reservations(); _reservations = reservations; } @@ -35,8 +35,8 @@ class LibraryReservationsProvider extends StateProviderNotifier { _reservations = await LibraryReservationsFetcherHtml().getReservations(session); - final LibraryReservationDatabase db = LibraryReservationDatabase(); - db.saveReservations(reservations); + final db = LibraryReservationDatabase(); + unawaited(db.saveReservations(reservations)); updateStatus(RequestStatus.successful); } catch (e) { diff --git a/uni/lib/view/library/library.dart b/uni/lib/view/library/library.dart index c84e86f30..7c9b21449 100644 --- a/uni/lib/view/library/library.dart +++ b/uni/lib/view/library/library.dart @@ -1,39 +1,77 @@ import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:uni/model/providers/lazy/library_occupation_provider.dart'; +import 'package:uni/utils/drawer_items.dart'; +import 'package:uni/view/common_widgets/page_title.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; -import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/library/widgets/library_occupation_tab.dart'; +import 'package:uni/view/library/widgets/library_reservations_tab.dart'; class LibraryPageView extends StatefulWidget { + const LibraryPageView({this.startOnOccupationTab = true, super.key}); final bool startOnOccupationTab; - const LibraryPageView({this.startOnOccupationTab = false, Key? key}) - : super(key: key); @override State createState() => LibraryPageViewState(); } class LibraryPageViewState extends GeneralPageViewState { - late final List tabs; - LibraryPageViewState() { tabs = const [ Tab(text: 'Ocupação'), Tab(text: 'Gabinetes'), ]; } + late TabController tabController; + late final List tabs; + static const LibraryOccupationTab _libraryOccupationTab = + LibraryOccupationTab(); + static const LibraryReservationsTab _libraryReservationTab = + LibraryReservationsTab(); @override - Widget getBody(BuildContext context) { - return LazyConsumer( - builder: (context, libraryOccupationProvider) => - LibraryOccupationTab()); + Future onRefresh(BuildContext context) { + if (tabController.index == 0) { + return _libraryOccupationTab.refresh(context); + } else { + return _libraryReservationTab.refresh(context); + } } @override - Future onRefresh(BuildContext context) { - return Provider.of(context, listen: false) - .forceRefresh(context); + Widget getBody(BuildContext context) { + return DefaultTabController( + length: tabs.length, + child: Builder( + builder: (BuildContext context) { + tabController = DefaultTabController.of(context); + if (!widget.startOnOccupationTab) { + tabController.index = 1; + } + return Column( + children: [ + ListView( + shrinkWrap: true, + children: [ + PageTitle(name: DrawerItem.navLibraryOccupation.title), + TabBar( + controller: tabController, + physics: const BouncingScrollPhysics(), + tabs: tabs, + ), + ], + ), + Expanded( + child: TabBarView( + controller: tabController, + children: const [ + _libraryOccupationTab, + _libraryReservationTab, + ], + ), + ), + ], + ); + }, + ), + ); } } diff --git a/uni/lib/view/library/widgets/library_occupation_card.dart b/uni/lib/view/library/widgets/library_occupation_card.dart index 834e14918..9708bb9f6 100644 --- a/uni/lib/view/library/widgets/library_occupation_card.dart +++ b/uni/lib/view/library/widgets/library_occupation_card.dart @@ -24,7 +24,9 @@ class LibraryOccupationCard extends GenericCard { @override Future onClick(BuildContext context) => Navigator.pushNamed( - context, '/${DrawerItem.navLibraryReservations.title}',); + context, + '/${DrawerItem.navLibraryReservations.title}', + ); @override void onRefresh(BuildContext context) { diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index b1964340a..1af399750 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:percent_indicator/linear_percent_indicator.dart'; +import 'package:provider/provider.dart'; import 'package:uni/model/entities/library_occupation.dart'; import 'package:uni/model/providers/lazy/library_occupation_provider.dart'; import 'package:uni/model/request_status.dart'; @@ -12,6 +13,11 @@ class LibraryOccupationTab extends StatefulWidget { @override LibraryOccupationTabState createState() => LibraryOccupationTabState(); + + Future refresh(BuildContext context) async { + await Provider.of(context, listen: false) + .forceRefresh(context); + } } class LibraryOccupationTabState extends State { diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 6bc8c0496..49a858017 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -18,7 +18,9 @@ class LibraryReservationsCard extends GenericCard { @override Future onClick(BuildContext context) => Navigator.pushNamed( - context, '/${DrawerItem.navLibraryReservations.title}',); + context, + '/${DrawerItem.navLibraryReservations.title}', + ); @override String getTitle() => 'Gabinetes Reservados'; @@ -31,19 +33,19 @@ class LibraryReservationsCard extends GenericCard { @override Widget buildCardContent(BuildContext context) { - return Consumer ( + return Consumer( builder: (context, reservationsProvider, _) { - if (reservationsProvider.status == RequestStatus.busy) { - return const Center(child: CircularProgressIndicator()); - } else { - return RoomsList(reservationsProvider.reservations); - } - },); + if (reservationsProvider.status == RequestStatus.busy) { + return const Center(child: CircularProgressIndicator()); + } else { + return RoomsList(reservationsProvider.reservations); + } + }, + ); } } class RoomsList extends StatelessWidget { - const RoomsList(this.reservations, {super.key}); final List reservations; @@ -51,21 +53,28 @@ class RoomsList extends StatelessWidget { Widget build(BuildContext context) { if (reservations.isEmpty) { return Center( - child: Text('Não tens salas reservadas!', - style: Theme.of(context).textTheme.titleLarge, - textAlign: TextAlign.center,),); + child: Text( + 'Não tens salas reservadas!', + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center, + ), + ); } final rooms = []; for (var i = 0; i < reservations.length && i < 2; i++) { - rooms.add(Container( + rooms.add( + Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( - border: - Border.all(color: Theme.of(context).dividerColor, width: 0.5), - borderRadius: const BorderRadius.all(Radius.circular(7)),), + border: + Border.all(color: Theme.of(context).dividerColor, width: 0.5), + borderRadius: const BorderRadius.all(Radius.circular(7)), + ), margin: const EdgeInsets.all(8), - child: ReservationRow(reservations[i]),),); + child: ReservationRow(reservations[i]), + ), + ); } return Column(children: rooms); diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index aa66a4292..30c064146 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/providers/lazy/library_reservations_provider.dart'; -import 'package:uni/model/request_status.dart'; +import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/library/widgets/reservation_row.dart'; class LibraryReservationsTab extends StatelessWidget { @@ -10,21 +10,22 @@ class LibraryReservationsTab extends StatelessWidget { @override Widget build(BuildContext context) { - return Consumer( - builder: (context, reservationsProvider, _) { - if (reservationsProvider.status == RequestStatus.busy) { - return const Center(child: CircularProgressIndicator()); - } else { + return LazyConsumer( + builder: (context, reservationsProvider) { return LibraryReservationsTabView(reservationsProvider.reservations); - } - }); + }, + ); + } + + Future refresh(BuildContext context) async { + await Provider.of(context, listen: false) + .forceRefresh(context); } } class LibraryReservationsTabView extends StatelessWidget { - final List? reservations; - const LibraryReservationsTabView(this.reservations, {super.key}); + final List? reservations; @override Widget build(BuildContext context) { @@ -37,19 +38,15 @@ class LibraryReservationsTabView extends StatelessWidget { textAlign: TextAlign.center)) ]); } - return ListView( - scrollDirection: Axis.vertical, - shrinkWrap: true, - children: [ - LibraryReservationsList(reservations!), - ]); + return ListView(shrinkWrap: true, children: [ + LibraryReservationsList(reservations!), + ]); } } class LibraryReservationsList extends StatelessWidget { - final List reservations; - const LibraryReservationsList(this.reservations, {super.key}); + final List reservations; @override Widget build(BuildContext context) { From 37ab2c176e2e8cf0efa69d2f0bda301c66915e1b Mon Sep 17 00:00:00 2001 From: luis Date: Sat, 26 Aug 2023 11:48:11 +0100 Subject: [PATCH 22/45] Made small adjustements to reservation cancelling --- .../fetchers/library_reservation_fetcher.dart | 10 +++------- .../providers/lazy/library_reservations_provider.dart | 8 +++++--- uni/lib/view/library/widgets/reservation_row.dart | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index 4c17449de..ecd52d3fd 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -1,4 +1,3 @@ -import 'package:http/http.dart'; import 'package:uni/controller/fetchers/session_dependant_fetcher.dart'; import 'package:uni/controller/networking/network_router.dart'; import 'package:uni/controller/parsers/parser_library_reservation.dart'; @@ -17,13 +16,10 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { } Future> getReservations(Session session) async { - final String baseUrl = getEndpoints(session)[0]; - final Future response = - NetworkRouter.getWithCookies(baseUrl, {}, session); - final List reservations = - await response.then((response) => getReservationsFromHtml(response)); + final baseUrl = getEndpoints(session)[0]; + final response = NetworkRouter.getWithCookies(baseUrl, {}, session); + final reservations = await response.then(getReservationsFromHtml); return reservations; } - } diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 38070d7c4..827556d17 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -12,7 +12,7 @@ import 'package:uni/model/request_status.dart'; class LibraryReservationsProvider extends StateProviderNotifier { LibraryReservationsProvider() : super(dependsOnSession: true, cacheDuration: const Duration(hours: 1)); - List? _reservations; + List _reservations = []; List get reservations => _reservations ?? []; @@ -56,9 +56,11 @@ class LibraryReservationsProvider extends StateProviderNotifier { final response = await NetworkRouter.getWithCookies(url, {}, session); if (response.statusCode == 200) { - _reservations! - .remove(_reservations!.firstWhere((element) => element.id == id)); + _reservations + .remove(_reservations.firstWhere((element) => element.id == id)); notifyListeners(); + final db = LibraryReservationDatabase(); + unawaited(db.saveReservations(reservations)); return true; } return false; diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 17134991d..7ff7f84ea 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -115,7 +115,7 @@ class _ReservationRemoveButtonState extends State { child: const Text('Voltar'), ), ElevatedButton( - child: const Text('Confirmar'), + child: const Text('Sim'), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); cancelReservation(widget.reservation.id); @@ -139,9 +139,9 @@ class _ReservationRemoveButtonState extends State { final session = Provider.of(widget.context, listen: false).session; final result = await Provider.of( - widget.context, - listen: false) - .cancelReservation(session, id); + widget.context, + listen: false, + ).cancelReservation(session, id); await displayToast(success: result); } From f64edb7bc7cb00a2dbde9822a0f2c982b15b5b51 Mon Sep 17 00:00:00 2001 From: luis Date: Sat, 26 Aug 2023 12:00:05 +0100 Subject: [PATCH 23/45] Worked on linter issues --- uni/lib/model/providers/lazy/library_reservations_provider.dart | 2 +- uni/lib/view/library/widgets/reservation_row.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 827556d17..177ac5e6b 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -14,7 +14,7 @@ class LibraryReservationsProvider extends StateProviderNotifier { : super(dependsOnSession: true, cacheDuration: const Duration(hours: 1)); List _reservations = []; - List get reservations => _reservations ?? []; + List get reservations => _reservations; @override Future loadFromStorage() async { diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 7ff7f84ea..ac878931e 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -67,6 +67,7 @@ class ReservationRow extends StatelessWidget { } } +//ignore: must_be_immutable class ReservationRemoveButton extends StatefulWidget { ReservationRemoveButton(this.reservation, {super.key}); final LibraryReservation reservation; From 7f68904841b166574e153283a5f548cf27b9f11b Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 27 Aug 2023 10:15:56 +0100 Subject: [PATCH 24/45] Fixed linter issues --- .../fetchers/library_reservation_fetcher.dart | 3 ++- uni/lib/model/entities/library_reservation.dart | 4 ++-- .../lazy/library_reservations_provider.dart | 1 + .../widgets/library_reservations_tab.dart | 16 ++++++++-------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index ecd52d3fd..b7b3f16e4 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -10,7 +10,8 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { List getEndpoints(Session session) { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers - final String url = + // ignore: lines_longer_than_80_chars + final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart index c30715db8..a9e187b21 100644 --- a/uni/lib/model/entities/library_reservation.dart +++ b/uni/lib/model/entities/library_reservation.dart @@ -1,12 +1,12 @@ /// Private room reservation from the library class LibraryReservation { + + LibraryReservation(this._id, this.room, this.startDate, this.duration); final String _id; final String room; final DateTime startDate; final Duration duration; - LibraryReservation(this._id, this.room, this.startDate, this.duration); - Map toMap() { final map = { 'id': id, diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 177ac5e6b..d0024e94b 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -46,6 +46,7 @@ class LibraryReservationsProvider extends StateProviderNotifier { } Future cancelReservation(Session session, String id) async { + // ignore: lines_longer_than_80_chars final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index 3c03b40b2..ac902a553 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -30,17 +30,17 @@ class LibraryReservationsTabView extends StatelessWidget { @override Widget build(BuildContext context) { if (reservations == null || reservations!.isEmpty) { - return ListView(scrollDirection: Axis.vertical, children: [ + return ListView(children: [ Center( heightFactor: 2, child: Text('Não tens salas reservadas', - style: Theme.of(context).textTheme.headline6, - textAlign: TextAlign.center)) - ]); + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center,),), + ],); } return ListView(shrinkWrap: true, children: [ LibraryReservationsList(reservations!), - ]); + ],); } } @@ -52,15 +52,15 @@ class LibraryReservationsList extends StatelessWidget { Widget build(BuildContext context) { final rooms = []; - for (int i = 0; i < reservations.length; i++) { + for (var i = 0; i < reservations.length; i++) { rooms.add(Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: Theme.of(context).dividerColor, width: 1))), + color: Theme.of(context).dividerColor,),),), margin: const EdgeInsets.all(8), - child: ReservationRow(reservations[i]))); + child: ReservationRow(reservations[i]),),); } return Column(children: rooms); From 47b39d601fc1fc5fad5d6fc7d56604d0a983154e Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 27 Aug 2023 10:27:13 +0100 Subject: [PATCH 25/45] Formatted files --- .../model/entities/library_reservation.dart | 1 - .../widgets/library_reservations_tab.dart | 42 ++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/uni/lib/model/entities/library_reservation.dart b/uni/lib/model/entities/library_reservation.dart index a9e187b21..4cca881ee 100644 --- a/uni/lib/model/entities/library_reservation.dart +++ b/uni/lib/model/entities/library_reservation.dart @@ -1,6 +1,5 @@ /// Private room reservation from the library class LibraryReservation { - LibraryReservation(this._id, this.room, this.startDate, this.duration); final String _id; final String room; diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index ac902a553..55823090f 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -30,17 +30,25 @@ class LibraryReservationsTabView extends StatelessWidget { @override Widget build(BuildContext context) { if (reservations == null || reservations!.isEmpty) { - return ListView(children: [ - Center( + return ListView( + children: [ + Center( heightFactor: 2, - child: Text('Não tens salas reservadas', - style: Theme.of(context).textTheme.titleLarge, - textAlign: TextAlign.center,),), - ],); + child: Text( + 'Não tens salas reservadas', + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center, + ), + ), + ], + ); } - return ListView(shrinkWrap: true, children: [ - LibraryReservationsList(reservations!), - ],); + return ListView( + shrinkWrap: true, + children: [ + LibraryReservationsList(reservations!), + ], + ); } } @@ -53,14 +61,20 @@ class LibraryReservationsList extends StatelessWidget { final rooms = []; for (var i = 0; i < reservations.length; i++) { - rooms.add(Container( + rooms.add( + Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor,),),), + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + ), + ), + ), margin: const EdgeInsets.all(8), - child: ReservationRow(reservations[i]),),); + child: ReservationRow(reservations[i]), + ), + ); } return Column(children: rooms); From bd160372b07440fe28cec525dbfeebde4237d7e2 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 20 Sep 2023 15:47:54 +0100 Subject: [PATCH 26/45] Worked on linter issues --- .../fetchers/library_reservation_fetcher.dart | 4 +- .../providers/lazy/bus_stop_provider.dart | 2 +- .../providers/lazy/lecture_provider.dart | 2 +- .../lazy/library_reservations_provider.dart | 3 +- uni/lib/utils/favorite_widget_type.dart | 4 +- uni/lib/view/bug_report/widgets/form.dart | 6 +-- .../view/exams/widgets/exam_page_title.dart | 4 +- .../widgets/library_occupation_tab.dart | 49 +++++++++---------- .../view/restaurant/restaurant_page_view.dart | 4 +- .../useful_info/widgets/other_links_card.dart | 4 +- .../widgets/sigarra_links_card.dart | 4 +- 11 files changed, 41 insertions(+), 45 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index b7b3f16e4..15324dd6b 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -11,9 +11,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers // ignore: lines_longer_than_80_chars - final url = - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; - return [url]; + return ['${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3']; } Future> getReservations(Session session) async { diff --git a/uni/lib/model/providers/lazy/bus_stop_provider.dart b/uni/lib/model/providers/lazy/bus_stop_provider.dart index 1c3b81a61..6df3626c1 100644 --- a/uni/lib/model/providers/lazy/bus_stop_provider.dart +++ b/uni/lib/model/providers/lazy/bus_stop_provider.dart @@ -51,7 +51,7 @@ class BusStopProvider extends StateProviderNotifier { Future addUserBusStop(String stopCode, BusStopData stopData) async { if (_configuredBusStops.containsKey(stopCode)) { - (_configuredBusStops[stopCode]!.configuredBuses).clear(); + _configuredBusStops[stopCode]!.configuredBuses.clear(); _configuredBusStops[stopCode]! .configuredBuses .addAll(stopData.configuredBuses); diff --git a/uni/lib/model/providers/lazy/lecture_provider.dart b/uni/lib/model/providers/lazy/lecture_provider.dart index 101e70022..a9f832a5f 100644 --- a/uni/lib/model/providers/lazy/lecture_provider.dart +++ b/uni/lib/model/providers/lazy/lecture_provider.dart @@ -63,7 +63,7 @@ class LectureProvider extends StateProviderNotifier { Session session, Profile profile, ) => - (fetcher?.getLectures(session, profile)) ?? getLectures(session, profile); + fetcher?.getLectures(session, profile) ?? getLectures(session, profile); Future> getLectures(Session session, Profile profile) { return ScheduleFetcherApi() diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index d0024e94b..b39977595 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -47,8 +47,7 @@ class LibraryReservationsProvider extends StateProviderNotifier { Future cancelReservation(Session session, String id) async { // ignore: lines_longer_than_80_chars - final url = - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; + final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; final headers = {}; headers['cookie'] = session.cookies; diff --git a/uni/lib/utils/favorite_widget_type.dart b/uni/lib/utils/favorite_widget_type.dart index d411057cf..a54325ee0 100644 --- a/uni/lib/utils/favorite_widget_type.dart +++ b/uni/lib/utils/favorite_widget_type.dart @@ -3,8 +3,8 @@ enum FavoriteWidgetType { schedule, printBalance, account, - libraryOccupation(faculties: {"feup"}), - libraryReservations(faculties: {"feup"}), + libraryOccupation(faculties: {'feup'}), + libraryReservations(faculties: {'feup'}), busStops; const FavoriteWidgetType({this.faculties}); diff --git a/uni/lib/view/bug_report/widgets/form.dart b/uni/lib/view/bug_report/widgets/form.dart index ba6748cb6..aa3cffd78 100644 --- a/uni/lib/view/bug_report/widgets/form.dart +++ b/uni/lib/view/bug_report/widgets/form.dart @@ -61,7 +61,7 @@ class BugReportFormState extends State { bugDescriptions.forEach( (int key, Tuple2 tup) => - {bugList.add(DropdownMenuItem(value: key, child: Text(tup.item1)))}, + bugList.add(DropdownMenuItem(value: key, child: Text(tup.item1))), ); } @@ -117,9 +117,9 @@ class BugReportFormState extends State { Widget bugReportTitle(BuildContext context) { return Container( margin: const EdgeInsets.symmetric(vertical: 10), - child: Row( + child: const Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: const [ + children: [ Icon(Icons.bug_report, size: 40), PageTitle(name: 'Bugs e Sugestões', center: false), Icon(Icons.bug_report, size: 40), diff --git a/uni/lib/view/exams/widgets/exam_page_title.dart b/uni/lib/view/exams/widgets/exam_page_title.dart index 2e8592bc4..1ffac8819 100644 --- a/uni/lib/view/exams/widgets/exam_page_title.dart +++ b/uni/lib/view/exams/widgets/exam_page_title.dart @@ -10,9 +10,9 @@ class ExamPageTitle extends StatelessWidget { return Container( padding: const EdgeInsets.fromLTRB(20, 20, 20, 10), alignment: Alignment.center, - child: Row( + child: const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ PageTitle(name: 'Exames', center: false, pad: false), Material(child: ExamFilterMenu()), ], diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index 1af399750..691153313 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -9,7 +9,7 @@ import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/library/widgets/library_occupation_card.dart'; class LibraryOccupationTab extends StatefulWidget { - const LibraryOccupationTab({Key? key}) : super(key: key); + const LibraryOccupationTab({super.key}); @override LibraryOccupationTabState createState() => LibraryOccupationTabState(); @@ -30,28 +30,27 @@ class LibraryOccupationTabState extends State { } else { return LibraryOccupationTabView(occupationProvider.occupation); } - }); + },); } } class LibraryOccupationTabView extends StatelessWidget { - final LibraryOccupation? occupation; const LibraryOccupationTabView(this.occupation, {super.key}); + final LibraryOccupation? occupation; @override Widget build(BuildContext context) { if (occupation == null || occupation?.capacity == 0) { - return ListView(scrollDirection: Axis.vertical, children: [ + return ListView(children: [ Center( heightFactor: 2, child: Text('Não existem dados para apresentar', - style: Theme.of(context).textTheme.headline6, - textAlign: TextAlign.center)) - ]); + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center,),) + ],); } return ListView( - scrollDirection: Axis.vertical, shrinkWrap: true, children: [ LibraryOccupationCard(), @@ -59,14 +58,14 @@ class LibraryOccupationTabView extends StatelessWidget { const PageTitle(name: 'Pisos'), FloorRows(occupation!), ] - ]); + ],); } } class FloorRows extends StatelessWidget { - final LibraryOccupation occupation; const FloorRows(this.occupation, {super.key}); + final LibraryOccupation occupation; @override Widget build(BuildContext context) { @@ -77,51 +76,51 @@ class FloorRows extends StatelessWidget { crossAxisSpacing: 25, mainAxisSpacing: 5, physics: const NeverScrollableScrollPhysics(), - children: occupation.floors.map((floor) => FloorCard(floor)).toList(), + children: occupation.floors.map(FloorCard.new).toList(), ); } } class FloorCard extends StatelessWidget { - final FloorOccupation floor; const FloorCard(this.floor, {super.key}); + final FloorOccupation floor; @override Widget build(BuildContext context) { return Container( margin: const EdgeInsets.symmetric(vertical: 10), - height: 150.0, - width: 150.0, - padding: const EdgeInsets.all(20.0), + height: 150, + width: 150, + padding: const EdgeInsets.all(20), decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(10.0)), + borderRadius: const BorderRadius.all(Radius.circular(10)), color: Theme.of(context).cardColor, boxShadow: const [ BoxShadow( color: Color.fromARGB(0x1c, 0, 0, 0), - blurRadius: 7.0, - offset: Offset(0.0, 1.0), + blurRadius: 7, + offset: Offset(0, 1), ) - ]), + ],), child: Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Text('Piso ${floor.number}', - style: Theme.of(context).textTheme.headline5), + style: Theme.of(context).textTheme.headlineSmall,), Text('${floor.percentage}%', - style: Theme.of(context).textTheme.headline6), + style: Theme.of(context).textTheme.titleLarge,), Text('${floor.occupation}/${floor.capacity}', style: Theme.of(context) .textTheme - .headline6 - ?.copyWith(color: Theme.of(context).colorScheme.background)), + .titleLarge + ?.copyWith(color: Theme.of(context).colorScheme.background),), LinearPercentIndicator( - lineHeight: 7.0, + lineHeight: 7, percent: floor.percentage / 100, progressColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).dividerColor, ) - ]), + ],), ); } } diff --git a/uni/lib/view/restaurant/restaurant_page_view.dart b/uni/lib/view/restaurant/restaurant_page_view.dart index aa185e5d9..08d60592e 100644 --- a/uni/lib/view/restaurant/restaurant_page_view.dart +++ b/uni/lib/view/restaurant/restaurant_page_view.dart @@ -131,9 +131,9 @@ class RestaurantDay extends StatelessWidget { return Container( margin: const EdgeInsets.only(top: 10, bottom: 5), key: Key('restaurant-page-day-column-$day'), - child: Column( + child: const Column( mainAxisSize: MainAxisSize.min, - children: const [ + children: [ SizedBox(height: 10), Center( child: Text('Não há informação disponível sobre refeições'), diff --git a/uni/lib/view/useful_info/widgets/other_links_card.dart b/uni/lib/view/useful_info/widgets/other_links_card.dart index 6ed1bf9fb..a1a43bf48 100644 --- a/uni/lib/view/useful_info/widgets/other_links_card.dart +++ b/uni/lib/view/useful_info/widgets/other_links_card.dart @@ -9,8 +9,8 @@ class OtherLinksCard extends GenericExpansionCard { @override Widget buildCardContent(BuildContext context) { - return Column( - children: const [ + return const Column( + children: [ // LinkButton(title: 'Impressão', link: 'https://print.up.pt'), // TODO(Process-ing): Get fixed link LinkButton( diff --git a/uni/lib/view/useful_info/widgets/sigarra_links_card.dart b/uni/lib/view/useful_info/widgets/sigarra_links_card.dart index 48b5fbe3a..c5e7dcd5b 100644 --- a/uni/lib/view/useful_info/widgets/sigarra_links_card.dart +++ b/uni/lib/view/useful_info/widgets/sigarra_links_card.dart @@ -9,8 +9,8 @@ class SigarraLinksCard extends GenericExpansionCard { @override Widget buildCardContent(BuildContext context) { - return Column( - children: const [ + return const Column( + children: [ LinkButton( title: 'Notícias', link: 'https://sigarra.up.pt/feup/pt/noticias_geral.lista_noticias', From b2a2ffbfdbd8f36d8cf1a8ef26b2d77eeb2342fb Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 20 Sep 2023 15:58:27 +0100 Subject: [PATCH 27/45] Worked on linter issues --- .../fetchers/library_reservation_fetcher.dart | 4 +- .../lazy/library_reservations_provider.dart | 5 +- .../widgets/library_occupation_tab.dart | 109 ++++++++++-------- 3 files changed, 67 insertions(+), 51 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index 15324dd6b..3b3a79a38 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -10,8 +10,10 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { List getEndpoints(Session session) { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers + return [ // ignore: lines_longer_than_80_chars - return ['${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3']; + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3' + ]; } Future> getReservations(Session session) async { diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index b39977595..bc077b081 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -46,8 +46,9 @@ class LibraryReservationsProvider extends StateProviderNotifier { } Future cancelReservation(Session session, String id) async { - // ignore: lines_longer_than_80_chars - final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; + final url = + // ignore: lines_longer_than_80_chars + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; final headers = {}; headers['cookie'] = session.cookies; diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index 691153313..77b064da8 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -24,46 +24,51 @@ class LibraryOccupationTabState extends State { @override Widget build(BuildContext context) { return LazyConsumer( - builder: (context, occupationProvider) { - if (occupationProvider.status == RequestStatus.busy) { - return const Center(child: CircularProgressIndicator()); - } else { - return LibraryOccupationTabView(occupationProvider.occupation); - } - },); + builder: (context, occupationProvider) { + if (occupationProvider.status == RequestStatus.busy) { + return const Center(child: CircularProgressIndicator()); + } else { + return LibraryOccupationTabView(occupationProvider.occupation); + } + }, + ); } } class LibraryOccupationTabView extends StatelessWidget { - const LibraryOccupationTabView(this.occupation, {super.key}); final LibraryOccupation? occupation; @override Widget build(BuildContext context) { if (occupation == null || occupation?.capacity == 0) { - return ListView(children: [ - Center( + return ListView( + children: [ + Center( heightFactor: 2, - child: Text('Não existem dados para apresentar', - style: Theme.of(context).textTheme.titleLarge, - textAlign: TextAlign.center,),) - ],); + child: Text( + 'Não existem dados para apresentar', + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center, + ), + ) + ], + ); } return ListView( - shrinkWrap: true, - children: [ - LibraryOccupationCard(), - if (occupation != null) ...[ - const PageTitle(name: 'Pisos'), - FloorRows(occupation!), - ] - ],); + shrinkWrap: true, + children: [ + LibraryOccupationCard(), + if (occupation != null) ...[ + const PageTitle(name: 'Pisos'), + FloorRows(occupation!), + ] + ], + ); } } class FloorRows extends StatelessWidget { - const FloorRows(this.occupation, {super.key}); final LibraryOccupation occupation; @@ -82,7 +87,6 @@ class FloorRows extends StatelessWidget { } class FloorCard extends StatelessWidget { - const FloorCard(this.floor, {super.key}); final FloorOccupation floor; @@ -94,33 +98,42 @@ class FloorCard extends StatelessWidget { width: 150, padding: const EdgeInsets.all(20), decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(10)), - color: Theme.of(context).cardColor, - boxShadow: const [ - BoxShadow( - color: Color.fromARGB(0x1c, 0, 0, 0), - blurRadius: 7, - offset: Offset(0, 1), - ) - ],), - child: - Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Text('Piso ${floor.number}', - style: Theme.of(context).textTheme.headlineSmall,), - Text('${floor.percentage}%', - style: Theme.of(context).textTheme.titleLarge,), - Text('${floor.occupation}/${floor.capacity}', + borderRadius: const BorderRadius.all(Radius.circular(10)), + color: Theme.of(context).cardColor, + boxShadow: const [ + BoxShadow( + color: Color.fromARGB(0x1c, 0, 0, 0), + blurRadius: 7, + offset: Offset(0, 1), + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text( + 'Piso ${floor.number}', + style: Theme.of(context).textTheme.headlineSmall, + ), + Text( + '${floor.percentage}%', + style: Theme.of(context).textTheme.titleLarge, + ), + Text( + '${floor.occupation}/${floor.capacity}', style: Theme.of(context) .textTheme .titleLarge - ?.copyWith(color: Theme.of(context).colorScheme.background),), - LinearPercentIndicator( - lineHeight: 7, - percent: floor.percentage / 100, - progressColor: Theme.of(context).colorScheme.secondary, - backgroundColor: Theme.of(context).dividerColor, - ) - ],), + ?.copyWith(color: Theme.of(context).colorScheme.background), + ), + LinearPercentIndicator( + lineHeight: 7, + percent: floor.percentage / 100, + progressColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).dividerColor, + ) + ], + ), ); } } From 9f417dd0f42f59045469497ec749ee1edc5d3f26 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 20 Sep 2023 16:00:49 +0100 Subject: [PATCH 28/45] Worked on linter issues --- uni/lib/controller/fetchers/library_reservation_fetcher.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index 3b3a79a38..ef4a4d562 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -11,7 +11,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers return [ - // ignore: lines_longer_than_80_chars + // ignore: lines_longer_than_80_chars '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3' ]; } From 9af271340f07be7073c2a7ab8e0a18bc0eeb37fb Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 26 Sep 2023 17:01:08 +0100 Subject: [PATCH 29/45] Merge branch 'feature/library-reservations' --- uni/lib/generated/intl/messages_all.dart | 9 +- uni/lib/generated/intl/messages_en.dart | 362 ++++++++++------- uni/lib/generated/intl/messages_pt_PT.dart | 363 +++++++++++------- uni/lib/generated/l10n.dart | 21 +- uni/lib/view/bug_report/widgets/form.dart | 6 +- .../view/exams/widgets/exam_page_title.dart | 4 +- .../widgets/library_reservations_card.dart | 5 +- .../view/library/widgets/reservation_row.dart | 4 - .../view/restaurant/restaurant_page_view.dart | 2 +- 9 files changed, 480 insertions(+), 296 deletions(-) diff --git a/uni/lib/generated/intl/messages_all.dart b/uni/lib/generated/intl/messages_all.dart index fb1bd2689..6b3ebeae5 100644 --- a/uni/lib/generated/intl/messages_all.dart +++ b/uni/lib/generated/intl/messages_all.dart @@ -38,9 +38,8 @@ MessageLookupByLibrary? _findExact(String localeName) { /// User programs should call this before using [localeName] for messages. Future initializeMessages(String localeName) async { var availableLocale = Intl.verifiedLocale( - localeName, - (locale) => _deferredLibraries[locale] != null, - onFailure: (_) => null); + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); if (availableLocale == null) { return new Future.value(false); } @@ -60,8 +59,8 @@ bool _messagesExistFor(String locale) { } MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { - var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, - onFailure: (_) => null); + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); if (actualLocale == null) return null; return _findExact(actualLocale); } diff --git a/uni/lib/generated/intl/messages_en.dart b/uni/lib/generated/intl/messages_en.dart index 5dccace3d..9d2823c7d 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -21,142 +21,234 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "last refresh at ${time}"; - static m1(time) => "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; + static m1(time) => + "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; - static m2(title) => "${Intl.select(title, {'horario': 'Schedule', 'exames': 'Exams', 'area': 'Personal Area', 'cadeiras': 'Course Units', 'autocarros': 'Buses', 'locais': 'Places', 'restaurantes': 'Restaurants', 'calendario': 'Calendar', 'biblioteca': 'Library', 'uteis': 'Utils', 'sobre': 'About', 'bugs': 'Bugs/Suggestions', 'other': 'Other', })}"; + static m2(title) => "${Intl.select(title, { + 'horario': 'Schedule', + 'exames': 'Exams', + 'area': 'Personal Area', + 'cadeiras': 'Course Units', + 'autocarros': 'Buses', + 'locais': 'Places', + 'restaurantes': 'Restaurants', + 'calendario': 'Calendar', + 'biblioteca': 'Library', + 'uteis': 'Utils', + 'sobre': 'About', + 'bugs': 'Bugs/Suggestions', + 'other': 'Other', + })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services" : MessageLookupByLibrary.simpleMessage("Academic services"), - "account_card_title" : MessageLookupByLibrary.simpleMessage("Checking account"), - "add" : MessageLookupByLibrary.simpleMessage("Add"), - "add_quota" : MessageLookupByLibrary.simpleMessage("Add quota"), - "add_widget" : MessageLookupByLibrary.simpleMessage("Add widget"), - "agree_terms" : MessageLookupByLibrary.simpleMessage("By entering you confirm that you agree with these Terms and Conditions"), - "all_widgets_added" : MessageLookupByLibrary.simpleMessage("All available widgets have already been added to your personal area!"), - "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Select at least one college"), - "available_amount" : MessageLookupByLibrary.simpleMessage("Available amount"), - "average" : MessageLookupByLibrary.simpleMessage("Average: "), - "balance" : MessageLookupByLibrary.simpleMessage("Balance:"), - "bs_description" : MessageLookupByLibrary.simpleMessage("Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), - "bug_description" : MessageLookupByLibrary.simpleMessage("Bug found, how to reproduce it, etc."), - "bus_error" : MessageLookupByLibrary.simpleMessage("Unable to get information"), - "bus_information" : MessageLookupByLibrary.simpleMessage("Select the buses you want information about:"), - "buses_personalize" : MessageLookupByLibrary.simpleMessage("Personalize your buses here"), - "buses_text" : MessageLookupByLibrary.simpleMessage("Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), - "cancel" : MessageLookupByLibrary.simpleMessage("Cancel"), - "change" : MessageLookupByLibrary.simpleMessage("Change"), - "change_prompt" : MessageLookupByLibrary.simpleMessage("Do you want to change the password?"), - "check_internet" : MessageLookupByLibrary.simpleMessage("Check your internet connection"), - "class_registration" : MessageLookupByLibrary.simpleMessage("Class Registration"), - "college" : MessageLookupByLibrary.simpleMessage("College: "), - "college_select" : MessageLookupByLibrary.simpleMessage("select your college(s)"), - "conclude" : MessageLookupByLibrary.simpleMessage("Done"), - "configured_buses" : MessageLookupByLibrary.simpleMessage("Configured Buses"), - "confirm" : MessageLookupByLibrary.simpleMessage("Confirm"), - "consent" : MessageLookupByLibrary.simpleMessage("I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), - "contact" : MessageLookupByLibrary.simpleMessage("Contact (optional)"), - "copy_center" : MessageLookupByLibrary.simpleMessage("Copy center"), - "copy_center_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B | AEFEUP building"), - "course_class" : MessageLookupByLibrary.simpleMessage("Classes"), - "course_info" : MessageLookupByLibrary.simpleMessage("Info"), - "current_state" : MessageLookupByLibrary.simpleMessage("Current state: "), - "current_year" : MessageLookupByLibrary.simpleMessage("Current academic year: "), - "decrement" : MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), - "description" : MessageLookupByLibrary.simpleMessage("Description"), - "desired_email" : MessageLookupByLibrary.simpleMessage("Email where you want to be contacted"), - "dona_bia" : MessageLookupByLibrary.simpleMessage("D. Beatriz\'s stationery store"), - "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B (B-142)"), - "ects" : MessageLookupByLibrary.simpleMessage("ECTs performed: "), - "edit_off" : MessageLookupByLibrary.simpleMessage("Edit"), - "edit_on" : MessageLookupByLibrary.simpleMessage("Finish editing"), - "empty_text" : MessageLookupByLibrary.simpleMessage("Please fill in this field"), - "exams_filter" : MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), - "exit_confirm" : MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), - "expired_password" : MessageLookupByLibrary.simpleMessage("Your password has expired"), - "failed_login" : MessageLookupByLibrary.simpleMessage("Login failed"), - "fee_date" : MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), - "fee_notification" : MessageLookupByLibrary.simpleMessage("Notify next deadline:"), - "first_year_registration" : MessageLookupByLibrary.simpleMessage("Year of first registration: "), - "floor" : MessageLookupByLibrary.simpleMessage("Floor"), - "floors" : MessageLookupByLibrary.simpleMessage("Floors"), - "forgot_password" : MessageLookupByLibrary.simpleMessage("Forgot password?"), - "generate_reference" : MessageLookupByLibrary.simpleMessage("Generate reference"), - "geral_registration" : MessageLookupByLibrary.simpleMessage("General Registration"), - "improvement_registration" : MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), - "increment" : MessageLookupByLibrary.simpleMessage("Increment 1,00€"), - "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Invalid credentials"), - "keep_login" : MessageLookupByLibrary.simpleMessage("Stay signed in"), - "last_refresh_time" : m0, - "last_timestamp" : m1, - "library" : MessageLookupByLibrary.simpleMessage("Library"), - "library_occupation" : MessageLookupByLibrary.simpleMessage("Library Occupation"), - "library_reservations" : MessageLookupByLibrary.simpleMessage("Library Reservations"), - "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Occupation"), - "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Reservations"), - "load_error" : MessageLookupByLibrary.simpleMessage("Error loading the information"), - "loading_terms" : MessageLookupByLibrary.simpleMessage("Loading Terms and Conditions..."), - "login" : MessageLookupByLibrary.simpleMessage("Login"), - "logout" : MessageLookupByLibrary.simpleMessage("Log out"), - "menus" : MessageLookupByLibrary.simpleMessage("Menus"), - "min_value_reference" : MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), - "multimedia_center" : MessageLookupByLibrary.simpleMessage("Multimedia center"), - "nav_title" : m2, - "news" : MessageLookupByLibrary.simpleMessage("News"), - "no" : MessageLookupByLibrary.simpleMessage("No"), - "no_bus" : MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), - "no_bus_stops" : MessageLookupByLibrary.simpleMessage("No configured stops"), - "no_class" : MessageLookupByLibrary.simpleMessage("There are no classes to display"), - "no_classes" : MessageLookupByLibrary.simpleMessage("No classes to present"), - "no_classes_on" : MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), - "no_college" : MessageLookupByLibrary.simpleMessage("no college"), - "no_course_units" : MessageLookupByLibrary.simpleMessage("No course units in the selected period"), - "no_data" : MessageLookupByLibrary.simpleMessage("There is no data to show at this time"), - "no_date" : MessageLookupByLibrary.simpleMessage("No date"), - "no_exams" : MessageLookupByLibrary.simpleMessage("You have no exams scheduled\n"), - "no_exams_label" : MessageLookupByLibrary.simpleMessage("Looks like you are on vacation!"), - "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("No favorite restaurants"), - "no_info" : MessageLookupByLibrary.simpleMessage("There is no information to display"), - "no_menu_info" : MessageLookupByLibrary.simpleMessage("There is no information available about meals"), - "no_menus" : MessageLookupByLibrary.simpleMessage("There are no meals available"), - "no_name_course" : MessageLookupByLibrary.simpleMessage("Unnamed course"), - "no_places_info" : MessageLookupByLibrary.simpleMessage("There is no information available about places"), - "no_references" : MessageLookupByLibrary.simpleMessage("There are no references to pay"), - "no_results" : MessageLookupByLibrary.simpleMessage("No match"), - "no_selected_courses" : MessageLookupByLibrary.simpleMessage("There are no course units to display"), - "no_selected_exams" : MessageLookupByLibrary.simpleMessage("There are no exams to present"), - "occurrence_type" : MessageLookupByLibrary.simpleMessage("Type of occurrence"), - "other_links" : MessageLookupByLibrary.simpleMessage("Other links"), - "pass_change_request" : MessageLookupByLibrary.simpleMessage("For security reasons, passwords must be changed periodically."), - "password" : MessageLookupByLibrary.simpleMessage("password"), - "pendent_references" : MessageLookupByLibrary.simpleMessage("Pending references"), - "personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), - "press_again" : MessageLookupByLibrary.simpleMessage("Press again to exit"), - "print" : MessageLookupByLibrary.simpleMessage("Print"), - "prints" : MessageLookupByLibrary.simpleMessage("Prints"), - "problem_id" : MessageLookupByLibrary.simpleMessage("Brief identification of the problem"), - "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), - "reference_success" : MessageLookupByLibrary.simpleMessage("Reference created successfully!"), - "remove" : MessageLookupByLibrary.simpleMessage("Delete"), - "report_error" : MessageLookupByLibrary.simpleMessage("Report error"), - "room" : MessageLookupByLibrary.simpleMessage("Room"), - "school_calendar" : MessageLookupByLibrary.simpleMessage("School Calendar"), - "semester" : MessageLookupByLibrary.simpleMessage("Semester"), - "send" : MessageLookupByLibrary.simpleMessage("Send"), - "sent_error" : MessageLookupByLibrary.simpleMessage("An error occurred in sending"), - "some_error" : MessageLookupByLibrary.simpleMessage("Some error!"), - "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), - "student_number" : MessageLookupByLibrary.simpleMessage("student number"), - "success" : MessageLookupByLibrary.simpleMessage("Sent with success"), - "tele_assistance" : MessageLookupByLibrary.simpleMessage("Telephone assistance"), - "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face and telephone assistance"), - "telephone" : MessageLookupByLibrary.simpleMessage("Telephone"), - "terms" : MessageLookupByLibrary.simpleMessage("Terms and Conditions"), - "title" : MessageLookupByLibrary.simpleMessage("Title"), - "unavailable" : MessageLookupByLibrary.simpleMessage("Unavailable"), - "valid_email" : MessageLookupByLibrary.simpleMessage("Please enter a valid email"), - "widget_prompt" : MessageLookupByLibrary.simpleMessage("Choose a widget to add to your personal area:"), - "year" : MessageLookupByLibrary.simpleMessage("Year"), - "yes" : MessageLookupByLibrary.simpleMessage("Yes") - }; + static _notInlinedMessages(_) => { + "academic_services": + MessageLookupByLibrary.simpleMessage("Academic services"), + "account_card_title": + MessageLookupByLibrary.simpleMessage("Checking account"), + "add": MessageLookupByLibrary.simpleMessage("Add"), + "add_quota": MessageLookupByLibrary.simpleMessage("Add quota"), + "add_widget": MessageLookupByLibrary.simpleMessage("Add widget"), + "agree_terms": MessageLookupByLibrary.simpleMessage( + "By entering you confirm that you agree with these Terms and Conditions"), + "all_widgets_added": MessageLookupByLibrary.simpleMessage( + "All available widgets have already been added to your personal area!"), + "at_least_one_college": + MessageLookupByLibrary.simpleMessage("Select at least one college"), + "available_amount": + MessageLookupByLibrary.simpleMessage("Available amount"), + "average": MessageLookupByLibrary.simpleMessage("Average: "), + "balance": MessageLookupByLibrary.simpleMessage("Balance:"), + "bs_description": MessageLookupByLibrary.simpleMessage( + "Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), + "bug_description": MessageLookupByLibrary.simpleMessage( + "Bug found, how to reproduce it, etc."), + "bus_error": + MessageLookupByLibrary.simpleMessage("Unable to get information"), + "bus_information": MessageLookupByLibrary.simpleMessage( + "Select the buses you want information about:"), + "buses_personalize": + MessageLookupByLibrary.simpleMessage("Personalize your buses here"), + "buses_text": MessageLookupByLibrary.simpleMessage( + "Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), + "cancel": MessageLookupByLibrary.simpleMessage("Cancel"), + "change": MessageLookupByLibrary.simpleMessage("Change"), + "change_prompt": MessageLookupByLibrary.simpleMessage( + "Do you want to change the password?"), + "check_internet": MessageLookupByLibrary.simpleMessage( + "Check your internet connection"), + "class_registration": + MessageLookupByLibrary.simpleMessage("Class Registration"), + "college": MessageLookupByLibrary.simpleMessage("College: "), + "college_select": + MessageLookupByLibrary.simpleMessage("select your college(s)"), + "conclude": MessageLookupByLibrary.simpleMessage("Done"), + "configured_buses": + MessageLookupByLibrary.simpleMessage("Configured Buses"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirm"), + "consent": MessageLookupByLibrary.simpleMessage( + "I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), + "contact": MessageLookupByLibrary.simpleMessage("Contact (optional)"), + "copy_center": MessageLookupByLibrary.simpleMessage("Copy center"), + "copy_center_building": MessageLookupByLibrary.simpleMessage( + "Floor -1 of building B | AEFEUP building"), + "course_class": MessageLookupByLibrary.simpleMessage("Classes"), + "course_info": MessageLookupByLibrary.simpleMessage("Info"), + "current_state": + MessageLookupByLibrary.simpleMessage("Current state: "), + "current_year": + MessageLookupByLibrary.simpleMessage("Current academic year: "), + "decrement": MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), + "description": MessageLookupByLibrary.simpleMessage("Description"), + "desired_email": MessageLookupByLibrary.simpleMessage( + "Email where you want to be contacted"), + "dona_bia": MessageLookupByLibrary.simpleMessage( + "D. Beatriz\'s stationery store"), + "dona_bia_building": MessageLookupByLibrary.simpleMessage( + "Floor -1 of building B (B-142)"), + "ects": MessageLookupByLibrary.simpleMessage("ECTs performed: "), + "edit_off": MessageLookupByLibrary.simpleMessage("Edit"), + "edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"), + "empty_text": + MessageLookupByLibrary.simpleMessage("Please fill in this field"), + "exams_filter": + MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), + "exit_confirm": + MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), + "expired_password": + MessageLookupByLibrary.simpleMessage("Your password has expired"), + "failed_login": MessageLookupByLibrary.simpleMessage("Login failed"), + "fee_date": + MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), + "fee_notification": + MessageLookupByLibrary.simpleMessage("Notify next deadline:"), + "first_year_registration": MessageLookupByLibrary.simpleMessage( + "Year of first registration: "), + "floor": MessageLookupByLibrary.simpleMessage("Floor"), + "floors": MessageLookupByLibrary.simpleMessage("Floors"), + "forgot_password": + MessageLookupByLibrary.simpleMessage("Forgot password?"), + "generate_reference": + MessageLookupByLibrary.simpleMessage("Generate reference"), + "geral_registration": + MessageLookupByLibrary.simpleMessage("General Registration"), + "improvement_registration": + MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), + "increment": MessageLookupByLibrary.simpleMessage("Increment 1,00€"), + "invalid_credentials": + MessageLookupByLibrary.simpleMessage("Invalid credentials"), + "keep_login": MessageLookupByLibrary.simpleMessage("Stay signed in"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library": MessageLookupByLibrary.simpleMessage("Library"), + "library_occupation": + MessageLookupByLibrary.simpleMessage("Library Occupation"), + "library_reservations": + MessageLookupByLibrary.simpleMessage("Library Reservations"), + "library_tab_occupation": + MessageLookupByLibrary.simpleMessage("Occupation"), + "library_tab_reservations": + MessageLookupByLibrary.simpleMessage("Reservations"), + "load_error": MessageLookupByLibrary.simpleMessage( + "Error loading the information"), + "loading_terms": MessageLookupByLibrary.simpleMessage( + "Loading Terms and Conditions..."), + "login": MessageLookupByLibrary.simpleMessage("Login"), + "logout": MessageLookupByLibrary.simpleMessage("Log out"), + "menus": MessageLookupByLibrary.simpleMessage("Menus"), + "min_value_reference": + MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), + "multimedia_center": + MessageLookupByLibrary.simpleMessage("Multimedia center"), + "nav_title": m2, + "news": MessageLookupByLibrary.simpleMessage("News"), + "no": MessageLookupByLibrary.simpleMessage("No"), + "no_bus": MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), + "no_bus_stops": + MessageLookupByLibrary.simpleMessage("No configured stops"), + "no_class": MessageLookupByLibrary.simpleMessage( + "There are no classes to display"), + "no_classes": + MessageLookupByLibrary.simpleMessage("No classes to present"), + "no_classes_on": + MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), + "no_college": MessageLookupByLibrary.simpleMessage("no college"), + "no_course_units": MessageLookupByLibrary.simpleMessage( + "No course units in the selected period"), + "no_data": MessageLookupByLibrary.simpleMessage( + "There is no data to show at this time"), + "no_date": MessageLookupByLibrary.simpleMessage("No date"), + "no_exams": MessageLookupByLibrary.simpleMessage( + "You have no exams scheduled\n"), + "no_exams_label": MessageLookupByLibrary.simpleMessage( + "Looks like you are on vacation!"), + "no_favorite_restaurants": + MessageLookupByLibrary.simpleMessage("No favorite restaurants"), + "no_info": MessageLookupByLibrary.simpleMessage( + "There is no information to display"), + "no_menu_info": MessageLookupByLibrary.simpleMessage( + "There is no information available about meals"), + "no_menus": MessageLookupByLibrary.simpleMessage( + "There are no meals available"), + "no_name_course": + MessageLookupByLibrary.simpleMessage("Unnamed course"), + "no_places_info": MessageLookupByLibrary.simpleMessage( + "There is no information available about places"), + "no_references": MessageLookupByLibrary.simpleMessage( + "There are no references to pay"), + "no_results": MessageLookupByLibrary.simpleMessage("No match"), + "no_selected_courses": MessageLookupByLibrary.simpleMessage( + "There are no course units to display"), + "no_selected_exams": MessageLookupByLibrary.simpleMessage( + "There are no exams to present"), + "occurrence_type": + MessageLookupByLibrary.simpleMessage("Type of occurrence"), + "other_links": MessageLookupByLibrary.simpleMessage("Other links"), + "pass_change_request": MessageLookupByLibrary.simpleMessage( + "For security reasons, passwords must be changed periodically."), + "password": MessageLookupByLibrary.simpleMessage("password"), + "pendent_references": + MessageLookupByLibrary.simpleMessage("Pending references"), + "personal_assistance": + MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), + "press_again": + MessageLookupByLibrary.simpleMessage("Press again to exit"), + "print": MessageLookupByLibrary.simpleMessage("Print"), + "prints": MessageLookupByLibrary.simpleMessage("Prints"), + "problem_id": MessageLookupByLibrary.simpleMessage( + "Brief identification of the problem"), + "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( + "The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), + "reference_success": MessageLookupByLibrary.simpleMessage( + "Reference created successfully!"), + "remove": MessageLookupByLibrary.simpleMessage("Delete"), + "report_error": MessageLookupByLibrary.simpleMessage("Report error"), + "room": MessageLookupByLibrary.simpleMessage("Room"), + "school_calendar": + MessageLookupByLibrary.simpleMessage("School Calendar"), + "semester": MessageLookupByLibrary.simpleMessage("Semester"), + "send": MessageLookupByLibrary.simpleMessage("Send"), + "sent_error": MessageLookupByLibrary.simpleMessage( + "An error occurred in sending"), + "some_error": MessageLookupByLibrary.simpleMessage("Some error!"), + "stcp_stops": + MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), + "student_number": + MessageLookupByLibrary.simpleMessage("student number"), + "success": MessageLookupByLibrary.simpleMessage("Sent with success"), + "tele_assistance": + MessageLookupByLibrary.simpleMessage("Telephone assistance"), + "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( + "Face-to-face and telephone assistance"), + "telephone": MessageLookupByLibrary.simpleMessage("Telephone"), + "terms": MessageLookupByLibrary.simpleMessage("Terms and Conditions"), + "title": MessageLookupByLibrary.simpleMessage("Title"), + "unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"), + "valid_email": + MessageLookupByLibrary.simpleMessage("Please enter a valid email"), + "widget_prompt": MessageLookupByLibrary.simpleMessage( + "Choose a widget to add to your personal area:"), + "year": MessageLookupByLibrary.simpleMessage("Year"), + "yes": MessageLookupByLibrary.simpleMessage("Yes") + }; } diff --git a/uni/lib/generated/intl/messages_pt_PT.dart b/uni/lib/generated/intl/messages_pt_PT.dart index 9d6a7925f..be4f1ae44 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -21,142 +21,235 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "última atualização às ${time}"; - static m1(time) => "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; + static m1(time) => + "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; - static m2(title) => "${Intl.select(title, {'horario': 'Horário', 'exames': 'Exames', 'area': 'Área Pessoal', 'cadeiras': 'Cadeiras', 'autocarros': 'Autocarros', 'locais': 'Locais', 'restaurantes': 'Restaurantes', 'calendario': 'Calendário', 'biblioteca': 'Biblioteca', 'uteis': 'Úteis', 'sobre': 'Sobre', 'bugs': 'Bugs e Sugestões', 'other': 'Outros', })}"; + static m2(title) => "${Intl.select(title, { + 'horario': 'Horário', + 'exames': 'Exames', + 'area': 'Área Pessoal', + 'cadeiras': 'Cadeiras', + 'autocarros': 'Autocarros', + 'locais': 'Locais', + 'restaurantes': 'Restaurantes', + 'calendario': 'Calendário', + 'biblioteca': 'Biblioteca', + 'uteis': 'Úteis', + 'sobre': 'Sobre', + 'bugs': 'Bugs e Sugestões', + 'other': 'Outros', + })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services" : MessageLookupByLibrary.simpleMessage("Serviços académicos"), - "account_card_title" : MessageLookupByLibrary.simpleMessage("Conta Corrente"), - "add" : MessageLookupByLibrary.simpleMessage("Adicionar"), - "add_quota" : MessageLookupByLibrary.simpleMessage("Adicionar quota"), - "add_widget" : MessageLookupByLibrary.simpleMessage("Adicionar widget"), - "agree_terms" : MessageLookupByLibrary.simpleMessage("Ao entrares confirmas que concordas com estes Termos e Condições"), - "all_widgets_added" : MessageLookupByLibrary.simpleMessage("Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), - "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Seleciona pelo menos uma faculdade"), - "available_amount" : MessageLookupByLibrary.simpleMessage("Valor disponível"), - "average" : MessageLookupByLibrary.simpleMessage("Média: "), - "balance" : MessageLookupByLibrary.simpleMessage("Saldo:"), - "bs_description" : MessageLookupByLibrary.simpleMessage("Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), - "bug_description" : MessageLookupByLibrary.simpleMessage("Bug encontrado, como o reproduzir, etc"), - "bus_error" : MessageLookupByLibrary.simpleMessage("Não foi possível obter informação"), - "bus_information" : MessageLookupByLibrary.simpleMessage("Seleciona os autocarros dos quais queres informação:"), - "buses_personalize" : MessageLookupByLibrary.simpleMessage("Configura aqui os teus autocarros"), - "buses_text" : MessageLookupByLibrary.simpleMessage("Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), - "cancel" : MessageLookupByLibrary.simpleMessage("Cancelar\n"), - "change" : MessageLookupByLibrary.simpleMessage("Alterar"), - "change_prompt" : MessageLookupByLibrary.simpleMessage("Deseja alterar a palavra-passe?"), - "check_internet" : MessageLookupByLibrary.simpleMessage("Verifica a tua ligação à internet"), - "class_registration" : MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), - "college" : MessageLookupByLibrary.simpleMessage("Faculdade: "), - "college_select" : MessageLookupByLibrary.simpleMessage("seleciona a(s) tua(s) faculdade(s)"), - "conclude" : MessageLookupByLibrary.simpleMessage("Concluído"), - "configured_buses" : MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), - "confirm" : MessageLookupByLibrary.simpleMessage("Confirmar"), - "consent" : MessageLookupByLibrary.simpleMessage("Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), - "contact" : MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), - "copy_center" : MessageLookupByLibrary.simpleMessage("Centro de cópias"), - "copy_center_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B | Edifício da AEFEUP"), - "course_class" : MessageLookupByLibrary.simpleMessage("Turmas"), - "course_info" : MessageLookupByLibrary.simpleMessage("Ficha"), - "current_state" : MessageLookupByLibrary.simpleMessage("Estado atual: "), - "current_year" : MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), - "decrement" : MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), - "description" : MessageLookupByLibrary.simpleMessage("Descrição"), - "desired_email" : MessageLookupByLibrary.simpleMessage("Email em que desejas ser contactado"), - "dona_bia" : MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), - "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B (B-142)"), - "ects" : MessageLookupByLibrary.simpleMessage("ECTs realizados: "), - "edit_off" : MessageLookupByLibrary.simpleMessage("Editar\n"), - "edit_on" : MessageLookupByLibrary.simpleMessage("Concluir edição"), - "empty_text" : MessageLookupByLibrary.simpleMessage("Por favor preenche este campo"), - "exams_filter" : MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), - "exit_confirm" : MessageLookupByLibrary.simpleMessage("Tem a certeza de que pretende sair?"), - "expired_password" : MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), - "failed_login" : MessageLookupByLibrary.simpleMessage("O login falhou"), - "fee_date" : MessageLookupByLibrary.simpleMessage("Data limite próxima prestação:"), - "fee_notification" : MessageLookupByLibrary.simpleMessage("Notificar próxima data limite:"), - "first_year_registration" : MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), - "floor" : MessageLookupByLibrary.simpleMessage("Piso"), - "floors" : MessageLookupByLibrary.simpleMessage("Pisos"), - "forgot_password" : MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), - "generate_reference" : MessageLookupByLibrary.simpleMessage("Gerar referência"), - "geral_registration" : MessageLookupByLibrary.simpleMessage("Inscrição Geral"), - "improvement_registration" : MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), - "increment" : MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), - "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), - "keep_login" : MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), - "last_refresh_time" : m0, - "last_timestamp" : m1, - "library" : MessageLookupByLibrary.simpleMessage("Biblioteca"), - "library_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), - "library_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), - "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação"), - "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes"), - "load_error" : MessageLookupByLibrary.simpleMessage("Aconteceu um erro ao carregar os dados"), - "loading_terms" : MessageLookupByLibrary.simpleMessage("Carregando os Termos e Condições..."), - "login" : MessageLookupByLibrary.simpleMessage("Entrar"), - "logout" : MessageLookupByLibrary.simpleMessage("Terminar sessão"), - "menus" : MessageLookupByLibrary.simpleMessage("Ementas"), - "min_value_reference" : MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), - "multimedia_center" : MessageLookupByLibrary.simpleMessage("Centro de multimédia"), - "nav_title" : m2, - "news" : MessageLookupByLibrary.simpleMessage("Notícias"), - "no" : MessageLookupByLibrary.simpleMessage("Não"), - "no_bus" : MessageLookupByLibrary.simpleMessage("Não percas nenhum autocarro!"), - "no_bus_stops" : MessageLookupByLibrary.simpleMessage("Não existe nenhuma paragem configurada"), - "no_class" : MessageLookupByLibrary.simpleMessage("Não existem turmas para apresentar"), - "no_classes" : MessageLookupByLibrary.simpleMessage("Não existem aulas para apresentar"), - "no_classes_on" : MessageLookupByLibrary.simpleMessage("Não possui aulas à"), - "no_college" : MessageLookupByLibrary.simpleMessage("sem faculdade"), - "no_course_units" : MessageLookupByLibrary.simpleMessage("Sem cadeiras no período selecionado"), - "no_data" : MessageLookupByLibrary.simpleMessage("Não há dados a mostrar neste momento"), - "no_date" : MessageLookupByLibrary.simpleMessage("Sem data"), - "no_exams" : MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), - "no_exams_label" : MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), - "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), - "no_info" : MessageLookupByLibrary.simpleMessage("Não existem informações para apresentar"), - "no_menu_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre refeições"), - "no_menus" : MessageLookupByLibrary.simpleMessage("Não há refeições disponíveis"), - "no_name_course" : MessageLookupByLibrary.simpleMessage("Curso sem nome"), - "no_places_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre locais"), - "no_references" : MessageLookupByLibrary.simpleMessage("Não existem referências a pagar"), - "no_results" : MessageLookupByLibrary.simpleMessage("Sem resultados"), - "no_selected_courses" : MessageLookupByLibrary.simpleMessage("Não existem cadeiras para apresentar"), - "no_selected_exams" : MessageLookupByLibrary.simpleMessage("Não existem exames para apresentar"), - "occurrence_type" : MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), - "other_links" : MessageLookupByLibrary.simpleMessage("Outros links"), - "pass_change_request" : MessageLookupByLibrary.simpleMessage("Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), - "password" : MessageLookupByLibrary.simpleMessage("palavra-passe"), - "pendent_references" : MessageLookupByLibrary.simpleMessage("Referências pendentes"), - "personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial"), - "press_again" : MessageLookupByLibrary.simpleMessage("Pressione novamente para sair"), - "print" : MessageLookupByLibrary.simpleMessage("Impressão"), - "prints" : MessageLookupByLibrary.simpleMessage("Impressões"), - "problem_id" : MessageLookupByLibrary.simpleMessage("Breve identificação do problema"), - "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), - "reference_success" : MessageLookupByLibrary.simpleMessage("Referência criada com sucesso!"), - "remove" : MessageLookupByLibrary.simpleMessage("Remover"), - "report_error" : MessageLookupByLibrary.simpleMessage("Reportar erro"), - "room" : MessageLookupByLibrary.simpleMessage("Sala"), - "school_calendar" : MessageLookupByLibrary.simpleMessage("Calendário Escolar"), - "semester" : MessageLookupByLibrary.simpleMessage("Semestre"), - "send" : MessageLookupByLibrary.simpleMessage("Enviar"), - "sent_error" : MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), - "some_error" : MessageLookupByLibrary.simpleMessage("Algum erro!"), - "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), - "student_number" : MessageLookupByLibrary.simpleMessage("número de estudante"), - "success" : MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), - "tele_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), - "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial e telefónico"), - "telephone" : MessageLookupByLibrary.simpleMessage("Telefone"), - "terms" : MessageLookupByLibrary.simpleMessage("Termos e Condições"), - "title" : MessageLookupByLibrary.simpleMessage("Título"), - "unavailable" : MessageLookupByLibrary.simpleMessage("Indisponível"), - "valid_email" : MessageLookupByLibrary.simpleMessage("Por favor insere um email válido"), - "widget_prompt" : MessageLookupByLibrary.simpleMessage("Escolhe um widget para adicionares à tua área pessoal:"), - "year" : MessageLookupByLibrary.simpleMessage("Ano"), - "yes" : MessageLookupByLibrary.simpleMessage("Sim") - }; + static _notInlinedMessages(_) => { + "academic_services": + MessageLookupByLibrary.simpleMessage("Serviços académicos"), + "account_card_title": + MessageLookupByLibrary.simpleMessage("Conta Corrente"), + "add": MessageLookupByLibrary.simpleMessage("Adicionar"), + "add_quota": MessageLookupByLibrary.simpleMessage("Adicionar quota"), + "add_widget": MessageLookupByLibrary.simpleMessage("Adicionar widget"), + "agree_terms": MessageLookupByLibrary.simpleMessage( + "Ao entrares confirmas que concordas com estes Termos e Condições"), + "all_widgets_added": MessageLookupByLibrary.simpleMessage( + "Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), + "at_least_one_college": MessageLookupByLibrary.simpleMessage( + "Seleciona pelo menos uma faculdade"), + "available_amount": + MessageLookupByLibrary.simpleMessage("Valor disponível"), + "average": MessageLookupByLibrary.simpleMessage("Média: "), + "balance": MessageLookupByLibrary.simpleMessage("Saldo:"), + "bs_description": MessageLookupByLibrary.simpleMessage( + "Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), + "bug_description": MessageLookupByLibrary.simpleMessage( + "Bug encontrado, como o reproduzir, etc"), + "bus_error": MessageLookupByLibrary.simpleMessage( + "Não foi possível obter informação"), + "bus_information": MessageLookupByLibrary.simpleMessage( + "Seleciona os autocarros dos quais queres informação:"), + "buses_personalize": MessageLookupByLibrary.simpleMessage( + "Configura aqui os teus autocarros"), + "buses_text": MessageLookupByLibrary.simpleMessage( + "Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), + "cancel": MessageLookupByLibrary.simpleMessage("Cancelar\n"), + "change": MessageLookupByLibrary.simpleMessage("Alterar"), + "change_prompt": MessageLookupByLibrary.simpleMessage( + "Deseja alterar a palavra-passe?"), + "check_internet": MessageLookupByLibrary.simpleMessage( + "Verifica a tua ligação à internet"), + "class_registration": + MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), + "college": MessageLookupByLibrary.simpleMessage("Faculdade: "), + "college_select": MessageLookupByLibrary.simpleMessage( + "seleciona a(s) tua(s) faculdade(s)"), + "conclude": MessageLookupByLibrary.simpleMessage("Concluído"), + "configured_buses": + MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirmar"), + "consent": MessageLookupByLibrary.simpleMessage( + "Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), + "contact": MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), + "copy_center": MessageLookupByLibrary.simpleMessage("Centro de cópias"), + "copy_center_building": MessageLookupByLibrary.simpleMessage( + "Piso -1 do edifício B | Edifício da AEFEUP"), + "course_class": MessageLookupByLibrary.simpleMessage("Turmas"), + "course_info": MessageLookupByLibrary.simpleMessage("Ficha"), + "current_state": MessageLookupByLibrary.simpleMessage("Estado atual: "), + "current_year": + MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), + "decrement": MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), + "description": MessageLookupByLibrary.simpleMessage("Descrição"), + "desired_email": MessageLookupByLibrary.simpleMessage( + "Email em que desejas ser contactado"), + "dona_bia": + MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), + "dona_bia_building": MessageLookupByLibrary.simpleMessage( + "Piso -1 do edifício B (B-142)"), + "ects": MessageLookupByLibrary.simpleMessage("ECTs realizados: "), + "edit_off": MessageLookupByLibrary.simpleMessage("Editar\n"), + "edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"), + "empty_text": MessageLookupByLibrary.simpleMessage( + "Por favor preenche este campo"), + "exams_filter": + MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), + "exit_confirm": MessageLookupByLibrary.simpleMessage( + "Tem a certeza de que pretende sair?"), + "expired_password": + MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), + "failed_login": MessageLookupByLibrary.simpleMessage("O login falhou"), + "fee_date": MessageLookupByLibrary.simpleMessage( + "Data limite próxima prestação:"), + "fee_notification": MessageLookupByLibrary.simpleMessage( + "Notificar próxima data limite:"), + "first_year_registration": + MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), + "floor": MessageLookupByLibrary.simpleMessage("Piso"), + "floors": MessageLookupByLibrary.simpleMessage("Pisos"), + "forgot_password": + MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), + "generate_reference": + MessageLookupByLibrary.simpleMessage("Gerar referência"), + "geral_registration": + MessageLookupByLibrary.simpleMessage("Inscrição Geral"), + "improvement_registration": + MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), + "increment": MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), + "invalid_credentials": + MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), + "keep_login": + MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library": MessageLookupByLibrary.simpleMessage("Biblioteca"), + "library_occupation": + MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), + "library_reservations": + MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), + "library_tab_occupation": + MessageLookupByLibrary.simpleMessage("Ocupação"), + "library_tab_reservations": + MessageLookupByLibrary.simpleMessage("Gabinetes"), + "load_error": MessageLookupByLibrary.simpleMessage( + "Aconteceu um erro ao carregar os dados"), + "loading_terms": MessageLookupByLibrary.simpleMessage( + "Carregando os Termos e Condições..."), + "login": MessageLookupByLibrary.simpleMessage("Entrar"), + "logout": MessageLookupByLibrary.simpleMessage("Terminar sessão"), + "menus": MessageLookupByLibrary.simpleMessage("Ementas"), + "min_value_reference": + MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), + "multimedia_center": + MessageLookupByLibrary.simpleMessage("Centro de multimédia"), + "nav_title": m2, + "news": MessageLookupByLibrary.simpleMessage("Notícias"), + "no": MessageLookupByLibrary.simpleMessage("Não"), + "no_bus": MessageLookupByLibrary.simpleMessage( + "Não percas nenhum autocarro!"), + "no_bus_stops": MessageLookupByLibrary.simpleMessage( + "Não existe nenhuma paragem configurada"), + "no_class": MessageLookupByLibrary.simpleMessage( + "Não existem turmas para apresentar"), + "no_classes": MessageLookupByLibrary.simpleMessage( + "Não existem aulas para apresentar"), + "no_classes_on": + MessageLookupByLibrary.simpleMessage("Não possui aulas à"), + "no_college": MessageLookupByLibrary.simpleMessage("sem faculdade"), + "no_course_units": MessageLookupByLibrary.simpleMessage( + "Sem cadeiras no período selecionado"), + "no_data": MessageLookupByLibrary.simpleMessage( + "Não há dados a mostrar neste momento"), + "no_date": MessageLookupByLibrary.simpleMessage("Sem data"), + "no_exams": + MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), + "no_exams_label": + MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), + "no_favorite_restaurants": + MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), + "no_info": MessageLookupByLibrary.simpleMessage( + "Não existem informações para apresentar"), + "no_menu_info": MessageLookupByLibrary.simpleMessage( + "Não há informação disponível sobre refeições"), + "no_menus": MessageLookupByLibrary.simpleMessage( + "Não há refeições disponíveis"), + "no_name_course": + MessageLookupByLibrary.simpleMessage("Curso sem nome"), + "no_places_info": MessageLookupByLibrary.simpleMessage( + "Não há informação disponível sobre locais"), + "no_references": MessageLookupByLibrary.simpleMessage( + "Não existem referências a pagar"), + "no_results": MessageLookupByLibrary.simpleMessage("Sem resultados"), + "no_selected_courses": MessageLookupByLibrary.simpleMessage( + "Não existem cadeiras para apresentar"), + "no_selected_exams": MessageLookupByLibrary.simpleMessage( + "Não existem exames para apresentar"), + "occurrence_type": + MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), + "other_links": MessageLookupByLibrary.simpleMessage("Outros links"), + "pass_change_request": MessageLookupByLibrary.simpleMessage( + "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), + "password": MessageLookupByLibrary.simpleMessage("palavra-passe"), + "pendent_references": + MessageLookupByLibrary.simpleMessage("Referências pendentes"), + "personal_assistance": + MessageLookupByLibrary.simpleMessage("Atendimento presencial"), + "press_again": MessageLookupByLibrary.simpleMessage( + "Pressione novamente para sair"), + "print": MessageLookupByLibrary.simpleMessage("Impressão"), + "prints": MessageLookupByLibrary.simpleMessage("Impressões"), + "problem_id": MessageLookupByLibrary.simpleMessage( + "Breve identificação do problema"), + "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( + "Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), + "reference_success": MessageLookupByLibrary.simpleMessage( + "Referência criada com sucesso!"), + "remove": MessageLookupByLibrary.simpleMessage("Remover"), + "report_error": MessageLookupByLibrary.simpleMessage("Reportar erro"), + "room": MessageLookupByLibrary.simpleMessage("Sala"), + "school_calendar": + MessageLookupByLibrary.simpleMessage("Calendário Escolar"), + "semester": MessageLookupByLibrary.simpleMessage("Semestre"), + "send": MessageLookupByLibrary.simpleMessage("Enviar"), + "sent_error": + MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), + "some_error": MessageLookupByLibrary.simpleMessage("Algum erro!"), + "stcp_stops": + MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), + "student_number": + MessageLookupByLibrary.simpleMessage("número de estudante"), + "success": MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), + "tele_assistance": + MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), + "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( + "Atendimento presencial e telefónico"), + "telephone": MessageLookupByLibrary.simpleMessage("Telefone"), + "terms": MessageLookupByLibrary.simpleMessage("Termos e Condições"), + "title": MessageLookupByLibrary.simpleMessage("Título"), + "unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"), + "valid_email": MessageLookupByLibrary.simpleMessage( + "Por favor insere um email válido"), + "widget_prompt": MessageLookupByLibrary.simpleMessage( + "Escolhe um widget para adicionares à tua área pessoal:"), + "year": MessageLookupByLibrary.simpleMessage("Ano"), + "yes": MessageLookupByLibrary.simpleMessage("Sim") + }; } diff --git a/uni/lib/generated/l10n.dart b/uni/lib/generated/l10n.dart index b654d948c..e83e60201 100644 --- a/uni/lib/generated/l10n.dart +++ b/uni/lib/generated/l10n.dart @@ -18,28 +18,31 @@ class S { static S? _current; static S get current { - assert(_current != null, 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); return _current!; } - static const AppLocalizationDelegate delegate = - AppLocalizationDelegate(); + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); - final localeName = Intl.canonicalizedLocale(name); + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; final instance = S(); S._current = instance; - + return instance; }); - } + } static S of(BuildContext context) { final instance = S.maybeOf(context); - assert(instance != null, 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); return instance!; } @@ -1401,4 +1404,4 @@ class AppLocalizationDelegate extends LocalizationsDelegate { } return false; } -} \ No newline at end of file +} diff --git a/uni/lib/view/bug_report/widgets/form.dart b/uni/lib/view/bug_report/widgets/form.dart index 4e2dc41cb..c94af32b6 100644 --- a/uni/lib/view/bug_report/widgets/form.dart +++ b/uni/lib/view/bug_report/widgets/form.dart @@ -133,17 +133,17 @@ class BugReportFormState extends State { Widget bugReportTitle(BuildContext context) { return Container( margin: const EdgeInsets.symmetric(vertical: 10), - child: const Row( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Icon(Icons.bug_report, size: 40), + const Icon(Icons.bug_report, size: 40), PageTitle( name: S.of(context).nav_title( DrawerItem.navBugReport.title, ), center: false, ), - Icon(Icons.bug_report, size: 40), + const Icon(Icons.bug_report, size: 40), ], ), ); diff --git a/uni/lib/view/exams/widgets/exam_page_title.dart b/uni/lib/view/exams/widgets/exam_page_title.dart index 7b6898b66..ff3d46e64 100644 --- a/uni/lib/view/exams/widgets/exam_page_title.dart +++ b/uni/lib/view/exams/widgets/exam_page_title.dart @@ -12,7 +12,7 @@ class ExamPageTitle extends StatelessWidget { return Container( padding: const EdgeInsets.fromLTRB(20, 20, 20, 10), alignment: Alignment.center, - child: const Row( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ PageTitle( @@ -20,7 +20,7 @@ class ExamPageTitle extends StatelessWidget { center: false, pad: false, ), - Material(child: ExamFilterMenu()), + const Material(child: ExamFilterMenu()), ], ), ); diff --git a/uni/lib/view/library/widgets/library_reservations_card.dart b/uni/lib/view/library/widgets/library_reservations_card.dart index 657874377..862a0a71d 100644 --- a/uni/lib/view/library/widgets/library_reservations_card.dart +++ b/uni/lib/view/library/widgets/library_reservations_card.dart @@ -6,6 +6,7 @@ import 'package:uni/model/providers/lazy/library_reservations_provider.dart'; import 'package:uni/model/request_status.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; +import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/library/widgets/reservation_row.dart'; class LibraryReservationsCard extends GenericCard { @@ -34,8 +35,8 @@ class LibraryReservationsCard extends GenericCard { @override Widget buildCardContent(BuildContext context) { - return Consumer( - builder: (context, reservationsProvider, _) { + return LazyConsumer( + builder: (context, reservationsProvider) { if (reservationsProvider.status == RequestStatus.busy) { return const Center(child: CircularProgressIndicator()); } else { diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 82c4a6920..37bf4d3b6 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -3,7 +3,6 @@ import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:uni/model/entities/library_reservation.dart'; -import 'package:uni/model/entities/time_utilities.dart'; import 'package:uni/model/providers/lazy/library_reservations_provider.dart'; import 'package:uni/model/providers/startup/session_provider.dart'; import 'package:uni/view/common_widgets/toast_message.dart'; @@ -14,9 +13,6 @@ class ReservationRow extends StatelessWidget { hoursStart = DateFormat('HH:mm').format(reservation.startDate); hoursEnd = DateFormat('HH:mm') .format(reservation.startDate.add(reservation.duration)); - weekDay = TimeString.getWeekdaysStrings( - startMonday: false, - )[reservation.startDate.weekday]; day = DateFormat('dd').format(reservation.startDate); initializeDateFormatting(); month = DateFormat('MMMM', 'pt').format(reservation.startDate); diff --git a/uni/lib/view/restaurant/restaurant_page_view.dart b/uni/lib/view/restaurant/restaurant_page_view.dart index 5bbf512a8..80a1c96b5 100644 --- a/uni/lib/view/restaurant/restaurant_page_view.dart +++ b/uni/lib/view/restaurant/restaurant_page_view.dart @@ -141,7 +141,7 @@ class _RestaurantPageViewState extends GeneralPageViewState return Container( margin: const EdgeInsets.only(top: 10, bottom: 5), key: Key('restaurant-page-day-column-$day'), - child: const Column( + child: Column( mainAxisSize: MainAxisSize.min, children: [ Center(child: Text(S.of(context).no_menu_info)), From b50816f4ad2beda89556054d425200b7d41735d3 Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 26 Sep 2023 17:19:32 +0100 Subject: [PATCH 30/45] Added missing translations --- uni/lib/generated/intl/messages_all.dart | 9 +- uni/lib/generated/intl/messages_en.dart | 367 +++++++---------- uni/lib/generated/intl/messages_pt_PT.dart | 368 +++++++----------- uni/lib/generated/l10n.dart | 71 +++- uni/lib/l10n/intl_en.arb | 10 + uni/lib/l10n/intl_pt_PT.arb | 10 + .../view/library/widgets/reservation_row.dart | 14 +- .../useful_info/widgets/other_links_card.dart | 2 +- 8 files changed, 373 insertions(+), 478 deletions(-) diff --git a/uni/lib/generated/intl/messages_all.dart b/uni/lib/generated/intl/messages_all.dart index 6b3ebeae5..fb1bd2689 100644 --- a/uni/lib/generated/intl/messages_all.dart +++ b/uni/lib/generated/intl/messages_all.dart @@ -38,8 +38,9 @@ MessageLookupByLibrary? _findExact(String localeName) { /// User programs should call this before using [localeName] for messages. Future initializeMessages(String localeName) async { var availableLocale = Intl.verifiedLocale( - localeName, (locale) => _deferredLibraries[locale] != null, - onFailure: (_) => null); + localeName, + (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); if (availableLocale == null) { return new Future.value(false); } @@ -59,8 +60,8 @@ bool _messagesExistFor(String locale) { } MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { - var actualLocale = - Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, + onFailure: (_) => null); if (actualLocale == null) return null; return _findExact(actualLocale); } diff --git a/uni/lib/generated/intl/messages_en.dart b/uni/lib/generated/intl/messages_en.dart index 9d2823c7d..6e30c4fca 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -21,234 +21,147 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "last refresh at ${time}"; - static m1(time) => - "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; + static m1(time) => "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; - static m2(title) => "${Intl.select(title, { - 'horario': 'Schedule', - 'exames': 'Exams', - 'area': 'Personal Area', - 'cadeiras': 'Course Units', - 'autocarros': 'Buses', - 'locais': 'Places', - 'restaurantes': 'Restaurants', - 'calendario': 'Calendar', - 'biblioteca': 'Library', - 'uteis': 'Utils', - 'sobre': 'About', - 'bugs': 'Bugs/Suggestions', - 'other': 'Other', - })}"; + static m2(title) => "${Intl.select(title, {'horario': 'Schedule', 'exames': 'Exams', 'area': 'Personal Area', 'cadeiras': 'Course Units', 'autocarros': 'Buses', 'locais': 'Places', 'restaurantes': 'Restaurants', 'calendario': 'Calendar', 'biblioteca': 'Library', 'uteis': 'Utils', 'sobre': 'About', 'bugs': 'Bugs/Suggestions', 'other': 'Other', })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services": - MessageLookupByLibrary.simpleMessage("Academic services"), - "account_card_title": - MessageLookupByLibrary.simpleMessage("Checking account"), - "add": MessageLookupByLibrary.simpleMessage("Add"), - "add_quota": MessageLookupByLibrary.simpleMessage("Add quota"), - "add_widget": MessageLookupByLibrary.simpleMessage("Add widget"), - "agree_terms": MessageLookupByLibrary.simpleMessage( - "By entering you confirm that you agree with these Terms and Conditions"), - "all_widgets_added": MessageLookupByLibrary.simpleMessage( - "All available widgets have already been added to your personal area!"), - "at_least_one_college": - MessageLookupByLibrary.simpleMessage("Select at least one college"), - "available_amount": - MessageLookupByLibrary.simpleMessage("Available amount"), - "average": MessageLookupByLibrary.simpleMessage("Average: "), - "balance": MessageLookupByLibrary.simpleMessage("Balance:"), - "bs_description": MessageLookupByLibrary.simpleMessage( - "Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), - "bug_description": MessageLookupByLibrary.simpleMessage( - "Bug found, how to reproduce it, etc."), - "bus_error": - MessageLookupByLibrary.simpleMessage("Unable to get information"), - "bus_information": MessageLookupByLibrary.simpleMessage( - "Select the buses you want information about:"), - "buses_personalize": - MessageLookupByLibrary.simpleMessage("Personalize your buses here"), - "buses_text": MessageLookupByLibrary.simpleMessage( - "Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), - "cancel": MessageLookupByLibrary.simpleMessage("Cancel"), - "change": MessageLookupByLibrary.simpleMessage("Change"), - "change_prompt": MessageLookupByLibrary.simpleMessage( - "Do you want to change the password?"), - "check_internet": MessageLookupByLibrary.simpleMessage( - "Check your internet connection"), - "class_registration": - MessageLookupByLibrary.simpleMessage("Class Registration"), - "college": MessageLookupByLibrary.simpleMessage("College: "), - "college_select": - MessageLookupByLibrary.simpleMessage("select your college(s)"), - "conclude": MessageLookupByLibrary.simpleMessage("Done"), - "configured_buses": - MessageLookupByLibrary.simpleMessage("Configured Buses"), - "confirm": MessageLookupByLibrary.simpleMessage("Confirm"), - "consent": MessageLookupByLibrary.simpleMessage( - "I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), - "contact": MessageLookupByLibrary.simpleMessage("Contact (optional)"), - "copy_center": MessageLookupByLibrary.simpleMessage("Copy center"), - "copy_center_building": MessageLookupByLibrary.simpleMessage( - "Floor -1 of building B | AEFEUP building"), - "course_class": MessageLookupByLibrary.simpleMessage("Classes"), - "course_info": MessageLookupByLibrary.simpleMessage("Info"), - "current_state": - MessageLookupByLibrary.simpleMessage("Current state: "), - "current_year": - MessageLookupByLibrary.simpleMessage("Current academic year: "), - "decrement": MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), - "description": MessageLookupByLibrary.simpleMessage("Description"), - "desired_email": MessageLookupByLibrary.simpleMessage( - "Email where you want to be contacted"), - "dona_bia": MessageLookupByLibrary.simpleMessage( - "D. Beatriz\'s stationery store"), - "dona_bia_building": MessageLookupByLibrary.simpleMessage( - "Floor -1 of building B (B-142)"), - "ects": MessageLookupByLibrary.simpleMessage("ECTs performed: "), - "edit_off": MessageLookupByLibrary.simpleMessage("Edit"), - "edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"), - "empty_text": - MessageLookupByLibrary.simpleMessage("Please fill in this field"), - "exams_filter": - MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), - "exit_confirm": - MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), - "expired_password": - MessageLookupByLibrary.simpleMessage("Your password has expired"), - "failed_login": MessageLookupByLibrary.simpleMessage("Login failed"), - "fee_date": - MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), - "fee_notification": - MessageLookupByLibrary.simpleMessage("Notify next deadline:"), - "first_year_registration": MessageLookupByLibrary.simpleMessage( - "Year of first registration: "), - "floor": MessageLookupByLibrary.simpleMessage("Floor"), - "floors": MessageLookupByLibrary.simpleMessage("Floors"), - "forgot_password": - MessageLookupByLibrary.simpleMessage("Forgot password?"), - "generate_reference": - MessageLookupByLibrary.simpleMessage("Generate reference"), - "geral_registration": - MessageLookupByLibrary.simpleMessage("General Registration"), - "improvement_registration": - MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), - "increment": MessageLookupByLibrary.simpleMessage("Increment 1,00€"), - "invalid_credentials": - MessageLookupByLibrary.simpleMessage("Invalid credentials"), - "keep_login": MessageLookupByLibrary.simpleMessage("Stay signed in"), - "last_refresh_time": m0, - "last_timestamp": m1, - "library": MessageLookupByLibrary.simpleMessage("Library"), - "library_occupation": - MessageLookupByLibrary.simpleMessage("Library Occupation"), - "library_reservations": - MessageLookupByLibrary.simpleMessage("Library Reservations"), - "library_tab_occupation": - MessageLookupByLibrary.simpleMessage("Occupation"), - "library_tab_reservations": - MessageLookupByLibrary.simpleMessage("Reservations"), - "load_error": MessageLookupByLibrary.simpleMessage( - "Error loading the information"), - "loading_terms": MessageLookupByLibrary.simpleMessage( - "Loading Terms and Conditions..."), - "login": MessageLookupByLibrary.simpleMessage("Login"), - "logout": MessageLookupByLibrary.simpleMessage("Log out"), - "menus": MessageLookupByLibrary.simpleMessage("Menus"), - "min_value_reference": - MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), - "multimedia_center": - MessageLookupByLibrary.simpleMessage("Multimedia center"), - "nav_title": m2, - "news": MessageLookupByLibrary.simpleMessage("News"), - "no": MessageLookupByLibrary.simpleMessage("No"), - "no_bus": MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), - "no_bus_stops": - MessageLookupByLibrary.simpleMessage("No configured stops"), - "no_class": MessageLookupByLibrary.simpleMessage( - "There are no classes to display"), - "no_classes": - MessageLookupByLibrary.simpleMessage("No classes to present"), - "no_classes_on": - MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), - "no_college": MessageLookupByLibrary.simpleMessage("no college"), - "no_course_units": MessageLookupByLibrary.simpleMessage( - "No course units in the selected period"), - "no_data": MessageLookupByLibrary.simpleMessage( - "There is no data to show at this time"), - "no_date": MessageLookupByLibrary.simpleMessage("No date"), - "no_exams": MessageLookupByLibrary.simpleMessage( - "You have no exams scheduled\n"), - "no_exams_label": MessageLookupByLibrary.simpleMessage( - "Looks like you are on vacation!"), - "no_favorite_restaurants": - MessageLookupByLibrary.simpleMessage("No favorite restaurants"), - "no_info": MessageLookupByLibrary.simpleMessage( - "There is no information to display"), - "no_menu_info": MessageLookupByLibrary.simpleMessage( - "There is no information available about meals"), - "no_menus": MessageLookupByLibrary.simpleMessage( - "There are no meals available"), - "no_name_course": - MessageLookupByLibrary.simpleMessage("Unnamed course"), - "no_places_info": MessageLookupByLibrary.simpleMessage( - "There is no information available about places"), - "no_references": MessageLookupByLibrary.simpleMessage( - "There are no references to pay"), - "no_results": MessageLookupByLibrary.simpleMessage("No match"), - "no_selected_courses": MessageLookupByLibrary.simpleMessage( - "There are no course units to display"), - "no_selected_exams": MessageLookupByLibrary.simpleMessage( - "There are no exams to present"), - "occurrence_type": - MessageLookupByLibrary.simpleMessage("Type of occurrence"), - "other_links": MessageLookupByLibrary.simpleMessage("Other links"), - "pass_change_request": MessageLookupByLibrary.simpleMessage( - "For security reasons, passwords must be changed periodically."), - "password": MessageLookupByLibrary.simpleMessage("password"), - "pendent_references": - MessageLookupByLibrary.simpleMessage("Pending references"), - "personal_assistance": - MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), - "press_again": - MessageLookupByLibrary.simpleMessage("Press again to exit"), - "print": MessageLookupByLibrary.simpleMessage("Print"), - "prints": MessageLookupByLibrary.simpleMessage("Prints"), - "problem_id": MessageLookupByLibrary.simpleMessage( - "Brief identification of the problem"), - "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( - "The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), - "reference_success": MessageLookupByLibrary.simpleMessage( - "Reference created successfully!"), - "remove": MessageLookupByLibrary.simpleMessage("Delete"), - "report_error": MessageLookupByLibrary.simpleMessage("Report error"), - "room": MessageLookupByLibrary.simpleMessage("Room"), - "school_calendar": - MessageLookupByLibrary.simpleMessage("School Calendar"), - "semester": MessageLookupByLibrary.simpleMessage("Semester"), - "send": MessageLookupByLibrary.simpleMessage("Send"), - "sent_error": MessageLookupByLibrary.simpleMessage( - "An error occurred in sending"), - "some_error": MessageLookupByLibrary.simpleMessage("Some error!"), - "stcp_stops": - MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), - "student_number": - MessageLookupByLibrary.simpleMessage("student number"), - "success": MessageLookupByLibrary.simpleMessage("Sent with success"), - "tele_assistance": - MessageLookupByLibrary.simpleMessage("Telephone assistance"), - "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( - "Face-to-face and telephone assistance"), - "telephone": MessageLookupByLibrary.simpleMessage("Telephone"), - "terms": MessageLookupByLibrary.simpleMessage("Terms and Conditions"), - "title": MessageLookupByLibrary.simpleMessage("Title"), - "unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"), - "valid_email": - MessageLookupByLibrary.simpleMessage("Please enter a valid email"), - "widget_prompt": MessageLookupByLibrary.simpleMessage( - "Choose a widget to add to your personal area:"), - "year": MessageLookupByLibrary.simpleMessage("Year"), - "yes": MessageLookupByLibrary.simpleMessage("Yes") - }; + static _notInlinedMessages(_) => { + "academic_services" : MessageLookupByLibrary.simpleMessage("Academic services"), + "account_card_title" : MessageLookupByLibrary.simpleMessage("Checking account"), + "add" : MessageLookupByLibrary.simpleMessage("Add"), + "add_quota" : MessageLookupByLibrary.simpleMessage("Add quota"), + "add_widget" : MessageLookupByLibrary.simpleMessage("Add widget"), + "agree_terms" : MessageLookupByLibrary.simpleMessage("By entering you confirm that you agree with these Terms and Conditions"), + "all_widgets_added" : MessageLookupByLibrary.simpleMessage("All available widgets have already been added to your personal area!"), + "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Select at least one college"), + "available_amount" : MessageLookupByLibrary.simpleMessage("Available amount"), + "average" : MessageLookupByLibrary.simpleMessage("Average: "), + "balance" : MessageLookupByLibrary.simpleMessage("Balance:"), + "bs_description" : MessageLookupByLibrary.simpleMessage("Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), + "bug_description" : MessageLookupByLibrary.simpleMessage("Bug found, how to reproduce it, etc."), + "bus_error" : MessageLookupByLibrary.simpleMessage("Unable to get information"), + "bus_information" : MessageLookupByLibrary.simpleMessage("Select the buses you want information about:"), + "buses_personalize" : MessageLookupByLibrary.simpleMessage("Personalize your buses here"), + "buses_text" : MessageLookupByLibrary.simpleMessage("Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), + "cancel" : MessageLookupByLibrary.simpleMessage("Cancel"), + "change" : MessageLookupByLibrary.simpleMessage("Change"), + "change_prompt" : MessageLookupByLibrary.simpleMessage("Do you want to change the password?"), + "check_internet" : MessageLookupByLibrary.simpleMessage("Check your internet connection"), + "class_registration" : MessageLookupByLibrary.simpleMessage("Class Registration"), + "college" : MessageLookupByLibrary.simpleMessage("College: "), + "college_select" : MessageLookupByLibrary.simpleMessage("select your college(s)"), + "conclude" : MessageLookupByLibrary.simpleMessage("Done"), + "configured_buses" : MessageLookupByLibrary.simpleMessage("Configured Buses"), + "confirm" : MessageLookupByLibrary.simpleMessage("Confirm"), + "consent" : MessageLookupByLibrary.simpleMessage("I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), + "contact" : MessageLookupByLibrary.simpleMessage("Contact (optional)"), + "copy_center" : MessageLookupByLibrary.simpleMessage("Copy center"), + "copy_center_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B | AEFEUP building"), + "course_class" : MessageLookupByLibrary.simpleMessage("Classes"), + "course_info" : MessageLookupByLibrary.simpleMessage("Info"), + "current_state" : MessageLookupByLibrary.simpleMessage("Current state: "), + "current_year" : MessageLookupByLibrary.simpleMessage("Current academic year: "), + "decrement" : MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), + "description" : MessageLookupByLibrary.simpleMessage("Description"), + "desired_email" : MessageLookupByLibrary.simpleMessage("Email where you want to be contacted"), + "dona_bia" : MessageLookupByLibrary.simpleMessage("D. Beatriz\'s stationery store"), + "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B (B-142)"), + "ects" : MessageLookupByLibrary.simpleMessage("ECTs performed: "), + "edit_off" : MessageLookupByLibrary.simpleMessage("Edit"), + "edit_on" : MessageLookupByLibrary.simpleMessage("Finish editing"), + "empty_text" : MessageLookupByLibrary.simpleMessage("Please fill in this field"), + "exams_filter" : MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), + "exit_confirm" : MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), + "expired_password" : MessageLookupByLibrary.simpleMessage("Your password has expired"), + "failed_login" : MessageLookupByLibrary.simpleMessage("Login failed"), + "fee_date" : MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), + "fee_notification" : MessageLookupByLibrary.simpleMessage("Notify next deadline:"), + "first_year_registration" : MessageLookupByLibrary.simpleMessage("Year of first registration: "), + "floor" : MessageLookupByLibrary.simpleMessage("Floor"), + "floors" : MessageLookupByLibrary.simpleMessage("Floors"), + "forgot_password" : MessageLookupByLibrary.simpleMessage("Forgot password?"), + "generate_reference" : MessageLookupByLibrary.simpleMessage("Generate reference"), + "geral_registration" : MessageLookupByLibrary.simpleMessage("General Registration"), + "go_back" : MessageLookupByLibrary.simpleMessage("Go back"), + "improvement_registration" : MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), + "increment" : MessageLookupByLibrary.simpleMessage("Increment 1,00€"), + "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Invalid credentials"), + "keep_login" : MessageLookupByLibrary.simpleMessage("Stay signed in"), + "last_refresh_time" : m0, + "last_timestamp" : m1, + "library" : MessageLookupByLibrary.simpleMessage("Library"), + "library_cancel_error" : MessageLookupByLibrary.simpleMessage("An error occurred while canceling your reservation!"), + "library_cancel_reservation" : MessageLookupByLibrary.simpleMessage("Do you want to cancel this reservation?"), + "library_cancel_success" : MessageLookupByLibrary.simpleMessage("Your reservation was canceled!"), + "library_cancel_tooltip" : MessageLookupByLibrary.simpleMessage("Cancel reservation"), + "library_occupation" : MessageLookupByLibrary.simpleMessage("Library Occupation"), + "library_reservations" : MessageLookupByLibrary.simpleMessage("Library Reservations"), + "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Occupation"), + "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Reservations"), + "load_error" : MessageLookupByLibrary.simpleMessage("Error loading the information"), + "loading_terms" : MessageLookupByLibrary.simpleMessage("Loading Terms and Conditions..."), + "login" : MessageLookupByLibrary.simpleMessage("Login"), + "logout" : MessageLookupByLibrary.simpleMessage("Log out"), + "menus" : MessageLookupByLibrary.simpleMessage("Menus"), + "min_value_reference" : MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), + "multimedia_center" : MessageLookupByLibrary.simpleMessage("Multimedia center"), + "nav_title" : m2, + "news" : MessageLookupByLibrary.simpleMessage("News"), + "no" : MessageLookupByLibrary.simpleMessage("No"), + "no_bus" : MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), + "no_bus_stops" : MessageLookupByLibrary.simpleMessage("No configured stops"), + "no_class" : MessageLookupByLibrary.simpleMessage("There are no classes to display"), + "no_classes" : MessageLookupByLibrary.simpleMessage("No classes to present"), + "no_classes_on" : MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), + "no_college" : MessageLookupByLibrary.simpleMessage("no college"), + "no_course_units" : MessageLookupByLibrary.simpleMessage("No course units in the selected period"), + "no_data" : MessageLookupByLibrary.simpleMessage("There is no data to show at this time"), + "no_date" : MessageLookupByLibrary.simpleMessage("No date"), + "no_exams" : MessageLookupByLibrary.simpleMessage("You have no exams scheduled\n"), + "no_exams_label" : MessageLookupByLibrary.simpleMessage("Looks like you are on vacation!"), + "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("No favorite restaurants"), + "no_info" : MessageLookupByLibrary.simpleMessage("There is no information to display"), + "no_menu_info" : MessageLookupByLibrary.simpleMessage("There is no information available about meals"), + "no_menus" : MessageLookupByLibrary.simpleMessage("There are no meals available"), + "no_name_course" : MessageLookupByLibrary.simpleMessage("Unnamed course"), + "no_places_info" : MessageLookupByLibrary.simpleMessage("There is no information available about places"), + "no_references" : MessageLookupByLibrary.simpleMessage("There are no references to pay"), + "no_results" : MessageLookupByLibrary.simpleMessage("No match"), + "no_selected_courses" : MessageLookupByLibrary.simpleMessage("There are no course units to display"), + "no_selected_exams" : MessageLookupByLibrary.simpleMessage("There are no exams to present"), + "occurrence_type" : MessageLookupByLibrary.simpleMessage("Type of occurrence"), + "other_links" : MessageLookupByLibrary.simpleMessage("Other links"), + "pass_change_request" : MessageLookupByLibrary.simpleMessage("For security reasons, passwords must be changed periodically."), + "password" : MessageLookupByLibrary.simpleMessage("password"), + "pendent_references" : MessageLookupByLibrary.simpleMessage("Pending references"), + "personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), + "press_again" : MessageLookupByLibrary.simpleMessage("Press again to exit"), + "print" : MessageLookupByLibrary.simpleMessage("Print"), + "prints" : MessageLookupByLibrary.simpleMessage("Prints"), + "problem_id" : MessageLookupByLibrary.simpleMessage("Brief identification of the problem"), + "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), + "reference_success" : MessageLookupByLibrary.simpleMessage("Reference created successfully!"), + "remove" : MessageLookupByLibrary.simpleMessage("Delete"), + "report_error" : MessageLookupByLibrary.simpleMessage("Report error"), + "room" : MessageLookupByLibrary.simpleMessage("Room"), + "school_calendar" : MessageLookupByLibrary.simpleMessage("School Calendar"), + "semester" : MessageLookupByLibrary.simpleMessage("Semester"), + "send" : MessageLookupByLibrary.simpleMessage("Send"), + "sent_error" : MessageLookupByLibrary.simpleMessage("An error occurred in sending"), + "some_error" : MessageLookupByLibrary.simpleMessage("Some error!"), + "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), + "student_number" : MessageLookupByLibrary.simpleMessage("student number"), + "success" : MessageLookupByLibrary.simpleMessage("Sent with success"), + "tele_assistance" : MessageLookupByLibrary.simpleMessage("Telephone assistance"), + "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face and telephone assistance"), + "telephone" : MessageLookupByLibrary.simpleMessage("Telephone"), + "terms" : MessageLookupByLibrary.simpleMessage("Terms and Conditions"), + "title" : MessageLookupByLibrary.simpleMessage("Title"), + "unavailable" : MessageLookupByLibrary.simpleMessage("Unavailable"), + "valid_email" : MessageLookupByLibrary.simpleMessage("Please enter a valid email"), + "widget_prompt" : MessageLookupByLibrary.simpleMessage("Choose a widget to add to your personal area:"), + "year" : MessageLookupByLibrary.simpleMessage("Year"), + "yes" : MessageLookupByLibrary.simpleMessage("Yes") + }; } diff --git a/uni/lib/generated/intl/messages_pt_PT.dart b/uni/lib/generated/intl/messages_pt_PT.dart index be4f1ae44..2f34854bc 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -21,235 +21,147 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "última atualização às ${time}"; - static m1(time) => - "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; + static m1(time) => "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; - static m2(title) => "${Intl.select(title, { - 'horario': 'Horário', - 'exames': 'Exames', - 'area': 'Área Pessoal', - 'cadeiras': 'Cadeiras', - 'autocarros': 'Autocarros', - 'locais': 'Locais', - 'restaurantes': 'Restaurantes', - 'calendario': 'Calendário', - 'biblioteca': 'Biblioteca', - 'uteis': 'Úteis', - 'sobre': 'Sobre', - 'bugs': 'Bugs e Sugestões', - 'other': 'Outros', - })}"; + static m2(title) => "${Intl.select(title, {'horario': 'Horário', 'exames': 'Exames', 'area': 'Área Pessoal', 'cadeiras': 'Cadeiras', 'autocarros': 'Autocarros', 'locais': 'Locais', 'restaurantes': 'Restaurantes', 'calendario': 'Calendário', 'biblioteca': 'Biblioteca', 'uteis': 'Úteis', 'sobre': 'Sobre', 'bugs': 'Bugs e Sugestões', 'other': 'Outros', })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services": - MessageLookupByLibrary.simpleMessage("Serviços académicos"), - "account_card_title": - MessageLookupByLibrary.simpleMessage("Conta Corrente"), - "add": MessageLookupByLibrary.simpleMessage("Adicionar"), - "add_quota": MessageLookupByLibrary.simpleMessage("Adicionar quota"), - "add_widget": MessageLookupByLibrary.simpleMessage("Adicionar widget"), - "agree_terms": MessageLookupByLibrary.simpleMessage( - "Ao entrares confirmas que concordas com estes Termos e Condições"), - "all_widgets_added": MessageLookupByLibrary.simpleMessage( - "Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), - "at_least_one_college": MessageLookupByLibrary.simpleMessage( - "Seleciona pelo menos uma faculdade"), - "available_amount": - MessageLookupByLibrary.simpleMessage("Valor disponível"), - "average": MessageLookupByLibrary.simpleMessage("Média: "), - "balance": MessageLookupByLibrary.simpleMessage("Saldo:"), - "bs_description": MessageLookupByLibrary.simpleMessage( - "Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), - "bug_description": MessageLookupByLibrary.simpleMessage( - "Bug encontrado, como o reproduzir, etc"), - "bus_error": MessageLookupByLibrary.simpleMessage( - "Não foi possível obter informação"), - "bus_information": MessageLookupByLibrary.simpleMessage( - "Seleciona os autocarros dos quais queres informação:"), - "buses_personalize": MessageLookupByLibrary.simpleMessage( - "Configura aqui os teus autocarros"), - "buses_text": MessageLookupByLibrary.simpleMessage( - "Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), - "cancel": MessageLookupByLibrary.simpleMessage("Cancelar\n"), - "change": MessageLookupByLibrary.simpleMessage("Alterar"), - "change_prompt": MessageLookupByLibrary.simpleMessage( - "Deseja alterar a palavra-passe?"), - "check_internet": MessageLookupByLibrary.simpleMessage( - "Verifica a tua ligação à internet"), - "class_registration": - MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), - "college": MessageLookupByLibrary.simpleMessage("Faculdade: "), - "college_select": MessageLookupByLibrary.simpleMessage( - "seleciona a(s) tua(s) faculdade(s)"), - "conclude": MessageLookupByLibrary.simpleMessage("Concluído"), - "configured_buses": - MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), - "confirm": MessageLookupByLibrary.simpleMessage("Confirmar"), - "consent": MessageLookupByLibrary.simpleMessage( - "Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), - "contact": MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), - "copy_center": MessageLookupByLibrary.simpleMessage("Centro de cópias"), - "copy_center_building": MessageLookupByLibrary.simpleMessage( - "Piso -1 do edifício B | Edifício da AEFEUP"), - "course_class": MessageLookupByLibrary.simpleMessage("Turmas"), - "course_info": MessageLookupByLibrary.simpleMessage("Ficha"), - "current_state": MessageLookupByLibrary.simpleMessage("Estado atual: "), - "current_year": - MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), - "decrement": MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), - "description": MessageLookupByLibrary.simpleMessage("Descrição"), - "desired_email": MessageLookupByLibrary.simpleMessage( - "Email em que desejas ser contactado"), - "dona_bia": - MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), - "dona_bia_building": MessageLookupByLibrary.simpleMessage( - "Piso -1 do edifício B (B-142)"), - "ects": MessageLookupByLibrary.simpleMessage("ECTs realizados: "), - "edit_off": MessageLookupByLibrary.simpleMessage("Editar\n"), - "edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"), - "empty_text": MessageLookupByLibrary.simpleMessage( - "Por favor preenche este campo"), - "exams_filter": - MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), - "exit_confirm": MessageLookupByLibrary.simpleMessage( - "Tem a certeza de que pretende sair?"), - "expired_password": - MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), - "failed_login": MessageLookupByLibrary.simpleMessage("O login falhou"), - "fee_date": MessageLookupByLibrary.simpleMessage( - "Data limite próxima prestação:"), - "fee_notification": MessageLookupByLibrary.simpleMessage( - "Notificar próxima data limite:"), - "first_year_registration": - MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), - "floor": MessageLookupByLibrary.simpleMessage("Piso"), - "floors": MessageLookupByLibrary.simpleMessage("Pisos"), - "forgot_password": - MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), - "generate_reference": - MessageLookupByLibrary.simpleMessage("Gerar referência"), - "geral_registration": - MessageLookupByLibrary.simpleMessage("Inscrição Geral"), - "improvement_registration": - MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), - "increment": MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), - "invalid_credentials": - MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), - "keep_login": - MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), - "last_refresh_time": m0, - "last_timestamp": m1, - "library": MessageLookupByLibrary.simpleMessage("Biblioteca"), - "library_occupation": - MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), - "library_reservations": - MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), - "library_tab_occupation": - MessageLookupByLibrary.simpleMessage("Ocupação"), - "library_tab_reservations": - MessageLookupByLibrary.simpleMessage("Gabinetes"), - "load_error": MessageLookupByLibrary.simpleMessage( - "Aconteceu um erro ao carregar os dados"), - "loading_terms": MessageLookupByLibrary.simpleMessage( - "Carregando os Termos e Condições..."), - "login": MessageLookupByLibrary.simpleMessage("Entrar"), - "logout": MessageLookupByLibrary.simpleMessage("Terminar sessão"), - "menus": MessageLookupByLibrary.simpleMessage("Ementas"), - "min_value_reference": - MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), - "multimedia_center": - MessageLookupByLibrary.simpleMessage("Centro de multimédia"), - "nav_title": m2, - "news": MessageLookupByLibrary.simpleMessage("Notícias"), - "no": MessageLookupByLibrary.simpleMessage("Não"), - "no_bus": MessageLookupByLibrary.simpleMessage( - "Não percas nenhum autocarro!"), - "no_bus_stops": MessageLookupByLibrary.simpleMessage( - "Não existe nenhuma paragem configurada"), - "no_class": MessageLookupByLibrary.simpleMessage( - "Não existem turmas para apresentar"), - "no_classes": MessageLookupByLibrary.simpleMessage( - "Não existem aulas para apresentar"), - "no_classes_on": - MessageLookupByLibrary.simpleMessage("Não possui aulas à"), - "no_college": MessageLookupByLibrary.simpleMessage("sem faculdade"), - "no_course_units": MessageLookupByLibrary.simpleMessage( - "Sem cadeiras no período selecionado"), - "no_data": MessageLookupByLibrary.simpleMessage( - "Não há dados a mostrar neste momento"), - "no_date": MessageLookupByLibrary.simpleMessage("Sem data"), - "no_exams": - MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), - "no_exams_label": - MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), - "no_favorite_restaurants": - MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), - "no_info": MessageLookupByLibrary.simpleMessage( - "Não existem informações para apresentar"), - "no_menu_info": MessageLookupByLibrary.simpleMessage( - "Não há informação disponível sobre refeições"), - "no_menus": MessageLookupByLibrary.simpleMessage( - "Não há refeições disponíveis"), - "no_name_course": - MessageLookupByLibrary.simpleMessage("Curso sem nome"), - "no_places_info": MessageLookupByLibrary.simpleMessage( - "Não há informação disponível sobre locais"), - "no_references": MessageLookupByLibrary.simpleMessage( - "Não existem referências a pagar"), - "no_results": MessageLookupByLibrary.simpleMessage("Sem resultados"), - "no_selected_courses": MessageLookupByLibrary.simpleMessage( - "Não existem cadeiras para apresentar"), - "no_selected_exams": MessageLookupByLibrary.simpleMessage( - "Não existem exames para apresentar"), - "occurrence_type": - MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), - "other_links": MessageLookupByLibrary.simpleMessage("Outros links"), - "pass_change_request": MessageLookupByLibrary.simpleMessage( - "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), - "password": MessageLookupByLibrary.simpleMessage("palavra-passe"), - "pendent_references": - MessageLookupByLibrary.simpleMessage("Referências pendentes"), - "personal_assistance": - MessageLookupByLibrary.simpleMessage("Atendimento presencial"), - "press_again": MessageLookupByLibrary.simpleMessage( - "Pressione novamente para sair"), - "print": MessageLookupByLibrary.simpleMessage("Impressão"), - "prints": MessageLookupByLibrary.simpleMessage("Impressões"), - "problem_id": MessageLookupByLibrary.simpleMessage( - "Breve identificação do problema"), - "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( - "Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), - "reference_success": MessageLookupByLibrary.simpleMessage( - "Referência criada com sucesso!"), - "remove": MessageLookupByLibrary.simpleMessage("Remover"), - "report_error": MessageLookupByLibrary.simpleMessage("Reportar erro"), - "room": MessageLookupByLibrary.simpleMessage("Sala"), - "school_calendar": - MessageLookupByLibrary.simpleMessage("Calendário Escolar"), - "semester": MessageLookupByLibrary.simpleMessage("Semestre"), - "send": MessageLookupByLibrary.simpleMessage("Enviar"), - "sent_error": - MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), - "some_error": MessageLookupByLibrary.simpleMessage("Algum erro!"), - "stcp_stops": - MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), - "student_number": - MessageLookupByLibrary.simpleMessage("número de estudante"), - "success": MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), - "tele_assistance": - MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), - "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( - "Atendimento presencial e telefónico"), - "telephone": MessageLookupByLibrary.simpleMessage("Telefone"), - "terms": MessageLookupByLibrary.simpleMessage("Termos e Condições"), - "title": MessageLookupByLibrary.simpleMessage("Título"), - "unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"), - "valid_email": MessageLookupByLibrary.simpleMessage( - "Por favor insere um email válido"), - "widget_prompt": MessageLookupByLibrary.simpleMessage( - "Escolhe um widget para adicionares à tua área pessoal:"), - "year": MessageLookupByLibrary.simpleMessage("Ano"), - "yes": MessageLookupByLibrary.simpleMessage("Sim") - }; + static _notInlinedMessages(_) => { + "academic_services" : MessageLookupByLibrary.simpleMessage("Serviços académicos"), + "account_card_title" : MessageLookupByLibrary.simpleMessage("Conta Corrente"), + "add" : MessageLookupByLibrary.simpleMessage("Adicionar"), + "add_quota" : MessageLookupByLibrary.simpleMessage("Adicionar quota"), + "add_widget" : MessageLookupByLibrary.simpleMessage("Adicionar widget"), + "agree_terms" : MessageLookupByLibrary.simpleMessage("Ao entrares confirmas que concordas com estes Termos e Condições"), + "all_widgets_added" : MessageLookupByLibrary.simpleMessage("Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), + "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Seleciona pelo menos uma faculdade"), + "available_amount" : MessageLookupByLibrary.simpleMessage("Valor disponível"), + "average" : MessageLookupByLibrary.simpleMessage("Média: "), + "balance" : MessageLookupByLibrary.simpleMessage("Saldo:"), + "bs_description" : MessageLookupByLibrary.simpleMessage("Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), + "bug_description" : MessageLookupByLibrary.simpleMessage("Bug encontrado, como o reproduzir, etc"), + "bus_error" : MessageLookupByLibrary.simpleMessage("Não foi possível obter informação"), + "bus_information" : MessageLookupByLibrary.simpleMessage("Seleciona os autocarros dos quais queres informação:"), + "buses_personalize" : MessageLookupByLibrary.simpleMessage("Configura aqui os teus autocarros"), + "buses_text" : MessageLookupByLibrary.simpleMessage("Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), + "cancel" : MessageLookupByLibrary.simpleMessage("Cancelar\n"), + "change" : MessageLookupByLibrary.simpleMessage("Alterar"), + "change_prompt" : MessageLookupByLibrary.simpleMessage("Deseja alterar a palavra-passe?"), + "check_internet" : MessageLookupByLibrary.simpleMessage("Verifica a tua ligação à internet"), + "class_registration" : MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), + "college" : MessageLookupByLibrary.simpleMessage("Faculdade: "), + "college_select" : MessageLookupByLibrary.simpleMessage("seleciona a(s) tua(s) faculdade(s)"), + "conclude" : MessageLookupByLibrary.simpleMessage("Concluído"), + "configured_buses" : MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), + "confirm" : MessageLookupByLibrary.simpleMessage("Confirmar"), + "consent" : MessageLookupByLibrary.simpleMessage("Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), + "contact" : MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), + "copy_center" : MessageLookupByLibrary.simpleMessage("Centro de cópias"), + "copy_center_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B | Edifício da AEFEUP"), + "course_class" : MessageLookupByLibrary.simpleMessage("Turmas"), + "course_info" : MessageLookupByLibrary.simpleMessage("Ficha"), + "current_state" : MessageLookupByLibrary.simpleMessage("Estado atual: "), + "current_year" : MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), + "decrement" : MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), + "description" : MessageLookupByLibrary.simpleMessage("Descrição"), + "desired_email" : MessageLookupByLibrary.simpleMessage("Email em que desejas ser contactado"), + "dona_bia" : MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), + "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B (B-142)"), + "ects" : MessageLookupByLibrary.simpleMessage("ECTs realizados: "), + "edit_off" : MessageLookupByLibrary.simpleMessage("Editar\n"), + "edit_on" : MessageLookupByLibrary.simpleMessage("Concluir edição"), + "empty_text" : MessageLookupByLibrary.simpleMessage("Por favor preenche este campo"), + "exams_filter" : MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), + "exit_confirm" : MessageLookupByLibrary.simpleMessage("Tem a certeza de que pretende sair?"), + "expired_password" : MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), + "failed_login" : MessageLookupByLibrary.simpleMessage("O login falhou"), + "fee_date" : MessageLookupByLibrary.simpleMessage("Data limite próxima prestação:"), + "fee_notification" : MessageLookupByLibrary.simpleMessage("Notificar próxima data limite:"), + "first_year_registration" : MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), + "floor" : MessageLookupByLibrary.simpleMessage("Piso"), + "floors" : MessageLookupByLibrary.simpleMessage("Pisos"), + "forgot_password" : MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), + "generate_reference" : MessageLookupByLibrary.simpleMessage("Gerar referência"), + "geral_registration" : MessageLookupByLibrary.simpleMessage("Inscrição Geral"), + "go_back" : MessageLookupByLibrary.simpleMessage("Voltar"), + "improvement_registration" : MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), + "increment" : MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), + "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), + "keep_login" : MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), + "last_refresh_time" : m0, + "last_timestamp" : m1, + "library" : MessageLookupByLibrary.simpleMessage("Biblioteca"), + "library_cancel_error" : MessageLookupByLibrary.simpleMessage("Ocorreu um erro ao cancelar a reserva!"), + "library_cancel_reservation" : MessageLookupByLibrary.simpleMessage("Queres cancelar este pedido?"), + "library_cancel_success" : MessageLookupByLibrary.simpleMessage("A reserva foi cancelada!"), + "library_cancel_tooltip" : MessageLookupByLibrary.simpleMessage("Cancelar reserva"), + "library_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), + "library_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), + "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação"), + "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes"), + "load_error" : MessageLookupByLibrary.simpleMessage("Aconteceu um erro ao carregar os dados"), + "loading_terms" : MessageLookupByLibrary.simpleMessage("Carregando os Termos e Condições..."), + "login" : MessageLookupByLibrary.simpleMessage("Entrar"), + "logout" : MessageLookupByLibrary.simpleMessage("Terminar sessão"), + "menus" : MessageLookupByLibrary.simpleMessage("Ementas"), + "min_value_reference" : MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), + "multimedia_center" : MessageLookupByLibrary.simpleMessage("Centro de multimédia"), + "nav_title" : m2, + "news" : MessageLookupByLibrary.simpleMessage("Notícias"), + "no" : MessageLookupByLibrary.simpleMessage("Não"), + "no_bus" : MessageLookupByLibrary.simpleMessage("Não percas nenhum autocarro!"), + "no_bus_stops" : MessageLookupByLibrary.simpleMessage("Não existe nenhuma paragem configurada"), + "no_class" : MessageLookupByLibrary.simpleMessage("Não existem turmas para apresentar"), + "no_classes" : MessageLookupByLibrary.simpleMessage("Não existem aulas para apresentar"), + "no_classes_on" : MessageLookupByLibrary.simpleMessage("Não possui aulas à"), + "no_college" : MessageLookupByLibrary.simpleMessage("sem faculdade"), + "no_course_units" : MessageLookupByLibrary.simpleMessage("Sem cadeiras no período selecionado"), + "no_data" : MessageLookupByLibrary.simpleMessage("Não há dados a mostrar neste momento"), + "no_date" : MessageLookupByLibrary.simpleMessage("Sem data"), + "no_exams" : MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), + "no_exams_label" : MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), + "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), + "no_info" : MessageLookupByLibrary.simpleMessage("Não existem informações para apresentar"), + "no_menu_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre refeições"), + "no_menus" : MessageLookupByLibrary.simpleMessage("Não há refeições disponíveis"), + "no_name_course" : MessageLookupByLibrary.simpleMessage("Curso sem nome"), + "no_places_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre locais"), + "no_references" : MessageLookupByLibrary.simpleMessage("Não existem referências a pagar"), + "no_results" : MessageLookupByLibrary.simpleMessage("Sem resultados"), + "no_selected_courses" : MessageLookupByLibrary.simpleMessage("Não existem cadeiras para apresentar"), + "no_selected_exams" : MessageLookupByLibrary.simpleMessage("Não existem exames para apresentar"), + "occurrence_type" : MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), + "other_links" : MessageLookupByLibrary.simpleMessage("Outros links"), + "pass_change_request" : MessageLookupByLibrary.simpleMessage("Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), + "password" : MessageLookupByLibrary.simpleMessage("palavra-passe"), + "pendent_references" : MessageLookupByLibrary.simpleMessage("Referências pendentes"), + "personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial"), + "press_again" : MessageLookupByLibrary.simpleMessage("Pressione novamente para sair"), + "print" : MessageLookupByLibrary.simpleMessage("Impressão"), + "prints" : MessageLookupByLibrary.simpleMessage("Impressões"), + "problem_id" : MessageLookupByLibrary.simpleMessage("Breve identificação do problema"), + "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), + "reference_success" : MessageLookupByLibrary.simpleMessage("Referência criada com sucesso!"), + "remove" : MessageLookupByLibrary.simpleMessage("Remover"), + "report_error" : MessageLookupByLibrary.simpleMessage("Reportar erro"), + "room" : MessageLookupByLibrary.simpleMessage("Sala"), + "school_calendar" : MessageLookupByLibrary.simpleMessage("Calendário Escolar"), + "semester" : MessageLookupByLibrary.simpleMessage("Semestre"), + "send" : MessageLookupByLibrary.simpleMessage("Enviar"), + "sent_error" : MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), + "some_error" : MessageLookupByLibrary.simpleMessage("Algum erro!"), + "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), + "student_number" : MessageLookupByLibrary.simpleMessage("número de estudante"), + "success" : MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), + "tele_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), + "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial e telefónico"), + "telephone" : MessageLookupByLibrary.simpleMessage("Telefone"), + "terms" : MessageLookupByLibrary.simpleMessage("Termos e Condições"), + "title" : MessageLookupByLibrary.simpleMessage("Título"), + "unavailable" : MessageLookupByLibrary.simpleMessage("Indisponível"), + "valid_email" : MessageLookupByLibrary.simpleMessage("Por favor insere um email válido"), + "widget_prompt" : MessageLookupByLibrary.simpleMessage("Escolhe um widget para adicionares à tua área pessoal:"), + "year" : MessageLookupByLibrary.simpleMessage("Ano"), + "yes" : MessageLookupByLibrary.simpleMessage("Sim") + }; } diff --git a/uni/lib/generated/l10n.dart b/uni/lib/generated/l10n.dart index e83e60201..4844c84e5 100644 --- a/uni/lib/generated/l10n.dart +++ b/uni/lib/generated/l10n.dart @@ -18,31 +18,28 @@ class S { static S? _current; static S get current { - assert(_current != null, - 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + assert(_current != null, 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); return _current!; } - static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); + static const AppLocalizationDelegate delegate = + AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) - ? locale.languageCode - : locale.toString(); - final localeName = Intl.canonicalizedLocale(name); + final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; final instance = S(); S._current = instance; - + return instance; }); - } + } static S of(BuildContext context) { final instance = S.maybeOf(context); - assert(instance != null, - 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + assert(instance != null, 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); return instance!; } @@ -630,6 +627,16 @@ class S { ); } + /// `Go back` + String get go_back { + return Intl.message( + 'Go back', + name: 'go_back', + desc: '', + args: [], + ); + } + /// `Enrollment for Improvement` String get improvement_registration { return Intl.message( @@ -703,6 +710,46 @@ class S { ); } + /// `Do you want to cancel this reservation?` + String get library_cancel_reservation { + return Intl.message( + 'Do you want to cancel this reservation?', + name: 'library_cancel_reservation', + desc: '', + args: [], + ); + } + + /// `Cancel reservation` + String get library_cancel_tooltip { + return Intl.message( + 'Cancel reservation', + name: 'library_cancel_tooltip', + desc: '', + args: [], + ); + } + + /// `An error occurred while canceling your reservation!` + String get library_cancel_error { + return Intl.message( + 'An error occurred while canceling your reservation!', + name: 'library_cancel_error', + desc: '', + args: [], + ); + } + + /// `Your reservation was canceled!` + String get library_cancel_success { + return Intl.message( + 'Your reservation was canceled!', + name: 'library_cancel_success', + desc: '', + args: [], + ); + } + /// `Library Occupation` String get library_occupation { return Intl.message( @@ -1404,4 +1451,4 @@ class AppLocalizationDelegate extends LocalizationsDelegate { } return false; } -} +} \ No newline at end of file diff --git a/uni/lib/l10n/intl_en.arb b/uni/lib/l10n/intl_en.arb index 8681d1d01..125bfabe6 100644 --- a/uni/lib/l10n/intl_en.arb +++ b/uni/lib/l10n/intl_en.arb @@ -116,6 +116,8 @@ "@generate_reference": {}, "geral_registration": "General Registration", "@geral_registration": {}, + "go_back": "Go back", + "@go_back": {}, "improvement_registration": "Enrollment for Improvement", "@improvement_registration": {}, "increment": "Increment 1,00€", @@ -138,6 +140,14 @@ }, "library": "Library", "@library": {}, + "library_cancel_reservation": "Do you want to cancel this reservation?", + "@library_cancel_reservation": {}, + "library_cancel_tooltip": "Cancel reservation", + "@library_cancel_tooltip": {}, + "library_cancel_error": "An error occurred while canceling your reservation!", + "@library_cancel_error": {}, + "library_cancel_success": "Your reservation was canceled!", + "@library_cancel_success": {}, "library_occupation": "Library Occupation", "@library_occupation": {}, "library_reservations": "Library Reservations", diff --git a/uni/lib/l10n/intl_pt_PT.arb b/uni/lib/l10n/intl_pt_PT.arb index 7bdd5b8bd..47cb64096 100644 --- a/uni/lib/l10n/intl_pt_PT.arb +++ b/uni/lib/l10n/intl_pt_PT.arb @@ -116,6 +116,8 @@ "@generate_reference": {}, "geral_registration": "Inscrição Geral", "@geral_registration": {}, + "go_back": "Voltar", + "@go_back": {}, "improvement_registration": "Inscrição para Melhoria", "@improvement_registration": {}, "increment": "Incrementar 1,00€", @@ -138,6 +140,14 @@ }, "library": "Biblioteca", "@library": {}, + "library_cancel_reservation": "Queres cancelar este pedido?", + "@library_cancel_reservation": {}, + "library_cancel_tooltip": "Cancelar reserva", + "@library_cancel_tooltip": {}, + "library_cancel_error": "Ocorreu um erro ao cancelar a reserva!", + "@library_cancel_error": {}, + "library_cancel_success": "A reserva foi cancelada!", + "@library_cancel_success": {}, "library_occupation": "Ocupação da Biblioteca", "@library_occupation": {}, "library_reservations": "Gabinetes Reservados", diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 37bf4d3b6..65634822a 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; +import 'package:uni/generated/l10n.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/providers/lazy/library_reservations_provider.dart'; import 'package:uni/model/providers/startup/session_provider.dart'; @@ -97,14 +98,14 @@ class _ReservationRemoveButtonState extends State { iconSize: 24, color: Colors.grey, alignment: Alignment.centerRight, - tooltip: 'Cancelar reserva', + tooltip: S.of(context).library_cancel_tooltip, onPressed: () { showDialog( context: context, builder: (BuildContext toastContext) { return AlertDialog( content: Text( - 'Queres cancelar este pedido?', + S.of(context).library_cancel_reservation, style: Theme.of(context).textTheme.titleMedium, ), actions: [ @@ -113,10 +114,10 @@ class _ReservationRemoveButtonState extends State { children: [ TextButton( onPressed: () => Navigator.of(toastContext).pop(), - child: const Text('Voltar'), + child: Text(S.of(context).go_back), ), ElevatedButton( - child: const Text('Sim'), + child: Text(S.of(context).yes), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); cancelReservation(widget.reservation.id); @@ -151,11 +152,12 @@ class _ReservationRemoveButtonState extends State { bool success = true, }) async { if (success) { - await ToastMessage.success(widget.context, 'A reserva foi cancelada!'); + await ToastMessage.success( + widget.context, S.of(context).library_cancel_success,); } else { await ToastMessage.error( widget.context, - 'Ocorreu um erro ao cancelar a reserva!', + S.of(context).library_cancel_success, ); } } diff --git a/uni/lib/view/useful_info/widgets/other_links_card.dart b/uni/lib/view/useful_info/widgets/other_links_card.dart index 46c508e3e..47ae82046 100644 --- a/uni/lib/view/useful_info/widgets/other_links_card.dart +++ b/uni/lib/view/useful_info/widgets/other_links_card.dart @@ -12,7 +12,7 @@ class OtherLinksCard extends GenericExpansionCard { Widget buildCardContent(BuildContext context) { return const Column( children: [ - // LinkButton(title: 'Impressão', link: 'https://print.up.pt'), + // LinkButton(title: S.of(context).print, link: 'https://print.up.pt'), // TODO(Process-ing): Get fixed link LinkButton( title: 'Consultas SASUP', From 01e259a008df2040cbf4894dd3ab534c9c666a7c Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 26 Sep 2023 17:21:47 +0100 Subject: [PATCH 31/45] Fixed linter --- uni/lib/generated/intl/messages_all.dart | 9 +- uni/lib/generated/intl/messages_en.dart | 376 ++++++++++------- uni/lib/generated/intl/messages_pt_PT.dart | 377 +++++++++++------- uni/lib/generated/l10n.dart | 21 +- .../view/library/widgets/reservation_row.dart | 4 +- 5 files changed, 492 insertions(+), 295 deletions(-) diff --git a/uni/lib/generated/intl/messages_all.dart b/uni/lib/generated/intl/messages_all.dart index fb1bd2689..6b3ebeae5 100644 --- a/uni/lib/generated/intl/messages_all.dart +++ b/uni/lib/generated/intl/messages_all.dart @@ -38,9 +38,8 @@ MessageLookupByLibrary? _findExact(String localeName) { /// User programs should call this before using [localeName] for messages. Future initializeMessages(String localeName) async { var availableLocale = Intl.verifiedLocale( - localeName, - (locale) => _deferredLibraries[locale] != null, - onFailure: (_) => null); + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); if (availableLocale == null) { return new Future.value(false); } @@ -60,8 +59,8 @@ bool _messagesExistFor(String locale) { } MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { - var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, - onFailure: (_) => null); + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); if (actualLocale == null) return null; return _findExact(actualLocale); } diff --git a/uni/lib/generated/intl/messages_en.dart b/uni/lib/generated/intl/messages_en.dart index 6e30c4fca..7012026dc 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -21,147 +21,243 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "last refresh at ${time}"; - static m1(time) => "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; + static m1(time) => + "${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}"; - static m2(title) => "${Intl.select(title, {'horario': 'Schedule', 'exames': 'Exams', 'area': 'Personal Area', 'cadeiras': 'Course Units', 'autocarros': 'Buses', 'locais': 'Places', 'restaurantes': 'Restaurants', 'calendario': 'Calendar', 'biblioteca': 'Library', 'uteis': 'Utils', 'sobre': 'About', 'bugs': 'Bugs/Suggestions', 'other': 'Other', })}"; + static m2(title) => "${Intl.select(title, { + 'horario': 'Schedule', + 'exames': 'Exams', + 'area': 'Personal Area', + 'cadeiras': 'Course Units', + 'autocarros': 'Buses', + 'locais': 'Places', + 'restaurantes': 'Restaurants', + 'calendario': 'Calendar', + 'biblioteca': 'Library', + 'uteis': 'Utils', + 'sobre': 'About', + 'bugs': 'Bugs/Suggestions', + 'other': 'Other', + })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services" : MessageLookupByLibrary.simpleMessage("Academic services"), - "account_card_title" : MessageLookupByLibrary.simpleMessage("Checking account"), - "add" : MessageLookupByLibrary.simpleMessage("Add"), - "add_quota" : MessageLookupByLibrary.simpleMessage("Add quota"), - "add_widget" : MessageLookupByLibrary.simpleMessage("Add widget"), - "agree_terms" : MessageLookupByLibrary.simpleMessage("By entering you confirm that you agree with these Terms and Conditions"), - "all_widgets_added" : MessageLookupByLibrary.simpleMessage("All available widgets have already been added to your personal area!"), - "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Select at least one college"), - "available_amount" : MessageLookupByLibrary.simpleMessage("Available amount"), - "average" : MessageLookupByLibrary.simpleMessage("Average: "), - "balance" : MessageLookupByLibrary.simpleMessage("Balance:"), - "bs_description" : MessageLookupByLibrary.simpleMessage("Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), - "bug_description" : MessageLookupByLibrary.simpleMessage("Bug found, how to reproduce it, etc."), - "bus_error" : MessageLookupByLibrary.simpleMessage("Unable to get information"), - "bus_information" : MessageLookupByLibrary.simpleMessage("Select the buses you want information about:"), - "buses_personalize" : MessageLookupByLibrary.simpleMessage("Personalize your buses here"), - "buses_text" : MessageLookupByLibrary.simpleMessage("Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), - "cancel" : MessageLookupByLibrary.simpleMessage("Cancel"), - "change" : MessageLookupByLibrary.simpleMessage("Change"), - "change_prompt" : MessageLookupByLibrary.simpleMessage("Do you want to change the password?"), - "check_internet" : MessageLookupByLibrary.simpleMessage("Check your internet connection"), - "class_registration" : MessageLookupByLibrary.simpleMessage("Class Registration"), - "college" : MessageLookupByLibrary.simpleMessage("College: "), - "college_select" : MessageLookupByLibrary.simpleMessage("select your college(s)"), - "conclude" : MessageLookupByLibrary.simpleMessage("Done"), - "configured_buses" : MessageLookupByLibrary.simpleMessage("Configured Buses"), - "confirm" : MessageLookupByLibrary.simpleMessage("Confirm"), - "consent" : MessageLookupByLibrary.simpleMessage("I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), - "contact" : MessageLookupByLibrary.simpleMessage("Contact (optional)"), - "copy_center" : MessageLookupByLibrary.simpleMessage("Copy center"), - "copy_center_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B | AEFEUP building"), - "course_class" : MessageLookupByLibrary.simpleMessage("Classes"), - "course_info" : MessageLookupByLibrary.simpleMessage("Info"), - "current_state" : MessageLookupByLibrary.simpleMessage("Current state: "), - "current_year" : MessageLookupByLibrary.simpleMessage("Current academic year: "), - "decrement" : MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), - "description" : MessageLookupByLibrary.simpleMessage("Description"), - "desired_email" : MessageLookupByLibrary.simpleMessage("Email where you want to be contacted"), - "dona_bia" : MessageLookupByLibrary.simpleMessage("D. Beatriz\'s stationery store"), - "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Floor -1 of building B (B-142)"), - "ects" : MessageLookupByLibrary.simpleMessage("ECTs performed: "), - "edit_off" : MessageLookupByLibrary.simpleMessage("Edit"), - "edit_on" : MessageLookupByLibrary.simpleMessage("Finish editing"), - "empty_text" : MessageLookupByLibrary.simpleMessage("Please fill in this field"), - "exams_filter" : MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), - "exit_confirm" : MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), - "expired_password" : MessageLookupByLibrary.simpleMessage("Your password has expired"), - "failed_login" : MessageLookupByLibrary.simpleMessage("Login failed"), - "fee_date" : MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), - "fee_notification" : MessageLookupByLibrary.simpleMessage("Notify next deadline:"), - "first_year_registration" : MessageLookupByLibrary.simpleMessage("Year of first registration: "), - "floor" : MessageLookupByLibrary.simpleMessage("Floor"), - "floors" : MessageLookupByLibrary.simpleMessage("Floors"), - "forgot_password" : MessageLookupByLibrary.simpleMessage("Forgot password?"), - "generate_reference" : MessageLookupByLibrary.simpleMessage("Generate reference"), - "geral_registration" : MessageLookupByLibrary.simpleMessage("General Registration"), - "go_back" : MessageLookupByLibrary.simpleMessage("Go back"), - "improvement_registration" : MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), - "increment" : MessageLookupByLibrary.simpleMessage("Increment 1,00€"), - "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Invalid credentials"), - "keep_login" : MessageLookupByLibrary.simpleMessage("Stay signed in"), - "last_refresh_time" : m0, - "last_timestamp" : m1, - "library" : MessageLookupByLibrary.simpleMessage("Library"), - "library_cancel_error" : MessageLookupByLibrary.simpleMessage("An error occurred while canceling your reservation!"), - "library_cancel_reservation" : MessageLookupByLibrary.simpleMessage("Do you want to cancel this reservation?"), - "library_cancel_success" : MessageLookupByLibrary.simpleMessage("Your reservation was canceled!"), - "library_cancel_tooltip" : MessageLookupByLibrary.simpleMessage("Cancel reservation"), - "library_occupation" : MessageLookupByLibrary.simpleMessage("Library Occupation"), - "library_reservations" : MessageLookupByLibrary.simpleMessage("Library Reservations"), - "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Occupation"), - "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Reservations"), - "load_error" : MessageLookupByLibrary.simpleMessage("Error loading the information"), - "loading_terms" : MessageLookupByLibrary.simpleMessage("Loading Terms and Conditions..."), - "login" : MessageLookupByLibrary.simpleMessage("Login"), - "logout" : MessageLookupByLibrary.simpleMessage("Log out"), - "menus" : MessageLookupByLibrary.simpleMessage("Menus"), - "min_value_reference" : MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), - "multimedia_center" : MessageLookupByLibrary.simpleMessage("Multimedia center"), - "nav_title" : m2, - "news" : MessageLookupByLibrary.simpleMessage("News"), - "no" : MessageLookupByLibrary.simpleMessage("No"), - "no_bus" : MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), - "no_bus_stops" : MessageLookupByLibrary.simpleMessage("No configured stops"), - "no_class" : MessageLookupByLibrary.simpleMessage("There are no classes to display"), - "no_classes" : MessageLookupByLibrary.simpleMessage("No classes to present"), - "no_classes_on" : MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), - "no_college" : MessageLookupByLibrary.simpleMessage("no college"), - "no_course_units" : MessageLookupByLibrary.simpleMessage("No course units in the selected period"), - "no_data" : MessageLookupByLibrary.simpleMessage("There is no data to show at this time"), - "no_date" : MessageLookupByLibrary.simpleMessage("No date"), - "no_exams" : MessageLookupByLibrary.simpleMessage("You have no exams scheduled\n"), - "no_exams_label" : MessageLookupByLibrary.simpleMessage("Looks like you are on vacation!"), - "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("No favorite restaurants"), - "no_info" : MessageLookupByLibrary.simpleMessage("There is no information to display"), - "no_menu_info" : MessageLookupByLibrary.simpleMessage("There is no information available about meals"), - "no_menus" : MessageLookupByLibrary.simpleMessage("There are no meals available"), - "no_name_course" : MessageLookupByLibrary.simpleMessage("Unnamed course"), - "no_places_info" : MessageLookupByLibrary.simpleMessage("There is no information available about places"), - "no_references" : MessageLookupByLibrary.simpleMessage("There are no references to pay"), - "no_results" : MessageLookupByLibrary.simpleMessage("No match"), - "no_selected_courses" : MessageLookupByLibrary.simpleMessage("There are no course units to display"), - "no_selected_exams" : MessageLookupByLibrary.simpleMessage("There are no exams to present"), - "occurrence_type" : MessageLookupByLibrary.simpleMessage("Type of occurrence"), - "other_links" : MessageLookupByLibrary.simpleMessage("Other links"), - "pass_change_request" : MessageLookupByLibrary.simpleMessage("For security reasons, passwords must be changed periodically."), - "password" : MessageLookupByLibrary.simpleMessage("password"), - "pendent_references" : MessageLookupByLibrary.simpleMessage("Pending references"), - "personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), - "press_again" : MessageLookupByLibrary.simpleMessage("Press again to exit"), - "print" : MessageLookupByLibrary.simpleMessage("Print"), - "prints" : MessageLookupByLibrary.simpleMessage("Prints"), - "problem_id" : MessageLookupByLibrary.simpleMessage("Brief identification of the problem"), - "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), - "reference_success" : MessageLookupByLibrary.simpleMessage("Reference created successfully!"), - "remove" : MessageLookupByLibrary.simpleMessage("Delete"), - "report_error" : MessageLookupByLibrary.simpleMessage("Report error"), - "room" : MessageLookupByLibrary.simpleMessage("Room"), - "school_calendar" : MessageLookupByLibrary.simpleMessage("School Calendar"), - "semester" : MessageLookupByLibrary.simpleMessage("Semester"), - "send" : MessageLookupByLibrary.simpleMessage("Send"), - "sent_error" : MessageLookupByLibrary.simpleMessage("An error occurred in sending"), - "some_error" : MessageLookupByLibrary.simpleMessage("Some error!"), - "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), - "student_number" : MessageLookupByLibrary.simpleMessage("student number"), - "success" : MessageLookupByLibrary.simpleMessage("Sent with success"), - "tele_assistance" : MessageLookupByLibrary.simpleMessage("Telephone assistance"), - "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Face-to-face and telephone assistance"), - "telephone" : MessageLookupByLibrary.simpleMessage("Telephone"), - "terms" : MessageLookupByLibrary.simpleMessage("Terms and Conditions"), - "title" : MessageLookupByLibrary.simpleMessage("Title"), - "unavailable" : MessageLookupByLibrary.simpleMessage("Unavailable"), - "valid_email" : MessageLookupByLibrary.simpleMessage("Please enter a valid email"), - "widget_prompt" : MessageLookupByLibrary.simpleMessage("Choose a widget to add to your personal area:"), - "year" : MessageLookupByLibrary.simpleMessage("Year"), - "yes" : MessageLookupByLibrary.simpleMessage("Yes") - }; + static _notInlinedMessages(_) => { + "academic_services": + MessageLookupByLibrary.simpleMessage("Academic services"), + "account_card_title": + MessageLookupByLibrary.simpleMessage("Checking account"), + "add": MessageLookupByLibrary.simpleMessage("Add"), + "add_quota": MessageLookupByLibrary.simpleMessage("Add quota"), + "add_widget": MessageLookupByLibrary.simpleMessage("Add widget"), + "agree_terms": MessageLookupByLibrary.simpleMessage( + "By entering you confirm that you agree with these Terms and Conditions"), + "all_widgets_added": MessageLookupByLibrary.simpleMessage( + "All available widgets have already been added to your personal area!"), + "at_least_one_college": + MessageLookupByLibrary.simpleMessage("Select at least one college"), + "available_amount": + MessageLookupByLibrary.simpleMessage("Available amount"), + "average": MessageLookupByLibrary.simpleMessage("Average: "), + "balance": MessageLookupByLibrary.simpleMessage("Balance:"), + "bs_description": MessageLookupByLibrary.simpleMessage( + "Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"), + "bug_description": MessageLookupByLibrary.simpleMessage( + "Bug found, how to reproduce it, etc."), + "bus_error": + MessageLookupByLibrary.simpleMessage("Unable to get information"), + "bus_information": MessageLookupByLibrary.simpleMessage( + "Select the buses you want information about:"), + "buses_personalize": + MessageLookupByLibrary.simpleMessage("Personalize your buses here"), + "buses_text": MessageLookupByLibrary.simpleMessage( + "Favorite buses will be displayed in the favorites \'Bus\' widget. The remaining ones will only be displayed on the page."), + "cancel": MessageLookupByLibrary.simpleMessage("Cancel"), + "change": MessageLookupByLibrary.simpleMessage("Change"), + "change_prompt": MessageLookupByLibrary.simpleMessage( + "Do you want to change the password?"), + "check_internet": MessageLookupByLibrary.simpleMessage( + "Check your internet connection"), + "class_registration": + MessageLookupByLibrary.simpleMessage("Class Registration"), + "college": MessageLookupByLibrary.simpleMessage("College: "), + "college_select": + MessageLookupByLibrary.simpleMessage("select your college(s)"), + "conclude": MessageLookupByLibrary.simpleMessage("Done"), + "configured_buses": + MessageLookupByLibrary.simpleMessage("Configured Buses"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirm"), + "consent": MessageLookupByLibrary.simpleMessage( + "I consent to this information being reviewed by NIAEFEUP and may be deleted at my request."), + "contact": MessageLookupByLibrary.simpleMessage("Contact (optional)"), + "copy_center": MessageLookupByLibrary.simpleMessage("Copy center"), + "copy_center_building": MessageLookupByLibrary.simpleMessage( + "Floor -1 of building B | AEFEUP building"), + "course_class": MessageLookupByLibrary.simpleMessage("Classes"), + "course_info": MessageLookupByLibrary.simpleMessage("Info"), + "current_state": + MessageLookupByLibrary.simpleMessage("Current state: "), + "current_year": + MessageLookupByLibrary.simpleMessage("Current academic year: "), + "decrement": MessageLookupByLibrary.simpleMessage("Decrement 1,00€"), + "description": MessageLookupByLibrary.simpleMessage("Description"), + "desired_email": MessageLookupByLibrary.simpleMessage( + "Email where you want to be contacted"), + "dona_bia": MessageLookupByLibrary.simpleMessage( + "D. Beatriz\'s stationery store"), + "dona_bia_building": MessageLookupByLibrary.simpleMessage( + "Floor -1 of building B (B-142)"), + "ects": MessageLookupByLibrary.simpleMessage("ECTs performed: "), + "edit_off": MessageLookupByLibrary.simpleMessage("Edit"), + "edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"), + "empty_text": + MessageLookupByLibrary.simpleMessage("Please fill in this field"), + "exams_filter": + MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), + "exit_confirm": + MessageLookupByLibrary.simpleMessage("Do you really want to exit?"), + "expired_password": + MessageLookupByLibrary.simpleMessage("Your password has expired"), + "failed_login": MessageLookupByLibrary.simpleMessage("Login failed"), + "fee_date": + MessageLookupByLibrary.simpleMessage("Deadline for next fee:"), + "fee_notification": + MessageLookupByLibrary.simpleMessage("Notify next deadline:"), + "first_year_registration": MessageLookupByLibrary.simpleMessage( + "Year of first registration: "), + "floor": MessageLookupByLibrary.simpleMessage("Floor"), + "floors": MessageLookupByLibrary.simpleMessage("Floors"), + "forgot_password": + MessageLookupByLibrary.simpleMessage("Forgot password?"), + "generate_reference": + MessageLookupByLibrary.simpleMessage("Generate reference"), + "geral_registration": + MessageLookupByLibrary.simpleMessage("General Registration"), + "go_back": MessageLookupByLibrary.simpleMessage("Go back"), + "improvement_registration": + MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"), + "increment": MessageLookupByLibrary.simpleMessage("Increment 1,00€"), + "invalid_credentials": + MessageLookupByLibrary.simpleMessage("Invalid credentials"), + "keep_login": MessageLookupByLibrary.simpleMessage("Stay signed in"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library": MessageLookupByLibrary.simpleMessage("Library"), + "library_cancel_error": MessageLookupByLibrary.simpleMessage( + "An error occurred while canceling your reservation!"), + "library_cancel_reservation": MessageLookupByLibrary.simpleMessage( + "Do you want to cancel this reservation?"), + "library_cancel_success": MessageLookupByLibrary.simpleMessage( + "Your reservation was canceled!"), + "library_cancel_tooltip": + MessageLookupByLibrary.simpleMessage("Cancel reservation"), + "library_occupation": + MessageLookupByLibrary.simpleMessage("Library Occupation"), + "library_reservations": + MessageLookupByLibrary.simpleMessage("Library Reservations"), + "library_tab_occupation": + MessageLookupByLibrary.simpleMessage("Occupation"), + "library_tab_reservations": + MessageLookupByLibrary.simpleMessage("Reservations"), + "load_error": MessageLookupByLibrary.simpleMessage( + "Error loading the information"), + "loading_terms": MessageLookupByLibrary.simpleMessage( + "Loading Terms and Conditions..."), + "login": MessageLookupByLibrary.simpleMessage("Login"), + "logout": MessageLookupByLibrary.simpleMessage("Log out"), + "menus": MessageLookupByLibrary.simpleMessage("Menus"), + "min_value_reference": + MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"), + "multimedia_center": + MessageLookupByLibrary.simpleMessage("Multimedia center"), + "nav_title": m2, + "news": MessageLookupByLibrary.simpleMessage("News"), + "no": MessageLookupByLibrary.simpleMessage("No"), + "no_bus": MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"), + "no_bus_stops": + MessageLookupByLibrary.simpleMessage("No configured stops"), + "no_class": MessageLookupByLibrary.simpleMessage( + "There are no classes to display"), + "no_classes": + MessageLookupByLibrary.simpleMessage("No classes to present"), + "no_classes_on": + MessageLookupByLibrary.simpleMessage("You don\'t have classes on"), + "no_college": MessageLookupByLibrary.simpleMessage("no college"), + "no_course_units": MessageLookupByLibrary.simpleMessage( + "No course units in the selected period"), + "no_data": MessageLookupByLibrary.simpleMessage( + "There is no data to show at this time"), + "no_date": MessageLookupByLibrary.simpleMessage("No date"), + "no_exams": MessageLookupByLibrary.simpleMessage( + "You have no exams scheduled\n"), + "no_exams_label": MessageLookupByLibrary.simpleMessage( + "Looks like you are on vacation!"), + "no_favorite_restaurants": + MessageLookupByLibrary.simpleMessage("No favorite restaurants"), + "no_info": MessageLookupByLibrary.simpleMessage( + "There is no information to display"), + "no_menu_info": MessageLookupByLibrary.simpleMessage( + "There is no information available about meals"), + "no_menus": MessageLookupByLibrary.simpleMessage( + "There are no meals available"), + "no_name_course": + MessageLookupByLibrary.simpleMessage("Unnamed course"), + "no_places_info": MessageLookupByLibrary.simpleMessage( + "There is no information available about places"), + "no_references": MessageLookupByLibrary.simpleMessage( + "There are no references to pay"), + "no_results": MessageLookupByLibrary.simpleMessage("No match"), + "no_selected_courses": MessageLookupByLibrary.simpleMessage( + "There are no course units to display"), + "no_selected_exams": MessageLookupByLibrary.simpleMessage( + "There are no exams to present"), + "occurrence_type": + MessageLookupByLibrary.simpleMessage("Type of occurrence"), + "other_links": MessageLookupByLibrary.simpleMessage("Other links"), + "pass_change_request": MessageLookupByLibrary.simpleMessage( + "For security reasons, passwords must be changed periodically."), + "password": MessageLookupByLibrary.simpleMessage("password"), + "pendent_references": + MessageLookupByLibrary.simpleMessage("Pending references"), + "personal_assistance": + MessageLookupByLibrary.simpleMessage("Face-to-face assistance"), + "press_again": + MessageLookupByLibrary.simpleMessage("Press again to exit"), + "print": MessageLookupByLibrary.simpleMessage("Print"), + "prints": MessageLookupByLibrary.simpleMessage("Prints"), + "problem_id": MessageLookupByLibrary.simpleMessage( + "Brief identification of the problem"), + "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( + "The generated reference data will appear in Sigarra, checking account.\\nProfile > Checking Account"), + "reference_success": MessageLookupByLibrary.simpleMessage( + "Reference created successfully!"), + "remove": MessageLookupByLibrary.simpleMessage("Delete"), + "report_error": MessageLookupByLibrary.simpleMessage("Report error"), + "room": MessageLookupByLibrary.simpleMessage("Room"), + "school_calendar": + MessageLookupByLibrary.simpleMessage("School Calendar"), + "semester": MessageLookupByLibrary.simpleMessage("Semester"), + "send": MessageLookupByLibrary.simpleMessage("Send"), + "sent_error": MessageLookupByLibrary.simpleMessage( + "An error occurred in sending"), + "some_error": MessageLookupByLibrary.simpleMessage("Some error!"), + "stcp_stops": + MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), + "student_number": + MessageLookupByLibrary.simpleMessage("student number"), + "success": MessageLookupByLibrary.simpleMessage("Sent with success"), + "tele_assistance": + MessageLookupByLibrary.simpleMessage("Telephone assistance"), + "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( + "Face-to-face and telephone assistance"), + "telephone": MessageLookupByLibrary.simpleMessage("Telephone"), + "terms": MessageLookupByLibrary.simpleMessage("Terms and Conditions"), + "title": MessageLookupByLibrary.simpleMessage("Title"), + "unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"), + "valid_email": + MessageLookupByLibrary.simpleMessage("Please enter a valid email"), + "widget_prompt": MessageLookupByLibrary.simpleMessage( + "Choose a widget to add to your personal area:"), + "year": MessageLookupByLibrary.simpleMessage("Year"), + "yes": MessageLookupByLibrary.simpleMessage("Yes") + }; } diff --git a/uni/lib/generated/intl/messages_pt_PT.dart b/uni/lib/generated/intl/messages_pt_PT.dart index 2f34854bc..12879ed59 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -21,147 +21,244 @@ class MessageLookup extends MessageLookupByLibrary { static m0(time) => "última atualização às ${time}"; - static m1(time) => "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; + static m1(time) => + "${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}"; - static m2(title) => "${Intl.select(title, {'horario': 'Horário', 'exames': 'Exames', 'area': 'Área Pessoal', 'cadeiras': 'Cadeiras', 'autocarros': 'Autocarros', 'locais': 'Locais', 'restaurantes': 'Restaurantes', 'calendario': 'Calendário', 'biblioteca': 'Biblioteca', 'uteis': 'Úteis', 'sobre': 'Sobre', 'bugs': 'Bugs e Sugestões', 'other': 'Outros', })}"; + static m2(title) => "${Intl.select(title, { + 'horario': 'Horário', + 'exames': 'Exames', + 'area': 'Área Pessoal', + 'cadeiras': 'Cadeiras', + 'autocarros': 'Autocarros', + 'locais': 'Locais', + 'restaurantes': 'Restaurantes', + 'calendario': 'Calendário', + 'biblioteca': 'Biblioteca', + 'uteis': 'Úteis', + 'sobre': 'Sobre', + 'bugs': 'Bugs e Sugestões', + 'other': 'Outros', + })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "academic_services" : MessageLookupByLibrary.simpleMessage("Serviços académicos"), - "account_card_title" : MessageLookupByLibrary.simpleMessage("Conta Corrente"), - "add" : MessageLookupByLibrary.simpleMessage("Adicionar"), - "add_quota" : MessageLookupByLibrary.simpleMessage("Adicionar quota"), - "add_widget" : MessageLookupByLibrary.simpleMessage("Adicionar widget"), - "agree_terms" : MessageLookupByLibrary.simpleMessage("Ao entrares confirmas que concordas com estes Termos e Condições"), - "all_widgets_added" : MessageLookupByLibrary.simpleMessage("Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), - "at_least_one_college" : MessageLookupByLibrary.simpleMessage("Seleciona pelo menos uma faculdade"), - "available_amount" : MessageLookupByLibrary.simpleMessage("Valor disponível"), - "average" : MessageLookupByLibrary.simpleMessage("Média: "), - "balance" : MessageLookupByLibrary.simpleMessage("Saldo:"), - "bs_description" : MessageLookupByLibrary.simpleMessage("Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), - "bug_description" : MessageLookupByLibrary.simpleMessage("Bug encontrado, como o reproduzir, etc"), - "bus_error" : MessageLookupByLibrary.simpleMessage("Não foi possível obter informação"), - "bus_information" : MessageLookupByLibrary.simpleMessage("Seleciona os autocarros dos quais queres informação:"), - "buses_personalize" : MessageLookupByLibrary.simpleMessage("Configura aqui os teus autocarros"), - "buses_text" : MessageLookupByLibrary.simpleMessage("Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), - "cancel" : MessageLookupByLibrary.simpleMessage("Cancelar\n"), - "change" : MessageLookupByLibrary.simpleMessage("Alterar"), - "change_prompt" : MessageLookupByLibrary.simpleMessage("Deseja alterar a palavra-passe?"), - "check_internet" : MessageLookupByLibrary.simpleMessage("Verifica a tua ligação à internet"), - "class_registration" : MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), - "college" : MessageLookupByLibrary.simpleMessage("Faculdade: "), - "college_select" : MessageLookupByLibrary.simpleMessage("seleciona a(s) tua(s) faculdade(s)"), - "conclude" : MessageLookupByLibrary.simpleMessage("Concluído"), - "configured_buses" : MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), - "confirm" : MessageLookupByLibrary.simpleMessage("Confirmar"), - "consent" : MessageLookupByLibrary.simpleMessage("Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), - "contact" : MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), - "copy_center" : MessageLookupByLibrary.simpleMessage("Centro de cópias"), - "copy_center_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B | Edifício da AEFEUP"), - "course_class" : MessageLookupByLibrary.simpleMessage("Turmas"), - "course_info" : MessageLookupByLibrary.simpleMessage("Ficha"), - "current_state" : MessageLookupByLibrary.simpleMessage("Estado atual: "), - "current_year" : MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), - "decrement" : MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), - "description" : MessageLookupByLibrary.simpleMessage("Descrição"), - "desired_email" : MessageLookupByLibrary.simpleMessage("Email em que desejas ser contactado"), - "dona_bia" : MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), - "dona_bia_building" : MessageLookupByLibrary.simpleMessage("Piso -1 do edifício B (B-142)"), - "ects" : MessageLookupByLibrary.simpleMessage("ECTs realizados: "), - "edit_off" : MessageLookupByLibrary.simpleMessage("Editar\n"), - "edit_on" : MessageLookupByLibrary.simpleMessage("Concluir edição"), - "empty_text" : MessageLookupByLibrary.simpleMessage("Por favor preenche este campo"), - "exams_filter" : MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), - "exit_confirm" : MessageLookupByLibrary.simpleMessage("Tem a certeza de que pretende sair?"), - "expired_password" : MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), - "failed_login" : MessageLookupByLibrary.simpleMessage("O login falhou"), - "fee_date" : MessageLookupByLibrary.simpleMessage("Data limite próxima prestação:"), - "fee_notification" : MessageLookupByLibrary.simpleMessage("Notificar próxima data limite:"), - "first_year_registration" : MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), - "floor" : MessageLookupByLibrary.simpleMessage("Piso"), - "floors" : MessageLookupByLibrary.simpleMessage("Pisos"), - "forgot_password" : MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), - "generate_reference" : MessageLookupByLibrary.simpleMessage("Gerar referência"), - "geral_registration" : MessageLookupByLibrary.simpleMessage("Inscrição Geral"), - "go_back" : MessageLookupByLibrary.simpleMessage("Voltar"), - "improvement_registration" : MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), - "increment" : MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), - "invalid_credentials" : MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), - "keep_login" : MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), - "last_refresh_time" : m0, - "last_timestamp" : m1, - "library" : MessageLookupByLibrary.simpleMessage("Biblioteca"), - "library_cancel_error" : MessageLookupByLibrary.simpleMessage("Ocorreu um erro ao cancelar a reserva!"), - "library_cancel_reservation" : MessageLookupByLibrary.simpleMessage("Queres cancelar este pedido?"), - "library_cancel_success" : MessageLookupByLibrary.simpleMessage("A reserva foi cancelada!"), - "library_cancel_tooltip" : MessageLookupByLibrary.simpleMessage("Cancelar reserva"), - "library_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), - "library_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), - "library_tab_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação"), - "library_tab_reservations" : MessageLookupByLibrary.simpleMessage("Gabinetes"), - "load_error" : MessageLookupByLibrary.simpleMessage("Aconteceu um erro ao carregar os dados"), - "loading_terms" : MessageLookupByLibrary.simpleMessage("Carregando os Termos e Condições..."), - "login" : MessageLookupByLibrary.simpleMessage("Entrar"), - "logout" : MessageLookupByLibrary.simpleMessage("Terminar sessão"), - "menus" : MessageLookupByLibrary.simpleMessage("Ementas"), - "min_value_reference" : MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), - "multimedia_center" : MessageLookupByLibrary.simpleMessage("Centro de multimédia"), - "nav_title" : m2, - "news" : MessageLookupByLibrary.simpleMessage("Notícias"), - "no" : MessageLookupByLibrary.simpleMessage("Não"), - "no_bus" : MessageLookupByLibrary.simpleMessage("Não percas nenhum autocarro!"), - "no_bus_stops" : MessageLookupByLibrary.simpleMessage("Não existe nenhuma paragem configurada"), - "no_class" : MessageLookupByLibrary.simpleMessage("Não existem turmas para apresentar"), - "no_classes" : MessageLookupByLibrary.simpleMessage("Não existem aulas para apresentar"), - "no_classes_on" : MessageLookupByLibrary.simpleMessage("Não possui aulas à"), - "no_college" : MessageLookupByLibrary.simpleMessage("sem faculdade"), - "no_course_units" : MessageLookupByLibrary.simpleMessage("Sem cadeiras no período selecionado"), - "no_data" : MessageLookupByLibrary.simpleMessage("Não há dados a mostrar neste momento"), - "no_date" : MessageLookupByLibrary.simpleMessage("Sem data"), - "no_exams" : MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), - "no_exams_label" : MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), - "no_favorite_restaurants" : MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), - "no_info" : MessageLookupByLibrary.simpleMessage("Não existem informações para apresentar"), - "no_menu_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre refeições"), - "no_menus" : MessageLookupByLibrary.simpleMessage("Não há refeições disponíveis"), - "no_name_course" : MessageLookupByLibrary.simpleMessage("Curso sem nome"), - "no_places_info" : MessageLookupByLibrary.simpleMessage("Não há informação disponível sobre locais"), - "no_references" : MessageLookupByLibrary.simpleMessage("Não existem referências a pagar"), - "no_results" : MessageLookupByLibrary.simpleMessage("Sem resultados"), - "no_selected_courses" : MessageLookupByLibrary.simpleMessage("Não existem cadeiras para apresentar"), - "no_selected_exams" : MessageLookupByLibrary.simpleMessage("Não existem exames para apresentar"), - "occurrence_type" : MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), - "other_links" : MessageLookupByLibrary.simpleMessage("Outros links"), - "pass_change_request" : MessageLookupByLibrary.simpleMessage("Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), - "password" : MessageLookupByLibrary.simpleMessage("palavra-passe"), - "pendent_references" : MessageLookupByLibrary.simpleMessage("Referências pendentes"), - "personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial"), - "press_again" : MessageLookupByLibrary.simpleMessage("Pressione novamente para sair"), - "print" : MessageLookupByLibrary.simpleMessage("Impressão"), - "prints" : MessageLookupByLibrary.simpleMessage("Impressões"), - "problem_id" : MessageLookupByLibrary.simpleMessage("Breve identificação do problema"), - "reference_sigarra_help" : MessageLookupByLibrary.simpleMessage("Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), - "reference_success" : MessageLookupByLibrary.simpleMessage("Referência criada com sucesso!"), - "remove" : MessageLookupByLibrary.simpleMessage("Remover"), - "report_error" : MessageLookupByLibrary.simpleMessage("Reportar erro"), - "room" : MessageLookupByLibrary.simpleMessage("Sala"), - "school_calendar" : MessageLookupByLibrary.simpleMessage("Calendário Escolar"), - "semester" : MessageLookupByLibrary.simpleMessage("Semestre"), - "send" : MessageLookupByLibrary.simpleMessage("Enviar"), - "sent_error" : MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), - "some_error" : MessageLookupByLibrary.simpleMessage("Algum erro!"), - "stcp_stops" : MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), - "student_number" : MessageLookupByLibrary.simpleMessage("número de estudante"), - "success" : MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), - "tele_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), - "tele_personal_assistance" : MessageLookupByLibrary.simpleMessage("Atendimento presencial e telefónico"), - "telephone" : MessageLookupByLibrary.simpleMessage("Telefone"), - "terms" : MessageLookupByLibrary.simpleMessage("Termos e Condições"), - "title" : MessageLookupByLibrary.simpleMessage("Título"), - "unavailable" : MessageLookupByLibrary.simpleMessage("Indisponível"), - "valid_email" : MessageLookupByLibrary.simpleMessage("Por favor insere um email válido"), - "widget_prompt" : MessageLookupByLibrary.simpleMessage("Escolhe um widget para adicionares à tua área pessoal:"), - "year" : MessageLookupByLibrary.simpleMessage("Ano"), - "yes" : MessageLookupByLibrary.simpleMessage("Sim") - }; + static _notInlinedMessages(_) => { + "academic_services": + MessageLookupByLibrary.simpleMessage("Serviços académicos"), + "account_card_title": + MessageLookupByLibrary.simpleMessage("Conta Corrente"), + "add": MessageLookupByLibrary.simpleMessage("Adicionar"), + "add_quota": MessageLookupByLibrary.simpleMessage("Adicionar quota"), + "add_widget": MessageLookupByLibrary.simpleMessage("Adicionar widget"), + "agree_terms": MessageLookupByLibrary.simpleMessage( + "Ao entrares confirmas que concordas com estes Termos e Condições"), + "all_widgets_added": MessageLookupByLibrary.simpleMessage( + "Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), + "at_least_one_college": MessageLookupByLibrary.simpleMessage( + "Seleciona pelo menos uma faculdade"), + "available_amount": + MessageLookupByLibrary.simpleMessage("Valor disponível"), + "average": MessageLookupByLibrary.simpleMessage("Média: "), + "balance": MessageLookupByLibrary.simpleMessage("Saldo:"), + "bs_description": MessageLookupByLibrary.simpleMessage( + "Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"), + "bug_description": MessageLookupByLibrary.simpleMessage( + "Bug encontrado, como o reproduzir, etc"), + "bus_error": MessageLookupByLibrary.simpleMessage( + "Não foi possível obter informação"), + "bus_information": MessageLookupByLibrary.simpleMessage( + "Seleciona os autocarros dos quais queres informação:"), + "buses_personalize": MessageLookupByLibrary.simpleMessage( + "Configura aqui os teus autocarros"), + "buses_text": MessageLookupByLibrary.simpleMessage( + "Os autocarros favoritos serão apresentados no widget \'Autocarros\' dos favoritos. Os restantes serão apresentados apenas na página."), + "cancel": MessageLookupByLibrary.simpleMessage("Cancelar\n"), + "change": MessageLookupByLibrary.simpleMessage("Alterar"), + "change_prompt": MessageLookupByLibrary.simpleMessage( + "Deseja alterar a palavra-passe?"), + "check_internet": MessageLookupByLibrary.simpleMessage( + "Verifica a tua ligação à internet"), + "class_registration": + MessageLookupByLibrary.simpleMessage("Inscrição de Turmas"), + "college": MessageLookupByLibrary.simpleMessage("Faculdade: "), + "college_select": MessageLookupByLibrary.simpleMessage( + "seleciona a(s) tua(s) faculdade(s)"), + "conclude": MessageLookupByLibrary.simpleMessage("Concluído"), + "configured_buses": + MessageLookupByLibrary.simpleMessage("Autocarros Configurados"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirmar"), + "consent": MessageLookupByLibrary.simpleMessage( + "Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido."), + "contact": MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), + "copy_center": MessageLookupByLibrary.simpleMessage("Centro de cópias"), + "copy_center_building": MessageLookupByLibrary.simpleMessage( + "Piso -1 do edifício B | Edifício da AEFEUP"), + "course_class": MessageLookupByLibrary.simpleMessage("Turmas"), + "course_info": MessageLookupByLibrary.simpleMessage("Ficha"), + "current_state": MessageLookupByLibrary.simpleMessage("Estado atual: "), + "current_year": + MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), + "decrement": MessageLookupByLibrary.simpleMessage("Decrementar 1,00€"), + "description": MessageLookupByLibrary.simpleMessage("Descrição"), + "desired_email": MessageLookupByLibrary.simpleMessage( + "Email em que desejas ser contactado"), + "dona_bia": + MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), + "dona_bia_building": MessageLookupByLibrary.simpleMessage( + "Piso -1 do edifício B (B-142)"), + "ects": MessageLookupByLibrary.simpleMessage("ECTs realizados: "), + "edit_off": MessageLookupByLibrary.simpleMessage("Editar\n"), + "edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"), + "empty_text": MessageLookupByLibrary.simpleMessage( + "Por favor preenche este campo"), + "exams_filter": + MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), + "exit_confirm": MessageLookupByLibrary.simpleMessage( + "Tem a certeza de que pretende sair?"), + "expired_password": + MessageLookupByLibrary.simpleMessage("A tua palavra-passe expirou"), + "failed_login": MessageLookupByLibrary.simpleMessage("O login falhou"), + "fee_date": MessageLookupByLibrary.simpleMessage( + "Data limite próxima prestação:"), + "fee_notification": MessageLookupByLibrary.simpleMessage( + "Notificar próxima data limite:"), + "first_year_registration": + MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "), + "floor": MessageLookupByLibrary.simpleMessage("Piso"), + "floors": MessageLookupByLibrary.simpleMessage("Pisos"), + "forgot_password": + MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"), + "generate_reference": + MessageLookupByLibrary.simpleMessage("Gerar referência"), + "geral_registration": + MessageLookupByLibrary.simpleMessage("Inscrição Geral"), + "go_back": MessageLookupByLibrary.simpleMessage("Voltar"), + "improvement_registration": + MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"), + "increment": MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"), + "invalid_credentials": + MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), + "keep_login": + MessageLookupByLibrary.simpleMessage("Manter sessão iniciada"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library": MessageLookupByLibrary.simpleMessage("Biblioteca"), + "library_cancel_error": MessageLookupByLibrary.simpleMessage( + "Ocorreu um erro ao cancelar a reserva!"), + "library_cancel_reservation": MessageLookupByLibrary.simpleMessage( + "Queres cancelar este pedido?"), + "library_cancel_success": + MessageLookupByLibrary.simpleMessage("A reserva foi cancelada!"), + "library_cancel_tooltip": + MessageLookupByLibrary.simpleMessage("Cancelar reserva"), + "library_occupation": + MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), + "library_reservations": + MessageLookupByLibrary.simpleMessage("Gabinetes Reservados"), + "library_tab_occupation": + MessageLookupByLibrary.simpleMessage("Ocupação"), + "library_tab_reservations": + MessageLookupByLibrary.simpleMessage("Gabinetes"), + "load_error": MessageLookupByLibrary.simpleMessage( + "Aconteceu um erro ao carregar os dados"), + "loading_terms": MessageLookupByLibrary.simpleMessage( + "Carregando os Termos e Condições..."), + "login": MessageLookupByLibrary.simpleMessage("Entrar"), + "logout": MessageLookupByLibrary.simpleMessage("Terminar sessão"), + "menus": MessageLookupByLibrary.simpleMessage("Ementas"), + "min_value_reference": + MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"), + "multimedia_center": + MessageLookupByLibrary.simpleMessage("Centro de multimédia"), + "nav_title": m2, + "news": MessageLookupByLibrary.simpleMessage("Notícias"), + "no": MessageLookupByLibrary.simpleMessage("Não"), + "no_bus": MessageLookupByLibrary.simpleMessage( + "Não percas nenhum autocarro!"), + "no_bus_stops": MessageLookupByLibrary.simpleMessage( + "Não existe nenhuma paragem configurada"), + "no_class": MessageLookupByLibrary.simpleMessage( + "Não existem turmas para apresentar"), + "no_classes": MessageLookupByLibrary.simpleMessage( + "Não existem aulas para apresentar"), + "no_classes_on": + MessageLookupByLibrary.simpleMessage("Não possui aulas à"), + "no_college": MessageLookupByLibrary.simpleMessage("sem faculdade"), + "no_course_units": MessageLookupByLibrary.simpleMessage( + "Sem cadeiras no período selecionado"), + "no_data": MessageLookupByLibrary.simpleMessage( + "Não há dados a mostrar neste momento"), + "no_date": MessageLookupByLibrary.simpleMessage("Sem data"), + "no_exams": + MessageLookupByLibrary.simpleMessage("Não possui exames marcados"), + "no_exams_label": + MessageLookupByLibrary.simpleMessage("Parece que estás de férias!"), + "no_favorite_restaurants": + MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), + "no_info": MessageLookupByLibrary.simpleMessage( + "Não existem informações para apresentar"), + "no_menu_info": MessageLookupByLibrary.simpleMessage( + "Não há informação disponível sobre refeições"), + "no_menus": MessageLookupByLibrary.simpleMessage( + "Não há refeições disponíveis"), + "no_name_course": + MessageLookupByLibrary.simpleMessage("Curso sem nome"), + "no_places_info": MessageLookupByLibrary.simpleMessage( + "Não há informação disponível sobre locais"), + "no_references": MessageLookupByLibrary.simpleMessage( + "Não existem referências a pagar"), + "no_results": MessageLookupByLibrary.simpleMessage("Sem resultados"), + "no_selected_courses": MessageLookupByLibrary.simpleMessage( + "Não existem cadeiras para apresentar"), + "no_selected_exams": MessageLookupByLibrary.simpleMessage( + "Não existem exames para apresentar"), + "occurrence_type": + MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), + "other_links": MessageLookupByLibrary.simpleMessage("Outros links"), + "pass_change_request": MessageLookupByLibrary.simpleMessage( + "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), + "password": MessageLookupByLibrary.simpleMessage("palavra-passe"), + "pendent_references": + MessageLookupByLibrary.simpleMessage("Referências pendentes"), + "personal_assistance": + MessageLookupByLibrary.simpleMessage("Atendimento presencial"), + "press_again": MessageLookupByLibrary.simpleMessage( + "Pressione novamente para sair"), + "print": MessageLookupByLibrary.simpleMessage("Impressão"), + "prints": MessageLookupByLibrary.simpleMessage("Impressões"), + "problem_id": MessageLookupByLibrary.simpleMessage( + "Breve identificação do problema"), + "reference_sigarra_help": MessageLookupByLibrary.simpleMessage( + "Os dados da referência gerada aparecerão no Sigarra, conta corrente.\\nPerfil > Conta Corrente"), + "reference_success": MessageLookupByLibrary.simpleMessage( + "Referência criada com sucesso!"), + "remove": MessageLookupByLibrary.simpleMessage("Remover"), + "report_error": MessageLookupByLibrary.simpleMessage("Reportar erro"), + "room": MessageLookupByLibrary.simpleMessage("Sala"), + "school_calendar": + MessageLookupByLibrary.simpleMessage("Calendário Escolar"), + "semester": MessageLookupByLibrary.simpleMessage("Semestre"), + "send": MessageLookupByLibrary.simpleMessage("Enviar"), + "sent_error": + MessageLookupByLibrary.simpleMessage("Ocorreu um erro no envio"), + "some_error": MessageLookupByLibrary.simpleMessage("Algum erro!"), + "stcp_stops": + MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), + "student_number": + MessageLookupByLibrary.simpleMessage("número de estudante"), + "success": MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), + "tele_assistance": + MessageLookupByLibrary.simpleMessage("Atendimento telefónico"), + "tele_personal_assistance": MessageLookupByLibrary.simpleMessage( + "Atendimento presencial e telefónico"), + "telephone": MessageLookupByLibrary.simpleMessage("Telefone"), + "terms": MessageLookupByLibrary.simpleMessage("Termos e Condições"), + "title": MessageLookupByLibrary.simpleMessage("Título"), + "unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"), + "valid_email": MessageLookupByLibrary.simpleMessage( + "Por favor insere um email válido"), + "widget_prompt": MessageLookupByLibrary.simpleMessage( + "Escolhe um widget para adicionares à tua área pessoal:"), + "year": MessageLookupByLibrary.simpleMessage("Ano"), + "yes": MessageLookupByLibrary.simpleMessage("Sim") + }; } diff --git a/uni/lib/generated/l10n.dart b/uni/lib/generated/l10n.dart index 4844c84e5..76f7ce649 100644 --- a/uni/lib/generated/l10n.dart +++ b/uni/lib/generated/l10n.dart @@ -18,28 +18,31 @@ class S { static S? _current; static S get current { - assert(_current != null, 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); return _current!; } - static const AppLocalizationDelegate delegate = - AppLocalizationDelegate(); + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); - final localeName = Intl.canonicalizedLocale(name); + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; final instance = S(); S._current = instance; - + return instance; }); - } + } static S of(BuildContext context) { final instance = S.maybeOf(context); - assert(instance != null, 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); return instance!; } @@ -1451,4 +1454,4 @@ class AppLocalizationDelegate extends LocalizationsDelegate { } return false; } -} \ No newline at end of file +} diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 65634822a..f2dd6cae0 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -153,7 +153,9 @@ class _ReservationRemoveButtonState extends State { }) async { if (success) { await ToastMessage.success( - widget.context, S.of(context).library_cancel_success,); + widget.context, + S.of(context).library_cancel_success, + ); } else { await ToastMessage.error( widget.context, From 5ba9cfa37a3bbef29e3e03c7f7b499bac7c87572 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 11 Oct 2023 15:52:15 +0100 Subject: [PATCH 32/45] Made small changes according to suggestions --- .../fetchers/library_reservation_fetcher.dart | 4 +- .../view/library/widgets/reservation_row.dart | 57 ++++++++++--------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index 2f7b63694..c73dab587 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -11,8 +11,8 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers final url = - // ignore: lines_longer_than_80_chars - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + '.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index f2dd6cae0..2cf5642d8 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -28,7 +28,7 @@ class ReservationRow extends StatelessWidget { @override Widget build(BuildContext context) { final weekdays = - Provider.of(context).getWeekdaysWithLocale(); + Provider.of(context, listen: false).getWeekdaysWithLocale(); weekDay = weekdays[reservation.startDate.weekday]; return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -49,7 +49,6 @@ class ReservationRow extends StatelessWidget { children: [ Text( reservation.room, - //textAlign: TextAlign.center, style: Theme.of(context) .textTheme .headlineSmall @@ -62,18 +61,16 @@ class ReservationRow extends StatelessWidget { ), ], ), - ReservationRemoveButton(reservation), + ReservationRemoveButton(context, reservation), ], ); } } -//ignore: must_be_immutable class ReservationRemoveButton extends StatefulWidget { - ReservationRemoveButton(this.reservation, {super.key}); + const ReservationRemoveButton(this.context, this.reservation, {super.key}); final LibraryReservation reservation; - late bool loading = false; - late BuildContext context; + final BuildContext context; @override State createState() => @@ -81,12 +78,11 @@ class ReservationRemoveButton extends StatefulWidget { } class _ReservationRemoveButtonState extends State { + bool _loading = false; + @override Widget build(BuildContext context) { - setState(() { - widget.context = context; - }); - if (widget.loading) { + if (_loading) { return const CircularProgressIndicator(); } return IconButton( @@ -134,9 +130,9 @@ class _ReservationRemoveButtonState extends State { } Future cancelReservation(String id) async { - if (widget.loading) return; + if (_loading) return; setState(() { - widget.loading = true; + _loading = true; }); final session = Provider.of(widget.context, listen: false).session; @@ -145,22 +141,27 @@ class _ReservationRemoveButtonState extends State { listen: false, ).cancelReservation(session, id); - await displayToast(success: result); - } - - Future displayToast({ - bool success = true, - }) async { - if (success) { - await ToastMessage.success( - widget.context, - S.of(context).library_cancel_success, - ); + if (result) { + await displayToastSuccess(); } else { - await ToastMessage.error( - widget.context, - S.of(context).library_cancel_success, - ); + await displayToastFailure(); } + setState(() { + _loading = false; + }); + } + + Future displayToastSuccess() async { + await ToastMessage.success( + widget.context, + S.of(context).library_cancel_success, + ); + } + + Future displayToastFailure() async { + await ToastMessage.error( + widget.context, + S.of(context).library_cancel_error, + ); } } From ea9b0bc88385bc88e7100038d3ab5837ae43ddb2 Mon Sep 17 00:00:00 2001 From: luis Date: Thu, 9 Nov 2023 22:24:30 +0000 Subject: [PATCH 33/45] Fixed context errors in reservation cancel button --- .../fetchers/library_reservation_fetcher.dart | 3 +- .../view/library/widgets/reservation_row.dart | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index c73dab587..c6f05f45d 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -10,8 +10,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { List getEndpoints(Session session) { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers - final url = - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' '.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index 2cf5642d8..06c8e9d9b 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -3,6 +3,7 @@ import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:uni/generated/l10n.dart'; +import 'package:uni/main.dart'; import 'package:uni/model/entities/library_reservation.dart'; import 'package:uni/model/providers/lazy/library_reservations_provider.dart'; import 'package:uni/model/providers/startup/session_provider.dart'; @@ -27,8 +28,8 @@ class ReservationRow extends StatelessWidget { @override Widget build(BuildContext context) { - final weekdays = - Provider.of(context, listen: false).getWeekdaysWithLocale(); + final weekdays = Provider.of(context, listen: false) + .getWeekdaysWithLocale(); weekDay = weekdays[reservation.startDate.weekday]; return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -61,16 +62,15 @@ class ReservationRow extends StatelessWidget { ), ], ), - ReservationRemoveButton(context, reservation), + ReservationRemoveButton(reservation), ], ); } } class ReservationRemoveButton extends StatefulWidget { - const ReservationRemoveButton(this.context, this.reservation, {super.key}); + const ReservationRemoveButton(this.reservation, {super.key}); final LibraryReservation reservation; - final BuildContext context; @override State createState() => @@ -98,7 +98,7 @@ class _ReservationRemoveButtonState extends State { onPressed: () { showDialog( context: context, - builder: (BuildContext toastContext) { + builder: (BuildContext context) { return AlertDialog( content: Text( S.of(context).library_cancel_reservation, @@ -109,14 +109,14 @@ class _ReservationRemoveButtonState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ TextButton( - onPressed: () => Navigator.of(toastContext).pop(), + onPressed: () => Navigator.of(context).pop(), child: Text(S.of(context).go_back), ), ElevatedButton( child: Text(S.of(context).yes), onPressed: () { - Navigator.of(context, rootNavigator: true).pop(); cancelReservation(widget.reservation.id); + Navigator.of(context).pop(); }, ), ], @@ -134,33 +134,36 @@ class _ReservationRemoveButtonState extends State { setState(() { _loading = true; }); + final context = Application.navigatorKey.currentContext!; final session = - Provider.of(widget.context, listen: false).session; + Provider.of(context, listen: false).session; final result = await Provider.of( - widget.context, + context, listen: false, ).cancelReservation(session, id); + setState(() { + _loading = false; + }); if (result) { await displayToastSuccess(); } else { await displayToastFailure(); } - setState(() { - _loading = false; - }); } Future displayToastSuccess() async { + final context = Application.navigatorKey.currentContext!; await ToastMessage.success( - widget.context, + context, S.of(context).library_cancel_success, ); } Future displayToastFailure() async { + final context = Application.navigatorKey.currentContext!; await ToastMessage.error( - widget.context, + context, S.of(context).library_cancel_error, ); } From 73f499e69590c0f8197941e4605f79b0307194df Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 11 Dec 2023 18:49:01 +0000 Subject: [PATCH 34/45] Remove new line from version file --- uni/app_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/app_version.txt b/uni/app_version.txt index abf51b9ec..9c84debe6 100644 --- a/uni/app_version.txt +++ b/uni/app_version.txt @@ -1 +1 @@ -1.7.22+212 +1.7.22+212 \ No newline at end of file From e6492a5f30d002835ac1c4033208bbbf70b2d9f9 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 11 Dec 2023 18:57:01 +0000 Subject: [PATCH 35/45] Linter fixes --- uni/lib/view/library/widgets/library_occupation_tab.dart | 8 ++++---- .../view/library/widgets/library_reservations_tab.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index 73c8a21e8..558624abc 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -52,7 +52,7 @@ class LibraryOccupationTabView extends StatelessWidget { style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center, ), - ) + ), ], ); } @@ -63,7 +63,7 @@ class LibraryOccupationTabView extends StatelessWidget { if (occupation != null) ...[ PageTitle(name: S.of(context).floors), FloorRows(occupation!), - ] + ], ], ); } @@ -106,7 +106,7 @@ class FloorCard extends StatelessWidget { color: Color.fromARGB(0x1c, 0, 0, 0), blurRadius: 7, offset: Offset(0, 1), - ) + ), ], ), child: Column( @@ -132,7 +132,7 @@ class FloorCard extends StatelessWidget { percent: floor.percentage / 100, progressColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).dividerColor, - ) + ), ], ), ); diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index d4456b58d..ac8f9ade6 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -40,7 +40,7 @@ class LibraryReservationsTabView extends StatelessWidget { style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center, ), - ) + ), ], ); } From 1eff19f136446517c3bd2862c8483538e7e40fbb Mon Sep 17 00:00:00 2001 From: luis Date: Fri, 29 Dec 2023 14:09:14 +0000 Subject: [PATCH 36/45] Small lint fix --- .../model/providers/lazy/library_reservations_provider.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 830b0b6a0..f68569efd 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -15,7 +15,8 @@ class LibraryReservationsProvider @override Future> loadFromStorage( - StateProviders stateProviders,) { + StateProviders stateProviders, + ) { final db = LibraryReservationDatabase(); return db.reservations(); } @@ -46,8 +47,7 @@ class LibraryReservationsProvider final response = await NetworkRouter.getWithCookies(url, {}, session); if (response.statusCode == 200) { - state - ?.remove(state?.firstWhere((element) => element.id == id)); + state?.remove(state?.firstWhere((element) => element.id == id)); notifyListeners(); final db = LibraryReservationDatabase(); unawaited(db.saveReservations(state!)); From ca2214858612ad9fe16f48a404749ac45b722138 Mon Sep 17 00:00:00 2001 From: luis Date: Fri, 29 Dec 2023 14:26:11 +0000 Subject: [PATCH 37/45] Lint fixes --- .../controller/fetchers/library_reservation_fetcher.dart | 2 +- .../model/providers/lazy/library_reservations_provider.dart | 3 ++- uni/lib/view/library/widgets/library_occupation_tab.dart | 4 ++-- uni/lib/view/library/widgets/library_reservations_tab.dart | 2 +- uni/lib/view/library/widgets/reservation_row.dart | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index bdd51b25d..2f7b63694 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -11,7 +11,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers final url = - // ignore: lines_longer_than_80_chars + // ignore: lines_longer_than_80_chars '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index 4e7e86079..f0fbd1c19 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -16,7 +16,8 @@ class LibraryReservationsProvider @override Future> loadFromStorage( - StateProviders stateProviders,) { + StateProviders stateProviders, + ) { final db = LibraryReservationDatabase(); return db.reservations(); } diff --git a/uni/lib/view/library/widgets/library_occupation_tab.dart b/uni/lib/view/library/widgets/library_occupation_tab.dart index c953fe40a..b3a433765 100644 --- a/uni/lib/view/library/widgets/library_occupation_tab.dart +++ b/uni/lib/view/library/widgets/library_occupation_tab.dart @@ -95,7 +95,7 @@ class FloorCard extends StatelessWidget { color: Color.fromARGB(0x1c, 0, 0, 0), blurRadius: 7, offset: Offset(0, 1), - ) + ), ], ), child: Column( @@ -121,7 +121,7 @@ class FloorCard extends StatelessWidget { percent: floor.percentage / 100, progressColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).dividerColor, - ) + ), ], ), ); diff --git a/uni/lib/view/library/widgets/library_reservations_tab.dart b/uni/lib/view/library/widgets/library_reservations_tab.dart index 8bbb16427..72aaafa28 100644 --- a/uni/lib/view/library/widgets/library_reservations_tab.dart +++ b/uni/lib/view/library/widgets/library_reservations_tab.dart @@ -48,7 +48,7 @@ class LibraryReservationsTabView extends StatelessWidget { style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center, ), - ) + ), ], ); } diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index b3d4b1119..f74155833 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -38,7 +38,7 @@ class ReservationRow extends StatelessWidget { Text( hoursEnd, style: Theme.of(context).textTheme.bodyLarge, - ) + ), ], ), Column( @@ -55,10 +55,10 @@ class ReservationRow extends StatelessWidget { Text( '$weekDay, $day de $month', style: Theme.of(context).textTheme.titleMedium, - ) + ), ], ), - const ReservationRemoveButton() + const ReservationRemoveButton(), ], ); } From eabde47417bcdbfb6970bc13347ff56207147ef4 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 8 Jan 2024 08:12:26 +0000 Subject: [PATCH 38/45] Removed leftover ignore --- uni/lib/controller/fetchers/library_reservation_fetcher.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index 2f7b63694..c73dab587 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -11,8 +11,8 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers final url = - // ignore: lines_longer_than_80_chars - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_list?pct_tipo_grupo_id=3'; + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + '.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } From 80df1bc72efa0c5fb67f7e554345eb0992f67136 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 8 Jan 2024 08:14:48 +0000 Subject: [PATCH 39/45] Generated translation files --- .../controller/fetchers/library_reservation_fetcher.dart | 3 +-- uni/lib/generated/intl/messages_en.dart | 8 ++++---- uni/lib/generated/intl/messages_pt_PT.dart | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/uni/lib/controller/fetchers/library_reservation_fetcher.dart b/uni/lib/controller/fetchers/library_reservation_fetcher.dart index c73dab587..c6f05f45d 100644 --- a/uni/lib/controller/fetchers/library_reservation_fetcher.dart +++ b/uni/lib/controller/fetchers/library_reservation_fetcher.dart @@ -10,8 +10,7 @@ class LibraryReservationsFetcherHtml implements SessionDependantFetcher { List getEndpoints(Session session) { // TO DO: Implement parsers for all faculties // and dispatch for different fetchers - final url = - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' '.pedidos_list?pct_tipo_grupo_id=3'; return [url]; } diff --git a/uni/lib/generated/intl/messages_en.dart b/uni/lib/generated/intl/messages_en.dart index 05e11e237..d0f265870 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -39,7 +39,7 @@ class MessageLookup extends MessageLookupByLibrary { })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static Map _notInlinedMessages(_) => { + static _notInlinedMessages(_) => { "about": MessageLookupByLibrary.simpleMessage("About us"), "academic_services": MessageLookupByLibrary.simpleMessage("Academic services"), @@ -116,7 +116,6 @@ class MessageLookup extends MessageLookupByLibrary { "edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"), "empty_text": MessageLookupByLibrary.simpleMessage("Please fill in this field"), - "exam_of": MessageLookupByLibrary.simpleMessage("of"), "exams_filter": MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), "exit_confirm": @@ -193,10 +192,10 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("No favorite restaurants"), "no_info": MessageLookupByLibrary.simpleMessage( "There is no information to display"), - "no_link": - MessageLookupByLibrary.simpleMessage("We couldn\'t open the link"), "no_library_info": MessageLookupByLibrary.simpleMessage( "No library occupation information available"), + "no_link": + MessageLookupByLibrary.simpleMessage("We couldn\'t open the link"), "no_menu_info": MessageLookupByLibrary.simpleMessage( "There is no information available about meals"), "no_menus": MessageLookupByLibrary.simpleMessage( @@ -217,6 +216,7 @@ class MessageLookup extends MessageLookupByLibrary { "notifications": MessageLookupByLibrary.simpleMessage("Notifications"), "occurrence_type": MessageLookupByLibrary.simpleMessage("Type of occurrence"), + "of_month": MessageLookupByLibrary.simpleMessage("of"), "other_links": MessageLookupByLibrary.simpleMessage("Other links"), "pass_change_request": MessageLookupByLibrary.simpleMessage( "For security reasons, passwords must be changed periodically."), diff --git a/uni/lib/generated/intl/messages_pt_PT.dart b/uni/lib/generated/intl/messages_pt_PT.dart index c2129b0de..fa84ebe24 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -39,7 +39,7 @@ class MessageLookup extends MessageLookupByLibrary { })}"; final messages = _notInlinedMessages(_notInlinedMessages); - static Map _notInlinedMessages(_) => { + static _notInlinedMessages(_) => { "about": MessageLookupByLibrary.simpleMessage("Sobre nós"), "academic_services": MessageLookupByLibrary.simpleMessage("Serviços académicos"), @@ -115,7 +115,6 @@ class MessageLookup extends MessageLookupByLibrary { "edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"), "empty_text": MessageLookupByLibrary.simpleMessage( "Por favor preenche este campo"), - "of_month": MessageLookupByLibrary.simpleMessage("de"), "exams_filter": MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), "exit_confirm": MessageLookupByLibrary.simpleMessage( @@ -194,10 +193,10 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Sem restaurantes favoritos"), "no_info": MessageLookupByLibrary.simpleMessage( "Não existem informações para apresentar"), - "no_link": MessageLookupByLibrary.simpleMessage( - "Não conseguimos abrir o link"), "no_library_info": MessageLookupByLibrary.simpleMessage("Sem informação de ocupação"), + "no_link": MessageLookupByLibrary.simpleMessage( + "Não conseguimos abrir o link"), "no_menu_info": MessageLookupByLibrary.simpleMessage( "Não há informação disponível sobre refeições"), "no_menus": MessageLookupByLibrary.simpleMessage( @@ -218,6 +217,7 @@ class MessageLookup extends MessageLookupByLibrary { "notifications": MessageLookupByLibrary.simpleMessage("Notificações"), "occurrence_type": MessageLookupByLibrary.simpleMessage("Tipo de ocorrência"), + "of_month": MessageLookupByLibrary.simpleMessage("de"), "other_links": MessageLookupByLibrary.simpleMessage("Outros links"), "pass_change_request": MessageLookupByLibrary.simpleMessage( "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), From 97507c771f5ca221077fdf700ca83e5a8e0b375c Mon Sep 17 00:00:00 2001 From: luis Date: Thu, 11 Jan 2024 23:01:57 +0000 Subject: [PATCH 40/45] Fixed library card page link --- uni/lib/view/library/widgets/library_occupation_card.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/lib/view/library/widgets/library_occupation_card.dart b/uni/lib/view/library/widgets/library_occupation_card.dart index 4f6a77d6a..9ab130ad8 100644 --- a/uni/lib/view/library/widgets/library_occupation_card.dart +++ b/uni/lib/view/library/widgets/library_occupation_card.dart @@ -24,7 +24,7 @@ class LibraryOccupationCard extends GenericCard { @override Future onClick(BuildContext context) => Navigator.pushNamed( context, - '/${DrawerItem.navLibraryReservations.title}', + '/${DrawerItem.navLibraryOccupation.title}', ); @override From 85f81b47c5865bcc14aeae0544706d5a19020618 Mon Sep 17 00:00:00 2001 From: luis Date: Thu, 11 Jan 2024 23:02:47 +0000 Subject: [PATCH 41/45] Reset app version --- uni/app_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/app_version.txt b/uni/app_version.txt index e4c4ceeb1..f5d0c7b2c 100644 --- a/uni/app_version.txt +++ b/uni/app_version.txt @@ -1 +1 @@ -1.7.32+222 +1.7.32+222 \ No newline at end of file From eb601cd58f100122cac9d18c59823ff3e99ebe22 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 24 Jan 2024 21:31:54 +0000 Subject: [PATCH 42/45] Reverted messages_all file, fixing tests --- uni/lib/generated/intl/messages_all.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/uni/lib/generated/intl/messages_all.dart b/uni/lib/generated/intl/messages_all.dart index 6b3ebeae5..b77f94db2 100644 --- a/uni/lib/generated/intl/messages_all.dart +++ b/uni/lib/generated/intl/messages_all.dart @@ -11,6 +11,7 @@ import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:intl/intl.dart'; import 'package:intl/message_lookup_by_library.dart'; import 'package:intl/src/intl_helpers.dart'; @@ -20,8 +21,8 @@ import 'messages_pt_PT.dart' as messages_pt_pt; typedef Future LibraryLoader(); Map _deferredLibraries = { - 'en': () => new Future.value(null), - 'pt_PT': () => new Future.value(null), + 'en': () => new SynchronousFuture(null), + 'pt_PT': () => new SynchronousFuture(null), }; MessageLookupByLibrary? _findExact(String localeName) { @@ -36,18 +37,18 @@ MessageLookupByLibrary? _findExact(String localeName) { } /// User programs should call this before using [localeName] for messages. -Future initializeMessages(String localeName) async { +Future initializeMessages(String localeName) { var availableLocale = Intl.verifiedLocale( localeName, (locale) => _deferredLibraries[locale] != null, onFailure: (_) => null); if (availableLocale == null) { - return new Future.value(false); + return new SynchronousFuture(false); } var lib = _deferredLibraries[availableLocale]; - await (lib == null ? new Future.value(false) : lib()); + lib == null ? new SynchronousFuture(false) : lib(); initializeInternalMessageLookup(() => new CompositeMessageLookup()); messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); - return new Future.value(true); + return new SynchronousFuture(true); } bool _messagesExistFor(String locale) { From 0e8b5161397a6ad1f46f0a65105a3bad0c1d3da4 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 24 Jan 2024 22:04:59 +0000 Subject: [PATCH 43/45] Made changes according to suggestions --- .../database/app_exams_database.dart | 14 ------------- .../lazy/library_reservations_provider.dart | 4 ++-- .../view/library/widgets/reservation_row.dart | 20 +++++++------------ 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/uni/lib/controller/local_storage/database/app_exams_database.dart b/uni/lib/controller/local_storage/database/app_exams_database.dart index 49f6bcc0c..8d53df3da 100644 --- a/uni/lib/controller/local_storage/database/app_exams_database.dart +++ b/uni/lib/controller/local_storage/database/app_exams_database.dart @@ -11,20 +11,6 @@ import 'package:uni/model/entities/exam.dart'; class AppExamsDatabase extends AppDatabase { AppExamsDatabase() : super('exams.db', [_createScript], onUpgrade: migrate, version: 5); - Map months = { - 'Janeiro': '01', - 'Fevereiro': '02', - 'Março': '03', - 'Abril': '04', - 'Maio': '05', - 'Junho': '06', - 'Julho': '07', - 'Agosto': '08', - 'Setembro': '09', - 'Outubro': '10', - 'Novembro': '11', - 'Dezembro': '12', - }; static const _createScript = ''' CREATE TABLE exams(id TEXT, subject TEXT, begin TEXT, end TEXT, diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index f68569efd..cd2fcc2b5 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -37,8 +37,8 @@ class LibraryReservationsProvider Future cancelReservation(Session session, String id) async { final url = - // ignore: lines_longer_than_80_chars - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral.pedidos_cancelar?pct_pedido_id=$id'; + '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + '.pedidos_cancelar?pct_pedido_id=$id'; final headers = {}; headers['cookie'] = session.cookies; diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index ed218b3c8..2763d4e68 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -12,36 +12,30 @@ import 'package:uni/view/locale_notifier.dart'; class ReservationRow extends StatelessWidget { ReservationRow(this.reservation, {super.key}) { - hoursStart = DateFormat('HH:mm').format(reservation.startDate); - hoursEnd = DateFormat('HH:mm') - .format(reservation.startDate.add(reservation.duration)); - day = DateFormat('dd').format(reservation.startDate); initializeDateFormatting(); - month = DateFormat('MMMM', 'pt').format(reservation.startDate); } final LibraryReservation reservation; - late final String hoursStart; - late final String hoursEnd; - late final String weekDay; - late final String day; - late final String month; @override Widget build(BuildContext context) { + final day = DateFormat('dd').format(reservation.startDate); + final month = DateFormat('MMMM', 'pt').format(reservation.startDate); final weekdays = Provider.of(context, listen: false) .getWeekdaysWithLocale(); - weekDay = weekdays[reservation.startDate.weekday]; + final weekDay = weekdays[reservation.startDate.weekday]; + return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( children: [ Text( - hoursStart, + DateFormat('HH:mm').format(reservation.startDate), style: Theme.of(context).textTheme.bodyLarge, ), Text( - hoursEnd, + DateFormat('HH:mm') + .format(reservation.startDate.add(reservation.duration)), style: Theme.of(context).textTheme.bodyLarge, ), ], From a4768ece1467adb52750e5a96e9f7dc3c2fbcc52 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 24 Jan 2024 22:07:28 +0000 Subject: [PATCH 44/45] Format files --- .../model/providers/lazy/library_reservations_provider.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uni/lib/model/providers/lazy/library_reservations_provider.dart b/uni/lib/model/providers/lazy/library_reservations_provider.dart index cd2fcc2b5..0198f89f9 100644 --- a/uni/lib/model/providers/lazy/library_reservations_provider.dart +++ b/uni/lib/model/providers/lazy/library_reservations_provider.dart @@ -36,8 +36,7 @@ class LibraryReservationsProvider } Future cancelReservation(Session session, String id) async { - final url = - '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' + final url = '${NetworkRouter.getBaseUrl('feup')}res_recursos_geral' '.pedidos_cancelar?pct_pedido_id=$id'; final headers = {}; From 65f3fe41773bed7e28013a1b43c2a0a377b6db88 Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 24 Jan 2024 22:18:44 +0000 Subject: [PATCH 45/45] Fixed reservation weekday --- uni/lib/view/library/widgets/reservation_row.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/lib/view/library/widgets/reservation_row.dart b/uni/lib/view/library/widgets/reservation_row.dart index f74155833..f15d6ecdb 100644 --- a/uni/lib/view/library/widgets/reservation_row.dart +++ b/uni/lib/view/library/widgets/reservation_row.dart @@ -25,7 +25,7 @@ class ReservationRow extends StatelessWidget { Widget build(BuildContext context) { final weekdays = Provider.of(context).getWeekdaysWithLocale(); - weekDay = weekdays[reservation.startDate.weekday]; + weekDay = weekdays[reservation.startDate.weekday - 1]; return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [