Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v1.9.7 #1410

Merged
merged 155 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
b718ebb
Exam Card
thePeras Aug 7, 2024
8a9b185
Merge branch 'develop' into ui/exam_card
thePeras Aug 21, 2024
2398926
Services Card
thePeras Aug 8, 2024
4e87d81
feat: initial implementation of timeline
vitormpp Aug 21, 2024
102de06
feat: scrollable app bar
vitormpp Aug 28, 2024
18420c2
fix: add range constraint to tab bar scrolling
vitormpp Aug 29, 2024
617d35b
Merge branch 'develop' into feature/timeline
vitormpp Aug 29, 2024
021edc8
Course Grade Card
rubuy-74 Sep 26, 2024
17db031
Merge branch 'develop' into ui/exam_card
thePeras Oct 2, 2024
4f5896b
Merge branch 'develop' into ui/service_card
thePeras Oct 2, 2024
a0cd2a6
add Flexible
thePeras Oct 2, 2024
4f758e6
map iterate
thePeras Oct 2, 2024
504d904
Merge branch 'develop' into feature/timeline
thePeras Oct 2, 2024
55646b0
Merge branch 'develop' into feature/course_grade_card
thePeras Oct 2, 2024
490b8f7
Create bottom navbar
Process-ing Aug 27, 2024
65f3d4a
Create bottom navbar gradients
Process-ing Aug 27, 2024
f857152
Change bottom navbar icons
Process-ing Aug 27, 2024
2cfca6e
Create BottomNavbarItem
Process-ing Aug 27, 2024
e259e85
Change icon background when selected
Process-ing Aug 27, 2024
29b438f
Remove default splash effect
Process-ing Aug 27, 2024
094ba29
Implement bottom navbar interactions
Process-ing Aug 27, 2024
a9bf287
Create list of default navbar icons
Process-ing Aug 27, 2024
570e8b3
Fix formatting
Process-ing Aug 27, 2024
759e1a7
Refactor squircle drawing
Process-ing Aug 27, 2024
a7804d9
Fix gradient bounds
Process-ing Aug 27, 2024
06c717e
Apply slight shadow to navbar
Process-ing Aug 27, 2024
0f0901e
Add splash effect
Process-ing Aug 28, 2024
57e343e
Improve navbar gradient
Process-ing Aug 28, 2024
43aa050
Fix formatting
Process-ing Aug 28, 2024
18c3139
Fix gradients (again)
Process-ing Aug 28, 2024
8c6e3cc
Change icon name
Process-ing Sep 11, 2024
7b87a4e
update lock
vitormpp Oct 2, 2024
699b542
Bump app version [no ci]
niaefeup-admin Oct 11, 2024
b03d44d
Changed LibraryOccupation to sort floors by number when adding a new …
Adriano-7 Oct 12, 2024
8a11a69
Remove copyWith from Course Grade Card
rubuy-74 Oct 14, 2024
e5a2129
Merge branch 'feature/course_grade_card' of github.com:NIAEFEUP/uni i…
rubuy-74 Oct 14, 2024
19ae1b7
fixing casts
DGoiana Oct 14, 2024
f6ac525
Merge branch 'develop' into feature/course_grade_card
DGoiana Oct 15, 2024
174018c
Fixing JSON casts (#1357)
thePeras Oct 15, 2024
5874c6f
Bump app version [no ci]
thePeras Oct 15, 2024
1440ac1
feat:Course Grade Card (#1338)
thePeras Oct 15, 2024
00dabc7
Bump app version [no ci]
thePeras Oct 15, 2024
705e735
Merge branch 'develop' into feature/new-bottom-navbar
DGoiana Oct 15, 2024
c049396
fix: logout when OpenID service is unavailable
limwa Oct 15, 2024
26d02b4
Merge branch 'develop' into fix/automatic-logout-on-openid-failure
DGoiana Oct 15, 2024
e7e3f55
Bump app version [no ci]
niaefeup-admin Oct 16, 2024
5b05a53
Merge branch 'develop' into fix/library-floors-order
Adriano-7 Oct 16, 2024
4d8b270
Switch to SplayTreeSet for automatic floor ordering
Adriano-7 Oct 16, 2024
0e69c84
modifying ensureInitialized
DGoiana Oct 16, 2024
b0f5f01
Merge branch 'develop' into ui/exam_card
DGoiana Oct 16, 2024
77dca69
Merge branch 'develop' into feature/timeline
DGoiana Oct 16, 2024
7ca8cab
Timeline (#1302)
DGoiana Oct 16, 2024
b6a2e08
Merge branch 'develop' into feature/new-bottom-navbar
DGoiana Oct 16, 2024
543d0fc
Bump app version [no ci]
DGoiana Oct 16, 2024
4be63c1
Merge branch 'develop' into fix/exams-load
DGoiana Oct 17, 2024
c721483
Merge branch 'develop' into feature/new-bottom-navbar
DGoiana Oct 18, 2024
b6a9273
Fixing session and profile dependent providers initialization (#1365)
limwa Oct 19, 2024
68d0862
Bump app version [no ci]
limwa Oct 19, 2024
750ff30
New bottom navbar (#1306)
Process-ing Oct 19, 2024
eea2696
Bump app version [no ci]
Process-ing Oct 19, 2024
3ce3cca
Revert "Switch to SplayTreeSet for automatic floor ordering"
Adriano-7 Oct 22, 2024
b6dc638
Merge branch 'develop' into fix/library-floors-order
Adriano-7 Oct 22, 2024
fe56182
Moved floor sorting to occur after all floors are added in LibraryOcc…
Adriano-7 Oct 22, 2024
2a4a013
Applied Dart formatting
Adriano-7 Oct 22, 2024
3873f5b
Update .gitignore
pratyush-1327 Oct 22, 2024
57e3f3e
Merge branch 'develop' into ui/service_card
thePeras Oct 22, 2024
a0ceb98
Services Card (#1299)
thePeras Oct 23, 2024
28f57f6
Bump app version [no ci]
thePeras Oct 23, 2024
e9354de
Merge branch 'develop' into patch-1
pratyush-1327 Oct 23, 2024
ae6539a
Update .gitignore (#1368)
DGoiana Oct 24, 2024
6c6e66d
Bump app version [no ci]
DGoiana Oct 24, 2024
6c5c83f
Merge branch 'develop' into fix/library-floors-order
DGoiana Oct 24, 2024
a4418c8
fix: app not closing on the exit dialog
peucastro Oct 24, 2024
4e70e39
Merge remote-tracking branch 'origin/develop' into fix/exit_dialog
peucastro Oct 24, 2024
2ff5924
formatting
peucastro Oct 24, 2024
a75b100
fix: Ensure ordering of library floors (#1355)
thePeras Oct 25, 2024
d5638da
Bump app version [no ci]
thePeras Oct 25, 2024
c6b1c84
Changed LibraryOccupation to sort floors by number when adding a new …
Adriano-7 Oct 12, 2024
360472e
Switch to SplayTreeSet for automatic floor ordering
Adriano-7 Oct 16, 2024
7127f7d
Revert "Switch to SplayTreeSet for automatic floor ordering"
Adriano-7 Oct 22, 2024
2a263f9
Moved floor sorting to occur after all floors are added in LibraryOcc…
Adriano-7 Oct 22, 2024
25ea9ef
Applied Dart formatting
Adriano-7 Oct 22, 2024
d76e43c
Bump app version [no ci]
thePeras Oct 25, 2024
f92ae09
SystemNavigator.pop() async
peucastro Oct 27, 2024
930e0d7
Merge branch 'develop' into fix/exit_dialog
limwa Oct 28, 2024
4259069
fix: app not closing on the exit dialog (#1369)
DGoiana Oct 28, 2024
0a8755d
Bump app version [no ci]
DGoiana Oct 28, 2024
871b0ad
feat: added mapper function to LazyConsumer
HenriqueSFernandes Oct 31, 2024
1c1c5e3
fix(schedule_card): filter past lectures in mapper
HenriqueSFernandes Oct 31, 2024
35d6329
fix(schedule_card): Changed date compareTo to isAfter and removed dup…
HenriqueSFernandes Oct 31, 2024
df13b77
fix(lazy_consumer): updated mapper type to handle dynamic values
HenriqueSFernandes Oct 31, 2024
08f43e5
fix(schedule_card): removed useless weekday check in lecture filtering
HenriqueSFernandes Oct 31, 2024
044f823
fix(lazy_consumer): reverted mapper function type
HenriqueSFernandes Oct 31, 2024
905fcd7
feat: added mapper function to LazyConsumer (#1374)
HenriqueSFernandes Oct 31, 2024
7e98d31
Bump app version [no ci]
HenriqueSFernandes Oct 31, 2024
7e0a60d
Merge branch 'develop' into ui/exam_card
thePeras Nov 2, 2024
63b0ff7
Exam card rooms fade
thePeras Nov 2, 2024
e9dc3d7
Exam Card (#1295)
thePeras Nov 2, 2024
78eda12
Bump app version [no ci]
thePeras Nov 2, 2024
249fc86
fixed path to MVC.png
simaopsbarbosa Nov 2, 2024
8ac9955
fixed path to MVC.png (#1378)
simaopsbarbosa Nov 3, 2024
d8a057e
Bump app version [no ci]
simaopsbarbosa Nov 3, 2024
4460dfc
fix: Added Controllers Dispose methods
Pinho13 Nov 5, 2024
9b5ada7
added internetError exception and failure reason
peucastro Nov 6, 2024
65782a4
completed the credential request failure handling
peucastro Nov 6, 2024
cbc5840
removed previous login failure exceptions
peucastro Nov 6, 2024
df48c3c
removed update password dialog
peucastro Nov 6, 2024
bc5ba1c
handled login exceptions with AuthenticationException
peucastro Nov 9, 2024
1da2fbf
fix: sentry auth exception (#1387)
thePeras Nov 11, 2024
e30a31c
Bump app version [no ci]
thePeras Nov 11, 2024
df701d8
fix: Double super.initState and Disposed Timer
Pinho13 Nov 12, 2024
a816818
Merge branch 'develop' into fix/Controller-Dispose-method
Pinho13 Nov 12, 2024
8005aa5
Changed tuples to records - unfinished
jcovaa Nov 19, 2024
bf7c438
correct version of the Future method
jcovaa Nov 19, 2024
0a7881e
Merge branch 'develop' into refactor/change-tuples-to-records
thePeras Nov 19, 2024
4be6dd4
Formatted files
jcovaa Nov 22, 2024
55523b2
Merge branch 'refactor/change-tuples-to-records' of github.com:NIAEFE…
jcovaa Nov 22, 2024
15cb14b
Finish Transitions
Belem17 Nov 25, 2024
fa0c047
Finish Transitions
Belem17 Nov 25, 2024
87c6cc3
Disposed Controllers in some common Widgets
Pinho13 Nov 26, 2024
0f9ce28
fix:Format
Pinho13 Nov 26, 2024
8e24cba
fix: Format x2
Pinho13 Nov 26, 2024
118c470
corrected
Belem17 Nov 26, 2024
7f2dc1b
Changed build.gradle to add the new suffix. Changed AndroidManifest.x…
pedroafmonteiro Nov 26, 2024
9e5a1d9
Merge branch 'develop' into fix/automatic-logout-on-openid-failure
limwa Nov 27, 2024
0ac33ad
Changed applicationIdSuffix to ".dev"
pedroafmonteiro Nov 27, 2024
8c5e78a
Changed debug app name to "uni (dev)"
pedroafmonteiro Nov 27, 2024
fc5a786
Diferentiate the release and debug versions of uni. (#1399)
pedroafmonteiro Nov 27, 2024
d785c54
Bump app version [no ci]
pedroafmonteiro Nov 27, 2024
ba4d3fb
Finish Transitions (#1397)
DGoiana Nov 27, 2024
37405ed
Bump app version [no ci]
DGoiana Nov 27, 2024
6c63ef0
Merge branch 'develop' into fix/automatic-logout-on-openid-failure
limwa Nov 28, 2024
a306e1c
fix: logout when OpenID service is unavailable (#1361)
DGoiana Nov 28, 2024
2d7697d
Bump app version [no ci]
DGoiana Nov 28, 2024
e904194
Merge branch 'develop' into fix/Controller-Dispose-method
DGoiana Nov 29, 2024
b330fc3
Merge branch 'develop' into refactor/change-tuples-to-records
DGoiana Nov 29, 2024
cb285d9
fix: Added Controllers Dispose methods (#1383)
DGoiana Nov 29, 2024
a7c88b7
Bump app version [no ci]
DGoiana Nov 29, 2024
9106510
refactor: use inheritance for endpoints
limwa Oct 15, 2024
06a30a2
fix: make login endpoint extend endpoint
limwa Nov 30, 2024
7295342
chore: add nix flake
limwa Nov 30, 2024
fba44f2
fix: app halting after installation
limwa Nov 30, 2024
6fd0a35
fix: disallow backups
limwa Nov 30, 2024
ae6f244
refactor: use inheritance for endpoints (#1362)
DGoiana Dec 3, 2024
3a5e2c8
Bump app version [no ci]
DGoiana Dec 3, 2024
c9cc95b
Merge branch 'develop' into refactor/change-tuples-to-records
DGoiana Dec 3, 2024
8343f04
fix: app halting after installation (#1403)
DGoiana Dec 3, 2024
1002364
Merge branch 'develop' into chore/add-nix-flake
limwa Dec 3, 2024
b5002b7
Bump app version [no ci]
DGoiana Dec 3, 2024
49244d2
chore: add nix flake (#1401)
limwa Dec 3, 2024
a5c5366
Bump app version [no ci]
limwa Dec 3, 2024
91b145c
Merge branch 'develop' into refactor/change-tuples-to-records
DGoiana Dec 3, 2024
97fe376
Changed tuples to records (#1395)
DGoiana Dec 4, 2024
52aaba8
Bump app version [no ci]
DGoiana Dec 4, 2024
2ab22e4
Merge branch 'master' into release/v1.9.7
limwa Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
build/
*.bin
.flutter-plugins*
packages/uni_ui/pubspec.lock

# IDE files
.DS_Store
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "A very basic flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";

pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};

androidComposition = pkgs.androidenv.composeAndroidPackages {
platformVersions = [ "31" "33" "34" ];
buildToolsVersions = [ "34.0.0" ];
includeNDK = true;
includeEmulator = true;
includeSystemImages = true;
};

androidSdk = androidComposition.androidsdk;
in {

devShell.${system} = pkgs.mkShell {
packages = with pkgs; [
flutter
jdk17
androidSdk
];

shellHook = ''
export ANDROID_HOME="${androidSdk}/libexec/android-sdk"
export JAVA_HOME="${pkgs.jdk17}"
'';
};
};
}
2 changes: 1 addition & 1 deletion packages/uni_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To use the translation import `'package:uni/generated/l10n.dart'` and use `S.of(
For this project, we separate the code into *model, *view* and *controller*.
By making sure view-only components are clear from the rest of the code, we can assure safe reuse of widgets as well as separated testing and development.

![MVC Scheme](../readme-src/MVC.png "MVC Scheme")
![MVC Scheme](../../readme-src/MVC.png "MVC Scheme")

### Model
The *model* represents the entities that are used in the app, including the session, the classes, the exams. They should be generated from the controller's methods and passed to the view. The model should not contain logic, but only the data that is needed to display the information.
Expand Down
3 changes: 3 additions & 0 deletions packages/uni_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ android {
"proguard-rules.pro"
)
}
debug {
applicationIdSuffix ".dev"
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/uni_app/android/app/src/debug/res/values/string.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">uni (dev)</string>
</resources>
8 changes: 5 additions & 3 deletions packages/uni_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application
android:label="uni"
<application
android:label="@string/app_name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true"
android:allowBackup="false"
>
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
4 changes: 4 additions & 0 deletions packages/uni_app/android/app/src/main/res/values/string.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">uni</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import 'package:logger/logger.dart';
import 'package:tuple/tuple.dart';
import 'package:uni/controller/background_workers/notifications.dart';
import 'package:workmanager/workmanager.dart';

/// This map contains the functions that a certain task type will run.
/// the bool is all functions that are ran by backgroundfetch in iOS
/// (they must not take any arguments, not checked)
const taskMap = {
'pt.up.fe.ni.uni.notificationworker':
Tuple2(NotificationManager.updateAndTriggerNotifications, true),
'pt.up.fe.ni.uni.notificationworker': (
NotificationManager.updateAndTriggerNotifications,
true
),
};

@pragma('vm:entry-point')
Expand All @@ -25,16 +26,16 @@ Future<void> workerStartCallback() async {
// by the iOS scheduler.
if (taskName == Workmanager.iOSBackgroundTask) {
taskMap.forEach((key, value) async {
if (value.item2) {
if (value.$2) {
Logger().d('''[$key]: Start executing job...''');
await value.item1();
await value.$1();
}
});
return true;
}
// 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();
await taskMap[taskName]!.$1();
} catch (err, st) {
Logger().e(
'Error while running $taskName job:',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:flutter/services.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:logger/logger.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tuple/tuple.dart';
import 'package:uni/controller/background_workers/notifications/tuition_notification.dart';
import 'package:uni/controller/local_storage/notification_timeout_storage.dart';
import 'package:uni/controller/local_storage/preferences_controller.dart';
Expand All @@ -28,12 +27,12 @@ abstract class Notification {
String uniqueID;
Duration timeout;

Future<Tuple2<String, String>> buildNotificationContent(Session session);
Future<(String, String)> buildNotificationContent(Session session);

Future<bool> shouldDisplay(Session session);

void displayNotification(
Tuple2<String, String> content,
(String, String) content,
FlutterLocalNotificationsPlugin localNotificationsPlugin,
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:tuple/tuple.dart';
import 'package:uni/controller/background_workers/notifications.dart';
import 'package:uni/controller/fetchers/fees_fetcher.dart';
import 'package:uni/controller/local_storage/preferences_controller.dart';
Expand All @@ -13,20 +12,20 @@ class TuitionNotification extends Notification {
late DateTime _dueDate;

@override
Future<Tuple2<String, String>> buildNotificationContent(
Future<(String, String)> buildNotificationContent(
Session session,
) async {
// We must add one day because the time limit is actually at 23:59 and
// not at 00:00 of the same day
if (_dueDate.add(const Duration(days: 1)).isBefore(DateTime.now())) {
final duration = DateTime.now().difference(_dueDate);
if (duration.inDays == 0) {
return const Tuple2(
return const (
'⚠️ Ainda não pagaste as propinas ⚠️',
'O prazo para pagar as propinas acabou ontem',
);
}
return Tuple2(
return (
'⚠️ Ainda não pagaste as propinas ⚠️',
duration.toFormattedString(
'Já passou {} desde a data limite',
Expand All @@ -36,12 +35,12 @@ class TuitionNotification extends Notification {
}
final duration = _dueDate.difference(DateTime.now());
if (duration.inDays == 0) {
return const Tuple2(
return const (
'O prazo limite para as propinas está a acabar',
'Hoje acaba o prazo para pagamento das propinas!',
);
}
return Tuple2(
return (
'O prazo limite para as propinas está a acabar',
duration.toFormattedString(
'Falta {} para a data limite',
Expand Down Expand Up @@ -72,7 +71,7 @@ class TuitionNotification extends Notification {

@override
void displayNotification(
Tuple2<String, String> content,
(String, String) content,
FlutterLocalNotificationsPlugin localNotificationsPlugin,
) {
const androidNotificationDetails = AndroidNotificationDetails(
Expand All @@ -95,8 +94,8 @@ class TuitionNotification extends Notification {

localNotificationsPlugin.show(
2,
content.item1,
content.item2,
content.$1,
content.$2,
notificationDetails,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ import 'dart:convert';
import 'package:collection/collection.dart';
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import 'package:tuple/tuple.dart';
import 'package:uni/model/entities/library_occupation.dart';

/// Fetch the library occupation from Google Sheets
class LibraryOccupationFetcher {
String baseUrl = 'https://webapi.affluences.com/api/fillRate?';

static const List<Tuple2<String, int>> floorMaxSeats = [
Tuple2('BruV6IlujdwAe1', 72),
Tuple2('cEhyzJZvC5nHSr', 114),
Tuple2('iceVfgwZWaZRhV', 114),
Tuple2('1yLPz9X0CNsg27', 114),
Tuple2('keu1j5zERlQn90', 40),
Tuple2('bY7K1v43HiAq55', 90),
static const List<(String, int)> floorMaxSeats = [
('BruV6IlujdwAe1', 72),
('cEhyzJZvC5nHSr', 114),
('iceVfgwZWaZRhV', 114),
('1yLPz9X0CNsg27', 114),
('keu1j5zERlQn90', 40),
('bY7K1v43HiAq55', 90),
];

Future<LibraryOccupation> getLibraryOccupation() async {
Expand All @@ -26,19 +25,19 @@ class LibraryOccupationFetcher {
floorMaxSeats.mapIndexed((i, entry) async {
final url = Uri.parse(baseUrl).replace(
queryParameters: {
'token': entry.item1,
'token': entry.$1,
},
);

final response = await http.get(url);

final floorOccupation =
processFloorOccupation(response, entry.item2, i);
final floorOccupation = processFloorOccupation(response, entry.$2, i);

libraryOccupation.addFloor(floorOccupation);
}),
);

libraryOccupation.sortFloors();
return libraryOccupation;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppUserDataDatabase extends AppDatabase<Profile> {
for (final keymap in data.keymapValues()) {
await insertInDatabase(
'userdata',
{'name': keymap.item1, 'value': keymap.item2},
{'name': keymap.$1, 'value': keymap.$2},
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:convert';
import 'package:html/parser.dart';
import 'package:http/http.dart';
import 'package:intl/intl.dart';
import 'package:tuple/tuple.dart';
import 'package:uni/model/entities/meal.dart';
import 'package:uni/model/entities/restaurant.dart';
import 'package:uni/model/utils/day_of_week.dart';
Expand All @@ -18,15 +17,15 @@ List<Restaurant> getRestaurantsFromHtml(Response response) {
final restaurantsTuple = restaurantsHtml.map((restaurantHtml) {
final name = restaurantHtml.text;
final ref = restaurantHtml.attributes['href']?.replaceAll('#', '');
return Tuple2(ref ?? '', name);
return (ref ?? '', name);
}).toList();

// Get restaurant meals and create the Restaurant class
final restaurants = restaurantsTuple.map((restaurantTuple) {
final meals = <Meal>[];

final referenceA =
document.querySelector('a[name="${restaurantTuple.item1}"]');
document.querySelector('a[name="${restaurantTuple.$1}"]');
var next = referenceA?.nextElementSibling;

final format = DateFormat('d-M-y');
Expand Down Expand Up @@ -70,8 +69,8 @@ List<Restaurant> getRestaurantsFromHtml(Response response) {
}
return Restaurant(
null,
restaurantTuple.item2,
restaurantTuple.item1,
restaurantTuple.$2,
restaurantTuple.$1,
meals: meals,
);
}).toList();
Expand Down
22 changes: 18 additions & 4 deletions packages/uni_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import 'package:uni/model/providers/startup/profile_provider.dart';
import 'package:uni/model/providers/startup/session_provider.dart';
import 'package:uni/model/providers/state_providers.dart';
import 'package:uni/utils/navigation_items.dart';
import 'package:uni/view/about/about.dart';
import 'package:uni/view/academic_path/academic_path.dart';
import 'package:uni/view/bug_report/bug_report.dart';
import 'package:uni/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart';
import 'package:uni/view/calendar/calendar.dart';
import 'package:uni/view/common_widgets/page_transition.dart';
Expand Down Expand Up @@ -305,12 +307,24 @@ class ApplicationState extends State<Application> {
settings: settings,
),
'/${NavigationItem.navProfile.route}':
MaterialPageRoute<ProfilePageView>(
builder: (__) => const ProfilePageView(),
PageTransition.makePageTransition(
page: const ProfilePageView(),
settings: settings,
),
'/${NavigationItem.navSettings.route}':
MaterialPageRoute<SettingsPage>(
builder: (_) => const SettingsPage(),
PageTransition.makePageTransition(
page: const SettingsPage(),
settings: settings,
),
'/${NavigationItem.navBugreport.route}':
PageTransition.makePageTransition(
page: const BugReportPageView(),
settings: settings,
),
'/${NavigationItem.navAboutus.route}':
PageTransition.makePageTransition(
page: const AboutPageView(),
settings: settings,
),
};
return transitions[settings.name];
Expand Down
Loading
Loading