From 3cd878ea3847c98ff6eec3bbaa59e43f394bc560 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sun, 31 Mar 2024 01:32:00 +0100 Subject: [PATCH 1/9] add custom_lint and fix low-hanging fruits --- uni/analysis_options.yaml | 2 ++ .../background_callback.dart | 8 ++++---- .../background_workers/notifications.dart | 4 ++-- uni/lib/controller/cleanup.dart | 2 +- .../fetchers/departures_fetcher.dart | 6 +++--- .../database/app_calendar_database.dart | 2 +- .../database/app_restaurant_database.dart | 4 ++-- .../notification_timeout_storage.dart | 4 ++-- .../local_storage/preferences_controller.dart | 2 +- .../parsers/parser_library_occupation.dart | 4 ++-- .../controller/parsers/parser_restaurants.dart | 12 ++++++------ .../parsers/parser_schedule_html.dart | 2 +- uni/lib/model/entities/calendar_event.dart | 2 +- .../providers/startup/session_provider.dart | 2 +- .../providers/state_provider_notifier.dart | 14 ++++++-------- uni/lib/view/bug_report/widgets/form.dart | 6 +++--- .../widgets/bus_stop_search.dart | 2 +- .../pages_layouts/general/general.dart | 8 ++++---- .../widgets/course_unit_sheet.dart | 2 +- .../view/home/widgets/exam_card_shimmer.dart | 6 +++--- uni/lib/view/home/widgets/main_cards_list.dart | 2 +- .../home/widgets/schedule_card_shimmer.dart | 10 +++++----- uni/lib/view/lazy_consumer.dart | 8 ++++---- .../view/locations/widgets/marker_popup.dart | 2 +- uni/lib/view/login/login.dart | 18 +++++++++--------- uni/pubspec.lock | 2 +- uni/pubspec.yaml | 1 + 27 files changed, 69 insertions(+), 68 deletions(-) diff --git a/uni/analysis_options.yaml b/uni/analysis_options.yaml index 44ceb645f..f943b88cd 100644 --- a/uni/analysis_options.yaml +++ b/uni/analysis_options.yaml @@ -6,3 +6,5 @@ analyzer: - "**.g.dart" - "**.mocks.dart" - "**generated/**" + plugins: + - custom_lint diff --git a/uni/lib/controller/background_workers/background_callback.dart b/uni/lib/controller/background_workers/background_callback.dart index 3f1664db7..1283b05fc 100644 --- a/uni/lib/controller/background_workers/background_callback.dart +++ b/uni/lib/controller/background_workers/background_callback.dart @@ -32,14 +32,14 @@ Future workerStartCallback() async { }); return true; } - //try to keep the usage of this function BELOW +-30 seconds - //to not be punished by the scheduler in future runs. + // try to keep the usage of this function BELOW +-30 seconds + // to not be punished by the scheduler in future runs. await taskMap[taskName]!.item1(); - } catch (err, stackTrace) { + } catch (err, st) { Logger().e( 'Error while running $taskName job:', error: err, - stackTrace: stackTrace, + stackTrace: st, ); return false; } diff --git a/uni/lib/controller/background_workers/notifications.dart b/uni/lib/controller/background_workers/notifications.dart index 03ca89a3e..2d921dbaa 100644 --- a/uni/lib/controller/background_workers/notifications.dart +++ b/uni/lib/controller/background_workers/notifications.dart @@ -125,7 +125,7 @@ class NotificationManager { const initializationSettingsAndroid = AndroidInitializationSettings('ic_notification'); - //request for notifications immediatly on iOS + // request for notifications immediatly on iOS const darwinInitializationSettings = DarwinInitializationSettings( requestCriticalPermission: true, ); @@ -157,7 +157,7 @@ class NotificationManager { if (Platform.isAndroid) { await Workmanager().cancelByUniqueName( 'pt.up.fe.ni.uni.notificationworker', - ); //stop task if it's already running + ); // stop task if it's already running await Workmanager().registerPeriodicTask( 'pt.up.fe.ni.uni.notificationworker', 'pt.up.fe.ni.uni.notificationworker', diff --git a/uni/lib/controller/cleanup.dart b/uni/lib/controller/cleanup.dart index c30d4a2b5..79fc319c1 100644 --- a/uni/lib/controller/cleanup.dart +++ b/uni/lib/controller/cleanup.dart @@ -61,7 +61,7 @@ Future cleanDirectory(Directory directory, DateTime threshold) async { try { final fileDate = file.lastModifiedSync(); return fileDate.isBefore(threshold) && path.extension(file.path) != '.db'; - } catch (e) { + } catch (err) { return false; } }); diff --git a/uni/lib/controller/fetchers/departures_fetcher.dart b/uni/lib/controller/fetchers/departures_fetcher.dart index 23868b0ab..1ef9dbafd 100644 --- a/uni/lib/controller/fetchers/departures_fetcher.dart +++ b/uni/lib/controller/fetchers/departures_fetcher.dart @@ -45,17 +45,17 @@ class DeparturesFetcher { callParam.lastIndexOf("'"), ); return csrfToken; - } catch (e, stackTrace) { + } catch (err, st) { unawaited( Sentry.captureEvent( SentryEvent( - throwable: e, + throwable: err, request: SentryRequest( url: url, data: response.body, ), ), - stackTrace: stackTrace, + stackTrace: st, ), ); rethrow; diff --git a/uni/lib/controller/local_storage/database/app_calendar_database.dart b/uni/lib/controller/local_storage/database/app_calendar_database.dart index 6e05891b6..c4ff2b1ff 100644 --- a/uni/lib/controller/local_storage/database/app_calendar_database.dart +++ b/uni/lib/controller/local_storage/database/app_calendar_database.dart @@ -21,7 +21,7 @@ class CalendarDatabase extends AppDatabase { }); } - //Returns a list with all calendar events stored in the database + // Returns a list with all calendar events stored in the database Future> calendar() async { final db = await getDatabase(); diff --git a/uni/lib/controller/local_storage/database/app_restaurant_database.dart b/uni/lib/controller/local_storage/database/app_restaurant_database.dart index 5e15a20f2..7e1ceb6c3 100644 --- a/uni/lib/controller/local_storage/database/app_restaurant_database.dart +++ b/uni/lib/controller/local_storage/database/app_restaurant_database.dart @@ -93,11 +93,11 @@ class RestaurantDatabase extends AppDatabase { whereArgs.add(toString(day)); } - //Get restaurant meals + // Get restaurant meals final List> mealsMaps = await txn.query('meals', where: whereQuery, whereArgs: whereArgs); - //Retrieve data from query + // Retrieve data from query final meals = mealsMaps.map((map) { final day = parseDayOfWeek(map['day'] as String); final type = map['type'] as String; diff --git a/uni/lib/controller/local_storage/notification_timeout_storage.dart b/uni/lib/controller/local_storage/notification_timeout_storage.dart index b74800271..cf924b432 100644 --- a/uni/lib/controller/local_storage/notification_timeout_storage.dart +++ b/uni/lib/controller/local_storage/notification_timeout_storage.dart @@ -30,7 +30,7 @@ class NotificationTimeoutStorage { if (!_fileContent.containsKey(uniqueID)) { return DateTime.fromMicrosecondsSinceEpoch( 0, - ); //get 1970 to always trigger notification + ); // get 1970 to always trigger notification } return DateTime.parse(_fileContent[uniqueID] as String); } @@ -51,7 +51,7 @@ class NotificationTimeoutStorage { final applicationDirectory = (await getApplicationDocumentsDirectory()).path; if (!File('$applicationDirectory/notificationTimeout.json').existsSync()) { - //empty json + // empty json await File('$applicationDirectory/notificationTimeout.json') .writeAsString('{}'); } diff --git a/uni/lib/controller/local_storage/preferences_controller.dart b/uni/lib/controller/local_storage/preferences_controller.dart index 3a8ba7633..7e939866b 100644 --- a/uni/lib/controller/local_storage/preferences_controller.dart +++ b/uni/lib/controller/local_storage/preferences_controller.dart @@ -281,7 +281,7 @@ class PreferencesController { final encrypter = _createEncrypter(); try { return encrypter.decrypt64(base64Text, iv: iv); - } catch (e) { + } catch (_) { return null; } } diff --git a/uni/lib/controller/parsers/parser_library_occupation.dart b/uni/lib/controller/parsers/parser_library_occupation.dart index 7f216537f..e2abae3f1 100644 --- a/uni/lib/controller/parsers/parser_library_occupation.dart +++ b/uni/lib/controller/parsers/parser_library_occupation.dart @@ -21,12 +21,12 @@ Future parseLibraryOccupationFromSheets( int max; try { floor = (jsonDecoded['table']['rows'][i]['c'][0]['v'] as double).toInt(); - } catch (e) { + } catch (err) { floor = 0; } try { max = (jsonDecoded['table']['rows'][i]['c'][1]['v'] as double).toInt(); - } catch (e) { + } catch (err) { max = 0; } occupation.addFloor(FloorOccupation(i + 1, floor, max)); diff --git a/uni/lib/controller/parsers/parser_restaurants.dart b/uni/lib/controller/parsers/parser_restaurants.dart index 69cd921c9..7ca640558 100644 --- a/uni/lib/controller/parsers/parser_restaurants.dart +++ b/uni/lib/controller/parsers/parser_restaurants.dart @@ -14,7 +14,7 @@ import 'package:uni/model/utils/day_of_week.dart'; List getRestaurantsFromHtml(Response response) { final document = parse(response.body); - //Get restaurant reference number and name + // Get restaurant reference number and name final restaurantsHtml = document.querySelectorAll('#conteudoinner ul li > a'); final restaurantsTuple = restaurantsHtml.map((restaurantHtml) { @@ -23,7 +23,7 @@ List getRestaurantsFromHtml(Response response) { return Tuple2(ref ?? '', name); }).toList(); - //Get restaurant meals and create the Restaurant class + // Get restaurant meals and create the Restaurant class final restaurants = restaurantsTuple.map((restaurantTuple) { final meals = []; @@ -35,14 +35,14 @@ List getRestaurantsFromHtml(Response response) { while (next != null && next.attributes['name'] == null) { next = next.nextElementSibling; if (next!.classes.contains('dados')) { - //It's the menu table + // It's the menu table final rows = next.querySelectorAll('tr'); - //Check if is empty + // Check if is empty if (rows.length <= 1) { break; } - //Read rows, first row is ignored because it's the header + // Read rows, first row is ignored because it's the header rows.getRange(1, rows.length).forEach((row) { DayOfWeek? dayOfWeek; String? type; @@ -55,7 +55,7 @@ List getRestaurantsFromHtml(Response response) { if (header == 'Data') { final d = parseDayOfWeek(value); if (d == null) { - //It's a date + // It's a date date = format.parseUtc(value); } else { dayOfWeek = d; diff --git a/uni/lib/controller/parsers/parser_schedule_html.dart b/uni/lib/controller/parsers/parser_schedule_html.dart index 8d2796b75..f406724da 100644 --- a/uni/lib/controller/parsers/parser_schedule_html.dart +++ b/uni/lib/controller/parsers/parser_schedule_html.dart @@ -82,7 +82,7 @@ Future> getOverlappedClasses( ) .first, ); - } catch (e) { + } catch (_) { final lect = Lecture.fromHtml( subject!, typeClass!, diff --git a/uni/lib/model/entities/calendar_event.dart b/uni/lib/model/entities/calendar_event.dart index 30fc653d3..59336b55d 100644 --- a/uni/lib/model/entities/calendar_event.dart +++ b/uni/lib/model/entities/calendar_event.dart @@ -24,7 +24,7 @@ class CalendarEvent { try { return DateFormat('dd MMMM yyyy', 'pt') .parse('${splitDate[0]} $month ${splitDate.last}'); - } catch (e) { + } catch (_) { return null; } } diff --git a/uni/lib/model/providers/startup/session_provider.dart b/uni/lib/model/providers/startup/session_provider.dart index 037392a37..88a8c9e87 100644 --- a/uni/lib/model/providers/startup/session_provider.dart +++ b/uni/lib/model/providers/startup/session_provider.dart @@ -75,7 +75,7 @@ class SessionProvider extends StateProviderNotifier { persistentSession: persistentSession, ignoreCached: true, ); - } catch (e) { + } catch (_) { throw InternetStatusException(locale); } diff --git a/uni/lib/model/providers/state_provider_notifier.dart b/uni/lib/model/providers/state_provider_notifier.dart index 55c08367a..2b47392fc 100644 --- a/uni/lib/model/providers/state_provider_notifier.dart +++ b/uni/lib/model/providers/state_provider_notifier.dart @@ -81,10 +81,9 @@ abstract class StateProviderNotifier extends ChangeNotifier { try { setState(await loadFromStorage(StateProviders.fromContext(context))); - } catch (e, stackTrace) { - await Sentry.captureException(e, stackTrace: stackTrace); - Logger() - .e('Failed to load $runtimeType info from storage: $e\n$stackTrace'); + } catch (err, st) { + await Sentry.captureException(err, stackTrace: st); + Logger().e('Failed to load $runtimeType info from storage: $err\n$st'); _updateStatus(RequestStatus.failed); } @@ -135,10 +134,9 @@ abstract class StateProviderNotifier extends ChangeNotifier { ); _updateStatus(RequestStatus.successful); - } catch (e, stackTrace) { - await Sentry.captureException(e, stackTrace: stackTrace); - Logger() - .e('Failed to load $runtimeType info from remote: $e\n$stackTrace'); + } catch (err, st) { + await Sentry.captureException(err, stackTrace: st); + Logger().e('Failed to load $runtimeType info from remote: $err\n$st'); _updateStatus(RequestStatus.failed); } } diff --git a/uni/lib/view/bug_report/widgets/form.dart b/uni/lib/view/bug_report/widgets/form.dart index 111938515..14d5403a8 100644 --- a/uni/lib/view/bug_report/widgets/form.dart +++ b/uni/lib/view/bug_report/widgets/form.dart @@ -262,9 +262,9 @@ class BugReportFormState extends State { toastMsg = s.success; } status = true; - } catch (e, stackTrace) { - await Sentry.captureException(e, stackTrace: stackTrace); - Logger().e('Error while posting bug report:$e'); + } catch (err, st) { + await Sentry.captureException(err, stackTrace: st); + Logger().e('Error while posting bug report:$err'); if (context.mounted) { toastMsg = s.sent_error; } diff --git a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart index 72aeaefa4..8c1b03b79 100644 --- a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart +++ b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart @@ -40,7 +40,7 @@ class BusStopSearch extends SearchDelegate { @override Widget buildLeading(BuildContext context) { - //Back arrow to go back to menu + // Back arrow to go back to menu return IconButton( icon: const Icon(Icons.arrow_back), diff --git a/uni/lib/view/common_widgets/pages_layouts/general/general.dart b/uni/lib/view/common_widgets/pages_layouts/general/general.dart index 5ea94a8ff..ea9424c0b 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/general.dart @@ -37,14 +37,14 @@ abstract class GeneralPageViewState extends State { try { await onLoad(context); - } catch (e, stackTrace) { - if (e is SocketException) { + } catch (err, st) { + if (err is SocketException) { setState(() { _connected = false; }); } else { - Logger().e('Failed to load page info: $e\n$stackTrace'); - await Sentry.captureException(e, stackTrace: stackTrace); + Logger().e('Failed to load page info: $err\n$st'); + await Sentry.captureException(err, stackTrace: st); } } diff --git a/uni/lib/view/course_unit_info/widgets/course_unit_sheet.dart b/uni/lib/view/course_unit_info/widgets/course_unit_sheet.dart index e113055f3..7a408ced0 100644 --- a/uni/lib/view/course_unit_info/widgets/course_unit_sheet.dart +++ b/uni/lib/view/course_unit_info/widgets/course_unit_sheet.dart @@ -65,7 +65,7 @@ class CourseUnitSheetView extends StatelessWidget { .toList(), ), ); - } catch (e) { + } catch (_) { return null; } } diff --git a/uni/lib/view/home/widgets/exam_card_shimmer.dart b/uni/lib/view/home/widgets/exam_card_shimmer.dart index 86ca3edc8..c1cf9d614 100644 --- a/uni/lib/view/home/widgets/exam_card_shimmer.dart +++ b/uni/lib/view/home/widgets/exam_card_shimmer.dart @@ -22,7 +22,7 @@ class ExamCardShimmer extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - //timestamp section + // timestamp section Container( height: 15, width: 40, @@ -44,12 +44,12 @@ class ExamCardShimmer extends StatelessWidget { height: 30, width: 100, color: Colors.black, - ), //UC section + ), // UC section Container( height: 40, width: 40, color: Colors.black, - ), //Calender add section + ), // Calender add section ], ), ), diff --git a/uni/lib/view/home/widgets/main_cards_list.dart b/uni/lib/view/home/widgets/main_cards_list.dart index 9950f1ccb..90084907a 100644 --- a/uni/lib/view/home/widgets/main_cards_list.dart +++ b/uni/lib/view/home/widgets/main_cards_list.dart @@ -108,7 +108,7 @@ class MainCardsListState extends State { ], ); }, - ), //Add FAB functionality here + ), // Add FAB functionality here tooltip: S.of(context).add_widget, child: Icon(Icons.add, color: Theme.of(context).colorScheme.onPrimary), ); diff --git a/uni/lib/view/home/widgets/schedule_card_shimmer.dart b/uni/lib/view/home/widgets/schedule_card_shimmer.dart index 32fdbb93d..3afddf229 100644 --- a/uni/lib/view/home/widgets/schedule_card_shimmer.dart +++ b/uni/lib/view/home/widgets/schedule_card_shimmer.dart @@ -19,7 +19,7 @@ class ScheduleCardShimmer extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - //timestamp section + // timestamp section Container( height: 15, width: 40, @@ -44,7 +44,7 @@ class ScheduleCardShimmer extends StatelessWidget { height: 25, width: 100, color: Colors.black, - ), //UC section + ), // UC section const SizedBox( height: 10, ), @@ -52,14 +52,14 @@ class ScheduleCardShimmer extends StatelessWidget { height: 15, width: 150, color: Colors.black, - ), //UC section + ), // UC section ], ), Container( height: 15, width: 40, color: Colors.black, - ), //Room section + ), // Room section ], ), ), @@ -76,7 +76,7 @@ class ScheduleCardShimmer extends StatelessWidget { height: 15, width: 80, color: Colors.black, - ), //Day of the week + ), // Day of the week const SizedBox( height: 10, ), diff --git a/uni/lib/view/lazy_consumer.dart b/uni/lib/view/lazy_consumer.dart index fa892c01c..ba0a910fe 100644 --- a/uni/lib/view/lazy_consumer.dart +++ b/uni/lib/view/lazy_consumer.dart @@ -42,7 +42,7 @@ class LazyConsumer, T2> StateProviderNotifier? provider; try { provider = Provider.of(context, listen: false); - } catch (e) { + } catch (_) { // The provider was not found. This should only happen in tests. Logger().e('LazyConsumer: ${T1.runtimeType} not found'); return; @@ -60,14 +60,14 @@ class LazyConsumer, T2> .ensureInitialized(context); }) : Future(() {}); - } catch (exception, stackTrace) { + } catch (err, st) { // In tests, it is ok to not find the startup providers: // all provider data should be mocked by the test itself. if (!Platform.environment.containsKey('FLUTTER_TEST')) { Logger().e( - 'Failed to initialize startup providers: $exception', + 'Failed to initialize startup providers: $err', ); - await Sentry.captureException(exception, stackTrace: stackTrace); + await Sentry.captureException(err, stackTrace: st); } } diff --git a/uni/lib/view/locations/widgets/marker_popup.dart b/uni/lib/view/locations/widgets/marker_popup.dart index 1c46a3fd9..afffaca98 100644 --- a/uni/lib/view/locations/widgets/marker_popup.dart +++ b/uni/lib/view/locations/widgets/marker_popup.dart @@ -56,7 +56,7 @@ class Floor extends StatelessWidget { Widget build(BuildContext context) { final fontColor = FacultyMap.getFontColor(context); - final floorString = 0 <= floor && floor <= 9 //To maintain layout of popup + final floorString = 0 <= floor && floor <= 9 // To maintain layout of popup ? ' $floor' : '$floor'; diff --git a/uni/lib/view/login/login.dart b/uni/lib/view/login/login.dart index 94067e1a0..68dd6a8bc 100644 --- a/uni/lib/view/login/login.dart +++ b/uni/lib/view/login/login.dart @@ -69,23 +69,23 @@ class LoginPageViewState extends State { _loggingIn = false; }); } - } catch (error, stackTrace) { + } catch (err, st) { setState(() { _loggingIn = false; }); - if (error is ExpiredCredentialsException) { + if (err is ExpiredCredentialsException) { updatePasswordDialog(); - } else if (error is InternetStatusException) { + } else if (err is InternetStatusException) { if (context.mounted) { - unawaited(ToastMessage.warning(context, error.message)); + unawaited(ToastMessage.warning(context, err.message)); } - } else if (error is WrongCredentialsException) { + } else if (err is WrongCredentialsException) { if (context.mounted) { - unawaited(ToastMessage.error(context, error.message)); + unawaited(ToastMessage.error(context, err.message)); } } else { - Logger().e(error, stackTrace: stackTrace); - unawaited(Sentry.captureException(error, stackTrace: stackTrace)); + Logger().e(err, stackTrace: st); + unawaited(Sentry.captureException(err, stackTrace: st)); if (context.mounted) { unawaited(ToastMessage.error(context, S.of(context).failed_login)); } @@ -242,7 +242,7 @@ class LoginPageViewState extends State { ); } - ///Creates the widget for when the user forgets the password + /// Creates the widget for when the user forgets the password Widget createForgetPasswordLink(BuildContext context) { return InkWell( child: Center( diff --git a/uni/pubspec.lock b/uni/pubspec.lock index f3eb88b52..933edb2f1 100644 --- a/uni/pubspec.lock +++ b/uni/pubspec.lock @@ -306,7 +306,7 @@ packages: source: hosted version: "2.1.11" custom_lint: - dependency: transitive + dependency: "direct dev" description: name: custom_lint sha256: "7c0aec12df22f9082146c354692056677f1e70bc43471644d1fdb36c6fdda799" diff --git a/uni/pubspec.yaml b/uni/pubspec.yaml index 8c4ecc302..ebc1fc5dd 100644 --- a/uni/pubspec.yaml +++ b/uni/pubspec.yaml @@ -66,6 +66,7 @@ dependencies: dev_dependencies: build_runner: ^2.4.8 + custom_lint: ^0.6.4 flutter_launcher_icons: ^0.13.1 flutter_test: sdk: flutter From af1ac2fd20b4883bb0a38c5fd5371440c2145511 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sun, 31 Mar 2024 01:34:08 +0100 Subject: [PATCH 2/9] run custom_lint in CI --- .github/workflows/format_lint_test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/format_lint_test.yaml b/.github/workflows/format_lint_test.yaml index cd29d4602..8d55c426d 100644 --- a/.github/workflows/format_lint_test.yaml +++ b/.github/workflows/format_lint_test.yaml @@ -61,7 +61,11 @@ jobs: flutter-version: ${{ steps.get_flutter_version.outputs.result }} cache: true - - run: flutter analyze . + - run: flutter pub get + + - run: | + flutter analyze . + dart run custom_lint test: name: Test From aa4128747ae852f2ad15916887ee521133bf31a9 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 1 Apr 2024 04:33:26 +0200 Subject: [PATCH 3/9] trigger ci From a14aa0c1de5d05d000cc3cc467b07d59fd22cea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Mon, 1 Apr 2024 23:27:53 +0100 Subject: [PATCH 4/9] hotfix: make week handle timezone changes --- uni/lib/model/utils/time/week.dart | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/uni/lib/model/utils/time/week.dart b/uni/lib/model/utils/time/week.dart index 02f8efe26..5af8f83d2 100644 --- a/uni/lib/model/utils/time/week.dart +++ b/uni/lib/model/utils/time/week.dart @@ -1,3 +1,13 @@ +extension _ExactAddition on DateTime { + DateTime addExact(Duration duration) { + return copyWith(isUtc: true).add(duration).copyWith(isUtc: isUtc); + } + + DateTime subtractExact(Duration duration) { + return copyWith(isUtc: true).subtract(duration).copyWith(isUtc: isUtc); + } +} + /// A [Week] represents a period of 7 days. class Week implements Comparable { /// Creates a [Week] that starts the given [start] **date** (not datetime). @@ -12,7 +22,7 @@ class Week implements Comparable { microsecond: 0, ); - final end = startAtMidnight.add(const Duration(days: 7)); + final end = startAtMidnight.addExact(const Duration(days: 7)); return Week._internal(startAtMidnight, end); } @@ -32,20 +42,20 @@ class Week implements Comparable { /// Returns the [Week] that starts at the end of this [Week]. Week next() { - return Week._internal(end, end.add(const Duration(days: 7))); + return Week._internal(end, end.addExact(const Duration(days: 7))); } /// Returns the [Week] that ends at the start of this [Week]. Week previous() { - return Week._internal(start.subtract(const Duration(days: 7)), start); + return Week._internal(start.subtractExact(const Duration(days: 7)), start); } /// Returns the [Week] that is [duration] before this week. Week subtract(Duration duration) { final normalizedDuration = Duration(days: duration.inDays); return Week._internal( - start.subtract(normalizedDuration), - end.subtract(normalizedDuration), + start.subtractExact(normalizedDuration), + end.subtractExact(normalizedDuration), ); } @@ -53,8 +63,8 @@ class Week implements Comparable { Week add(Duration duration) { final normalizedDuration = Duration(days: duration.inDays); return Week._internal( - start.add(normalizedDuration), - end.add(normalizedDuration), + start.addExact(normalizedDuration), + end.addExact(normalizedDuration), ); } @@ -69,8 +79,8 @@ class Week implements Comparable { final offsetInDays = (weekday - start.weekday) % 7; return Week._internal( - start.add(Duration(days: offsetInDays)), - end.add(Duration(days: offsetInDays)), + start.addExact(Duration(days: offsetInDays)), + end.addExact(Duration(days: offsetInDays)), ); } @@ -84,8 +94,8 @@ class Week implements Comparable { final offsetInDays = (end.weekday - weekday) % 7; return Week._internal( - start.subtract(Duration(days: offsetInDays)), - end.subtract(Duration(days: offsetInDays)), + start.subtractExact(Duration(days: offsetInDays)), + end.subtractExact(Duration(days: offsetInDays)), ); } @@ -93,7 +103,7 @@ class Week implements Comparable { /// /// The values for [weekday] are according to [DateTime.weekday]. DateTime getWeekday(int weekday) { - return start.add(Duration(days: (weekday - start.weekday) % 7)); + return start.addExact(Duration(days: (weekday - start.weekday) % 7)); } Iterable get weekdays { From 66e9b8138d4cdfc4a3f907f611300283bb6fb9e7 Mon Sep 17 00:00:00 2001 From: limwa Date: Mon, 1 Apr 2024 22:59:03 +0000 Subject: [PATCH 5/9] Bump app version [no ci] --- uni/app_version.txt | 2 +- uni/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uni/app_version.txt b/uni/app_version.txt index fea29252c..e735e95b1 100644 --- a/uni/app_version.txt +++ b/uni/app_version.txt @@ -1 +1 @@ -1.8.8+270 +1.8.9+276 diff --git a/uni/pubspec.yaml b/uni/pubspec.yaml index b1b425b6c..8c8ac5a04 100644 --- a/uni/pubspec.yaml +++ b/uni/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev # To change it manually, override the value in app_version.txt. # The app version code is automatically also bumped by CI. # Do not change it manually. -version: 1.8.8+270 +version: 1.8.9+276 environment: From 300cfefbaa72f3eed46dbb1d322b7e03886a51a4 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 10 Apr 2024 16:13:49 +0100 Subject: [PATCH 6/9] remove unnecessary `Row`s, `Column`s, and `Flex`es --- .../widgets/course_units_card.dart | 10 ++-- .../bus_stop_next_arrivals.dart | 46 ++++++++----------- .../common_widgets/last_update_timestamp.dart | 11 ++--- .../pages_layouts/general/general.dart | 13 ++---- uni/lib/view/exams/widgets/exam_time.dart | 7 +-- .../faculty/widgets/other_links_card.dart | 12 ++--- .../view/home/widgets/exam_card_shimmer.dart | 35 ++++++-------- .../view/home/widgets/restaurant_card.dart | 13 ++---- uni/lib/view/home/widgets/restaurant_row.dart | 13 ++---- .../home/widgets/schedule_card_shimmer.dart | 35 ++++++-------- .../widgets/floorless_marker_popup.dart | 26 ++++------- .../view/locations/widgets/marker_popup.dart | 32 +++++-------- uni/lib/view/login/login.dart | 17 +++---- .../profile/widgets/account_info_card.dart | 14 ++---- .../view/restaurant/restaurant_page_view.dart | 7 +-- .../view/schedule/widgets/schedule_slot.dart | 27 +++++------ .../widgets/notifications_dialog.dart | 11 ++--- 17 files changed, 117 insertions(+), 212 deletions(-) diff --git a/uni/lib/view/academic_path/widgets/course_units_card.dart b/uni/lib/view/academic_path/widgets/course_units_card.dart index 03ed19899..687e8ee08 100644 --- a/uni/lib/view/academic_path/widgets/course_units_card.dart +++ b/uni/lib/view/academic_path/widgets/course_units_card.dart @@ -58,13 +58,9 @@ class CourseUnitsCard extends GenericCard { return Column( children: courseUnits .map( - (courseUnit) => Column( - children: [ - Padding( - padding: const EdgeInsets.all(5), - child: CourseUnitCard(courseUnit), - ), - ], + (courseUnit) => Padding( + padding: const EdgeInsets.all(5), + child: CourseUnitCard(courseUnit), ), ) .toList(), diff --git a/uni/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart b/uni/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart index 1c32963da..85705edac 100644 --- a/uni/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart +++ b/uni/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart @@ -63,18 +63,14 @@ class BusStopNextArrivalsPageState color: Theme.of(context).colorScheme.primary, ), ), - Column( - children: [ - ElevatedButton( - onPressed: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const BusStopSelectionPage(), - ), - ), - child: Text(S.of(context).add), + ElevatedButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const BusStopSelectionPage(), ), - ], + ), + child: Text(S.of(context).add), ), ], ), @@ -175,22 +171,18 @@ class NextArrivalsState extends State { widget.buses.forEach((stopCode, stopData) { rows.add( - Column( - children: [ - Container( - padding: const EdgeInsets.only( - top: 8, - bottom: 8, - left: 22, - right: 22, - ), - child: BusStopRow( - stopCode: stopCode, - trips: widget.buses[stopCode]?.trips ?? [], - stopCodeShow: false, - ), - ), - ], + Container( + padding: const EdgeInsets.only( + top: 8, + bottom: 8, + left: 22, + right: 22, + ), + child: BusStopRow( + stopCode: stopCode, + trips: widget.buses[stopCode]?.trips ?? [], + stopCodeShow: false, + ), ), ); }); diff --git a/uni/lib/view/common_widgets/last_update_timestamp.dart b/uni/lib/view/common_widgets/last_update_timestamp.dart index 3912aec73..403fb1e19 100644 --- a/uni/lib/view/common_widgets/last_update_timestamp.dart +++ b/uni/lib/view/common_widgets/last_update_timestamp.dart @@ -39,6 +39,7 @@ class _LastUpdateTimeStampState> return Consumer( builder: (context, provider, _) => Container( padding: const EdgeInsets.only(top: 8, bottom: 10), + alignment: Alignment.centerLeft, child: provider.lastUpdateTime != null ? _getContent(context, provider.lastUpdateTime!) : null, @@ -53,13 +54,9 @@ class _LastUpdateTimeStampState> elapsedTimeMinutes = 0; } - return Row( - children: [ - Text( - S.of(context).last_timestamp(elapsedTimeMinutes), - style: Theme.of(context).textTheme.titleSmall, - ), - ], + return Text( + S.of(context).last_timestamp(elapsedTimeMinutes), + style: Theme.of(context).textTheme.titleSmall, ); } } diff --git a/uni/lib/view/common_widgets/pages_layouts/general/general.dart b/uni/lib/view/common_widgets/pages_layouts/general/general.dart index ea9424c0b..b63c4f3e0 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/general.dart @@ -79,15 +79,10 @@ abstract class GeneralPageViewState extends State { return getScaffold( context, _loading - ? const Flex( - direction: Axis.vertical, - children: [ - Expanded( - child: Center( - child: CircularProgressIndicator(), - ), - ), - ], + ? const Expanded( + child: Center( + child: CircularProgressIndicator(), + ), ) : getBody(context), ); diff --git a/uni/lib/view/exams/widgets/exam_time.dart b/uni/lib/view/exams/widgets/exam_time.dart index de8705099..dbe4d10f0 100644 --- a/uni/lib/view/exams/widgets/exam_time.dart +++ b/uni/lib/view/exams/widgets/exam_time.dart @@ -6,11 +6,6 @@ class ExamTime extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text(begin, style: Theme.of(context).textTheme.bodyMedium), - ], - ); + return Text(begin, style: Theme.of(context).textTheme.bodyMedium); } } diff --git a/uni/lib/view/faculty/widgets/other_links_card.dart b/uni/lib/view/faculty/widgets/other_links_card.dart index d4960e737..75a3f6f28 100644 --- a/uni/lib/view/faculty/widgets/other_links_card.dart +++ b/uni/lib/view/faculty/widgets/other_links_card.dart @@ -10,15 +10,9 @@ class OtherLinksCard extends GenericExpansionCard { @override Widget buildCardContent(BuildContext context) { - return const Column( - children: [ - // LinkButton(title: S.of(context).print, link: 'https://print.up.pt'), - // TODO(Process-ing): Get fixed link - LinkButton( - title: 'Consultas SASUP', - link: 'https://www.up.pt/portal/pt/sasup/saude/marcar-consulta/', - ), - ], + return const LinkButton( + title: 'Consultas SASUP', + link: 'https://www.up.pt/portal/pt/sasup/saude/marcar-consulta/', ); } diff --git a/uni/lib/view/home/widgets/exam_card_shimmer.dart b/uni/lib/view/home/widgets/exam_card_shimmer.dart index c1cf9d614..837ffe4ca 100644 --- a/uni/lib/view/home/widgets/exam_card_shimmer.dart +++ b/uni/lib/view/home/widgets/exam_card_shimmer.dart @@ -17,26 +17,21 @@ class ExamCardShimmer extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - // timestamp section - Container( - height: 15, - width: 40, - color: Colors.black, - ), - const SizedBox( - height: 2.5, - ), - Container( - height: 15, - width: 40, - color: Colors.black, - ), - ], + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + // timestamp section + Container( + height: 15, + width: 40, + color: Colors.black, + ), + const SizedBox( + height: 2.5, + ), + Container( + height: 15, + width: 40, + color: Colors.black, ), ], ), diff --git a/uni/lib/view/home/widgets/restaurant_card.dart b/uni/lib/view/home/widgets/restaurant_card.dart index 76a116851..65007f82d 100644 --- a/uni/lib/view/home/widgets/restaurant_card.dart +++ b/uni/lib/view/home/widgets/restaurant_card.dart @@ -102,15 +102,10 @@ class RestaurantCard extends GenericCard { physics: const NeverScrollableScrollPhysics(), itemCount: restaurants.length, itemBuilder: (context, index) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - createRowFromRestaurant( - context, - restaurants[index], - DayOfWeek.values[offset], - ), - ], + return createRowFromRestaurant( + context, + restaurants[index], + DayOfWeek.values[offset], ); }, ); diff --git a/uni/lib/view/home/widgets/restaurant_row.dart b/uni/lib/view/home/widgets/restaurant_row.dart index df670e0ae..49735a185 100644 --- a/uni/lib/view/home/widgets/restaurant_row.dart +++ b/uni/lib/view/home/widgets/restaurant_row.dart @@ -23,15 +23,10 @@ class RestaurantRow extends StatelessWidget { return Container( padding: const EdgeInsets.only(left: 12, bottom: 8, right: 12), margin: const EdgeInsets.only(top: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - children: getMenuRows(context), - ), - ), - ], + child: Expanded( + child: Column( + children: getMenuRows(context), + ), ), ); } diff --git a/uni/lib/view/home/widgets/schedule_card_shimmer.dart b/uni/lib/view/home/widgets/schedule_card_shimmer.dart index 3afddf229..91728fd9d 100644 --- a/uni/lib/view/home/widgets/schedule_card_shimmer.dart +++ b/uni/lib/view/home/widgets/schedule_card_shimmer.dart @@ -14,26 +14,21 @@ class ScheduleCardShimmer extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - // timestamp section - Container( - height: 15, - width: 40, - color: Colors.black, - ), - const SizedBox( - height: 2.5, - ), - Container( - height: 15, - width: 40, - color: Colors.black, - ), - ], + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + // timestamp section + Container( + height: 15, + width: 40, + color: Colors.black, + ), + const SizedBox( + height: 2.5, + ), + Container( + height: 15, + width: 40, + color: Colors.black, ), ], ), diff --git a/uni/lib/view/locations/widgets/floorless_marker_popup.dart b/uni/lib/view/locations/widgets/floorless_marker_popup.dart index 60b7b5574..f165c5808 100644 --- a/uni/lib/view/locations/widgets/floorless_marker_popup.dart +++ b/uni/lib/view/locations/widgets/floorless_marker_popup.dart @@ -40,15 +40,10 @@ class FloorlessLocationMarkerPopup extends StatelessWidget { List buildLocations(BuildContext context, List locations) { return locations .map( - (location) => Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - location.description(), - textAlign: TextAlign.left, - style: TextStyle(color: FacultyMap.getFontColor(context)), - ), - ], + (location) => Text( + location.description(), + textAlign: TextAlign.left, + style: TextStyle(color: FacultyMap.getFontColor(context)), ), ) .toList(); @@ -61,15 +56,10 @@ class LocationRow extends StatelessWidget { @override Widget build(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - location.description(), - textAlign: TextAlign.left, - style: TextStyle(color: FacultyMap.getFontColor(context)), - ), - ], + return Text( + location.description(), + textAlign: TextAlign.left, + style: TextStyle(color: FacultyMap.getFontColor(context)), ); } } diff --git a/uni/lib/view/locations/widgets/marker_popup.dart b/uni/lib/view/locations/widgets/marker_popup.dart index afffaca98..04391c939 100644 --- a/uni/lib/view/locations/widgets/marker_popup.dart +++ b/uni/lib/view/locations/widgets/marker_popup.dart @@ -62,17 +62,12 @@ class Floor extends StatelessWidget { return Row( children: [ - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Text( - '${S.of(context).floor} $floorString', - style: TextStyle(color: fontColor), - ), - ), - ], + Container( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), + child: Text( + '${S.of(context).floor} $floorString', + style: TextStyle(color: fontColor), + ), ), Container( padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), @@ -102,16 +97,11 @@ class LocationRow extends StatelessWidget { @override Widget build(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - location.description(), - textAlign: TextAlign.left, - overflow: TextOverflow.ellipsis, - style: TextStyle(color: color), - ), - ], + return Text( + location.description(), + textAlign: TextAlign.left, + overflow: TextOverflow.ellipsis, + style: TextStyle(color: color), ); } } diff --git a/uni/lib/view/login/login.dart b/uni/lib/view/login/login.dart index 68dd6a8bc..ec07b5dc9 100644 --- a/uni/lib/view/login/login.dart +++ b/uni/lib/view/login/login.dart @@ -186,17 +186,12 @@ class LoginPageViewState extends State { minWidth: queryData.size.width / 8, minHeight: queryData.size.height / 6, ), - child: Column( - children: [ - SizedBox( - width: 100, - child: SvgPicture.asset( - 'assets/images/logo_dark.svg', - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), - ), - ), - ], + child: SizedBox( + width: 100, + child: SvgPicture.asset( + 'assets/images/logo_dark.svg', + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), ), ); } diff --git a/uni/lib/view/profile/widgets/account_info_card.dart b/uni/lib/view/profile/widgets/account_info_card.dart index 3d0274309..b6b4ebda7 100644 --- a/uni/lib/view/profile/widgets/account_info_card.dart +++ b/uni/lib/view/profile/widgets/account_info_card.dart @@ -102,15 +102,11 @@ class AccountInfoCard extends GenericCard { right: 15, left: 15, ), - child: Row( - children: [ - Text( - S.of(context).pendent_references, - style: Theme.of(context).textTheme.titleLarge?.apply( - color: Theme.of(context).colorScheme.secondary, - ), - ), - ], + child: Text( + S.of(context).pendent_references, + style: Theme.of(context).textTheme.titleLarge?.apply( + color: Theme.of(context).colorScheme.secondary, + ), ), ), ReferenceList(references: references), diff --git a/uni/lib/view/restaurant/restaurant_page_view.dart b/uni/lib/view/restaurant/restaurant_page_view.dart index c55b53cb8..2d36b4e20 100644 --- a/uni/lib/view/restaurant/restaurant_page_view.dart +++ b/uni/lib/view/restaurant/restaurant_page_view.dart @@ -137,12 +137,7 @@ class _RestaurantPageViewState extends GeneralPageViewState return Container( margin: const EdgeInsets.only(bottom: 5), key: Key('restaurant-page-day-column-$day'), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Center(child: Text(S.of(context).no_menu_info)), - ], - ), + child: Center(child: Text(S.of(context).no_menu_info)), ); } else { return Container( diff --git a/uni/lib/view/schedule/widgets/schedule_slot.dart b/uni/lib/view/schedule/widgets/schedule_slot.dart index 48c55dcec..f5238c7a1 100644 --- a/uni/lib/view/schedule/widgets/schedule_slot.dart +++ b/uni/lib/view/schedule/widgets/schedule_slot.dart @@ -133,22 +133,17 @@ class SubjectButtonWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - constraints: const BoxConstraints( - minHeight: kMinInteractiveDimension / 3, - minWidth: kMinInteractiveDimension / 3, - ), - icon: const Icon(Icons.open_in_browser), - iconSize: 18, - color: Colors.grey, - alignment: Alignment.centerRight, - tooltip: S.of(context).uc_info, - onPressed: () => _launchUcPage(context), - ), - ], + return IconButton( + constraints: const BoxConstraints( + minHeight: kMinInteractiveDimension / 3, + minWidth: kMinInteractiveDimension / 3, + ), + icon: const Icon(Icons.open_in_browser), + iconSize: 18, + color: Colors.grey, + alignment: Alignment.centerRight, + tooltip: S.of(context).uc_info, + onPressed: () => _launchUcPage(context), ); } } diff --git a/uni/lib/view/settings/widgets/notifications_dialog.dart b/uni/lib/view/settings/widgets/notifications_dialog.dart index 4defadfc2..d71385718 100644 --- a/uni/lib/view/settings/widgets/notifications_dialog.dart +++ b/uni/lib/view/settings/widgets/notifications_dialog.dart @@ -9,14 +9,9 @@ class NotificationsDialog extends StatelessWidget { Widget build(BuildContext context) { return AlertDialog( title: Text(S.of(context).notifications), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - title: Text(S.of(context).fee_notification), - trailing: const TuitionNotificationSwitch(), - ), - ], + content: ListTile( + title: Text(S.of(context).fee_notification), + trailing: const TuitionNotificationSwitch(), ), ); } From 3d6e6a0cffaa5a5b9ee1e3ad649d72b4e1d564a2 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 10 Apr 2024 16:23:31 +0100 Subject: [PATCH 7/9] fix failing tests --- .../view/common_widgets/pages_layouts/general/general.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/uni/lib/view/common_widgets/pages_layouts/general/general.dart b/uni/lib/view/common_widgets/pages_layouts/general/general.dart index b63c4f3e0..64f54de94 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/general.dart @@ -79,11 +79,7 @@ abstract class GeneralPageViewState extends State { return getScaffold( context, _loading - ? const Expanded( - child: Center( - child: CircularProgressIndicator(), - ), - ) + ? const Center(child: CircularProgressIndicator()) : getBody(context), ); } From 8565abdc57b6c710cd0e645d244b5a1e4233f3a2 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 10 Apr 2024 16:24:00 +0100 Subject: [PATCH 8/9] bump gh actions --- .github/workflows/deploy.yaml | 2 +- .github/workflows/format_lint_test.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 5ba3e47bf..1f3ebf523 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -101,7 +101,7 @@ jobs: with: commit_message: "Bump app version [no ci]" - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: ${{env.JAVA_VERSION}} distribution: "zulu" diff --git a/.github/workflows/format_lint_test.yaml b/.github/workflows/format_lint_test.yaml index 7a1c004e2..cad1a0329 100644 --- a/.github/workflows/format_lint_test.yaml +++ b/.github/workflows/format_lint_test.yaml @@ -37,7 +37,7 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: ${{ env.JAVA_VERSION }} distribution: zulu @@ -64,7 +64,7 @@ jobs: working-directory: ./uni steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: ${{ env.JAVA_VERSION }} distribution: zulu From d13babcd8e5d5ae003f04265d1da3a81c966e21a Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 16 Apr 2024 12:06:06 +0100 Subject: [PATCH 9/9] re-add accidentally removed TODO --- uni/lib/view/faculty/widgets/other_links_card.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uni/lib/view/faculty/widgets/other_links_card.dart b/uni/lib/view/faculty/widgets/other_links_card.dart index 75a3f6f28..99070640c 100644 --- a/uni/lib/view/faculty/widgets/other_links_card.dart +++ b/uni/lib/view/faculty/widgets/other_links_card.dart @@ -10,6 +10,9 @@ class OtherLinksCard extends GenericExpansionCard { @override Widget buildCardContent(BuildContext context) { + // TODO(Process-ing): Get fixed link + // LinkButton(title: S.of(context).print, link: 'https://print.up.pt'), + return const LinkButton( title: 'Consultas SASUP', link: 'https://www.up.pt/portal/pt/sasup/saude/marcar-consulta/',