diff --git a/uni/.metadata b/uni/.metadata new file mode 100644 index 000000000..b7a08be36 --- /dev/null +++ b/uni/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + channel: unknown + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: ios + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/uni/app_version.txt b/uni/app_version.txt index 76f04fb93..76f0b73fc 100644 --- a/uni/app_version.txt +++ b/uni/app_version.txt @@ -1 +1 @@ -1.7.19+209 \ No newline at end of file +1.7.25+215 \ No newline at end of file diff --git a/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/uni/ios/RunnerTests/RunnerTests.swift b/uni/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..86a7c3b1b --- /dev/null +++ b/uni/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/uni/lib/controller/load_static/terms_and_conditions.dart b/uni/lib/controller/load_static/terms_and_conditions.dart index e5e5fc5da..590d3bf51 100644 --- a/uni/lib/controller/load_static/terms_and_conditions.dart +++ b/uni/lib/controller/load_static/terms_and_conditions.dart @@ -1,9 +1,7 @@ import 'dart:convert'; -import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter/services.dart' show rootBundle; -import 'package:http/http.dart' as http; import 'package:uni/controller/local_storage/app_shared_preferences.dart'; /// Returns the content of the Terms and Conditions remote file, @@ -11,14 +9,6 @@ import 'package:uni/controller/local_storage/app_shared_preferences.dart'; /// /// If this operation is unsuccessful, an error message is returned. Future fetchTermsAndConditions() async { - if (await Connectivity().checkConnectivity() != ConnectivityResult.none) { - const url = - 'https://raw.githubusercontent.com/NIAEFEUP/project-schrodinger/develop/uni/assets/text/TermsAndConditions.md'; - final response = await http.get(Uri.parse(url)); - if (response.statusCode == 200) { - return response.body; - } - } return rootBundle.loadString('assets/text/TermsAndConditions.md'); } diff --git a/uni/lib/controller/local_storage/app_shared_preferences.dart b/uni/lib/controller/local_storage/app_shared_preferences.dart index 8c458cbd2..e2b60e5d7 100644 --- a/uni/lib/controller/local_storage/app_shared_preferences.dart +++ b/uni/lib/controller/local_storage/app_shared_preferences.dart @@ -26,6 +26,7 @@ class AppSharedPreferences { static const String areTermsAndConditionsAcceptedKey = 'is_t&c_accepted'; static const String tuitionNotificationsToggleKey = 'tuition_notification_toogle'; + static const String usageStatsToggleKey = 'usage_stats_toogle'; static const String themeMode = 'theme_mode'; static const String locale = 'app_locale'; static const String favoriteCards = 'favorite_cards'; @@ -293,4 +294,16 @@ class AppSharedPreferences { final prefs = await SharedPreferences.getInstance(); await prefs.setBool(tuitionNotificationsToggleKey, value); } + + static Future getUsageStatsToggle() async { + final prefs = await SharedPreferences.getInstance(); + return prefs.getBool(usageStatsToggleKey) ?? true; + } + + static Future setUsageStatsToggle({ + required bool value, + }) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setBool(usageStatsToggleKey, value); + } } diff --git a/uni/lib/generated/intl/messages_all.dart b/uni/lib/generated/intl/messages_all.dart index f40637340..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'; @@ -36,19 +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); + 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) { @@ -60,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 ee65469e9..210fdec72 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -23,137 +23,237 @@ class MessageLookup extends MessageLookupByLibrary { 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 String 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', + '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_occupation" : MessageLookupByLibrary.simpleMessage("Library Occupation"), - "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"), - "uc_info" : MessageLookupByLibrary.simpleMessage("Open UC page in app"), - "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 Map _notInlinedMessages(_) => { + "about": MessageLookupByLibrary.simpleMessage("About us"), + "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"), + "collect_usage_stats": + MessageLookupByLibrary.simpleMessage("Collect usage statistics"), + "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"), + "confirm_logout": MessageLookupByLibrary.simpleMessage( + "Do you really want to log out? Your local data will be deleted and you will have to log in again."), + "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("Fee 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"), + "language": MessageLookupByLibrary.simpleMessage("Language"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library_occupation": + MessageLookupByLibrary.simpleMessage("Library Occupation"), + "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"), + "notifications": MessageLookupByLibrary.simpleMessage("Notifications"), + "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"), + "report_error_suggestion": + MessageLookupByLibrary.simpleMessage("Report error/suggestion"), + "restaurant_main_page": MessageLookupByLibrary.simpleMessage( + "Do you want to see your favorite restaurants in the main page?"), + "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"), + "settings": MessageLookupByLibrary.simpleMessage("Settings"), + "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"), + "theme": MessageLookupByLibrary.simpleMessage("Theme"), + "title": MessageLookupByLibrary.simpleMessage("Title"), + "uc_info": "Open UC page in app", + "@uc_info": {}, + "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 72d8cb715..44d1ba0c6 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -23,137 +23,238 @@ class MessageLookup extends MessageLookupByLibrary { 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 String 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', + '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_occupation" : MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), - "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"), - "uc_info" : MessageLookupByLibrary.simpleMessage("Abrir página da UC na app"), - "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 Map _notInlinedMessages(_) => { + "about": MessageLookupByLibrary.simpleMessage("Sobre nós"), + "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"), + "collect_usage_stats": MessageLookupByLibrary.simpleMessage( + "Partilhar estatísticas de uso"), + "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"), + "confirm_logout": MessageLookupByLibrary.simpleMessage( + "Tens a certeza de que queres terminar sessão? Os teus dados locais serão apagados e terás de iniciar sessão novamente."), + "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("Data limite de propina"), + "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"), + "language": MessageLookupByLibrary.simpleMessage("Idioma"), + "last_refresh_time": m0, + "last_timestamp": m1, + "library_occupation": + MessageLookupByLibrary.simpleMessage("Ocupação da Biblioteca"), + "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"), + "notifications": MessageLookupByLibrary.simpleMessage("Notificações"), + "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"), + "report_error_suggestion": + MessageLookupByLibrary.simpleMessage("Reportar erro/sugestão"), + "restaurant_main_page": MessageLookupByLibrary.simpleMessage( + "Queres ver os teus restaurantes favoritos na página principal?"), + "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"), + "settings": MessageLookupByLibrary.simpleMessage("Definições"), + "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"), + "theme": MessageLookupByLibrary.simpleMessage("Tema"), + "title": MessageLookupByLibrary.simpleMessage("Título"), + "uc_info": "Abrir página da UC na app", + "@uc_info": {}, + "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 ef5d757a4..a4a35c225 100644 --- a/uni/lib/generated/l10n.dart +++ b/uni/lib/generated/l10n.dart @@ -77,6 +77,56 @@ class S { ); } + /// `About us` + String get about { + return Intl.message( + 'About us', + name: 'about', + desc: '', + args: [], + ); + } + + /// `Report error/suggestion` + String get report_error_suggestion { + return Intl.message( + 'Report error/suggestion', + name: 'report_error_suggestion', + desc: '', + args: [], + ); + } + + /// `Language` + String get language { + return Intl.message( + 'Language', + name: 'language', + desc: '', + args: [], + ); + } + + /// `Theme` + String get theme { + return Intl.message( + 'Theme', + name: 'theme', + desc: '', + args: [], + ); + } + + /// `Notifications` + String get notifications { + return Intl.message( + 'Notifications', + name: 'notifications', + desc: '', + args: [], + ); + } + /// `Academic services` String get academic_services { return Intl.message( @@ -557,10 +607,10 @@ class S { ); } - /// `Notify next deadline:` + /// `Fee deadline` String get fee_notification { return Intl.message( - 'Notify next deadline:', + 'Fee deadline', name: 'fee_notification', desc: '', args: [], @@ -730,6 +780,16 @@ class S { ); } + /// `Settings` + String get settings { + return Intl.message( + 'Settings', + name: 'settings', + desc: '', + args: [], + ); + } + /// `Log out` String get logout { return Intl.message( @@ -770,7 +830,7 @@ class S { ); } - /// `{title, select, 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}}` + /// `{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} uteis{Utils} other{Other}}` String nav_title(Object title) { return Intl.select( title, @@ -785,8 +845,6 @@ class S { 'calendario': 'Calendar', 'biblioteca': 'Library', 'uteis': 'Utils', - 'sobre': 'About', - 'bugs': 'Bugs/Suggestions', 'other': 'Other', }, name: 'nav_title', @@ -1155,6 +1213,16 @@ class S { ); } + /// `Do you want to see your favorite restaurants in the main page?` + String get restaurant_main_page { + return Intl.message( + 'Do you want to see your favorite restaurants in the main page?', + name: 'restaurant_main_page', + desc: '', + args: [], + ); + } + /// `Room` String get room { return Intl.message( @@ -1344,6 +1412,26 @@ class S { args: [], ); } + + /// `Do you really want to log out? Your local data will be deleted and you will have to log in again.` + String get confirm_logout { + return Intl.message( + 'Do you really want to log out? Your local data will be deleted and you will have to log in again.', + name: 'confirm_logout', + desc: '', + args: [], + ); + } + + /// `Collect usage statistics` + String get collect_usage_stats { + return Intl.message( + 'Collect usage statistics', + name: 'collect_usage_stats', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/uni/lib/l10n/intl_en.arb b/uni/lib/l10n/intl_en.arb index 7b915531b..4cb85a8f0 100644 --- a/uni/lib/l10n/intl_en.arb +++ b/uni/lib/l10n/intl_en.arb @@ -6,6 +6,16 @@ "@no": {}, "yes": "Yes", "@yes": {}, + "about": "About us", + "@about": {}, + "report_error_suggestion": "Report error/suggestion", + "@report_error_suggestion": {}, + "language": "Language", + "@language": {}, + "theme": "Theme", + "@theme": {}, + "notifications": "Notifications", + "@notifications": {}, "academic_services": "Academic services", "@academic_services": {}, "account_card_title": "Checking account", @@ -102,7 +112,7 @@ "@failed_login": {}, "fee_date": "Deadline for next fee:", "@fee_date": {}, - "fee_notification": "Notify next deadline:", + "fee_notification": "Fee deadline", "@fee_notification": {}, "first_year_registration": "Year of first registration: ", "@first_year_registration": {}, @@ -144,6 +154,8 @@ "@loading_terms": {}, "login": "Login", "@login": {}, + "settings": "Settings", + "@settings": {}, "logout": "Log out", "@logout": {}, "menus": "Menus", @@ -152,7 +164,7 @@ "@min_value_reference": {}, "multimedia_center": "Multimedia center", "@multimedia_center": {}, - "nav_title": "{title, select, 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}}", + "nav_title": "{title, select, horario{Schedule} exames{Exams} area{Personal Area} cadeiras{Course Units} autocarros{Buses} locais{Places} restaurantes{Restaurants} calendario{Calendar} biblioteca{Library} uteis{Utils} other{Other}}", "@nav_title": {}, "news": "News", "@news": {}, @@ -226,6 +238,8 @@ "@remove": {}, "report_error": "Report error", "@report_error": {}, + "restaurant_main_page" : "Do you want to see your favorite restaurants in the main page?", + "@restaurant_main_page": {}, "room": "Room", "@room": {}, "school_calendar": "School Calendar", @@ -263,5 +277,9 @@ "widget_prompt": "Choose a widget to add to your personal area:", "@widget_prompt": {}, "year": "Year", - "@year": {} + "@year": {}, + "confirm_logout": "Do you really want to log out? Your local data will be deleted and you will have to log in again.", + "@confirm_logout": {}, + "collect_usage_stats": "Collect usage statistics", + "@usage_stats": {} } \ No newline at end of file diff --git a/uni/lib/l10n/intl_pt_PT.arb b/uni/lib/l10n/intl_pt_PT.arb index 85b08b389..3963aa73f 100644 --- a/uni/lib/l10n/intl_pt_PT.arb +++ b/uni/lib/l10n/intl_pt_PT.arb @@ -1,11 +1,23 @@ { "@@locale": "pt_PT", + "settings": "Definições", + "@settings": {}, "exit_confirm": "Tem a certeza de que pretende sair?", "@exit_confirm": {}, + "about": "Sobre nós", + "@about": {}, "no": "Não", "@no": {}, "yes": "Sim", "@yes": {}, + "report_error_suggestion": "Reportar erro/sugestão", + "@report_error_suggestion": {}, + "language": "Idioma", + "@language": {}, + "theme": "Tema", + "@theme": {}, + "notifications": "Notificações", + "@notifications": {}, "academic_services": "Serviços académicos", "@academic_services": {}, "account_card_title": "Conta Corrente", @@ -102,7 +114,7 @@ "@failed_login": {}, "fee_date": "Data limite próxima prestação:", "@fee_date": {}, - "fee_notification": "Notificar próxima data limite:", + "fee_notification": "Data limite de propina", "@fee_notification": {}, "first_year_registration": "Ano da primeira inscrição: ", "@first_year_registration": {}, @@ -152,7 +164,7 @@ "@min_value_reference": {}, "multimedia_center": "Centro de multimédia", "@multimedia_center": {}, - "nav_title": "{title, select, 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}}", + "nav_title": "{title, select, horario{Horário} exames{Exames} area{Área Pessoal} cadeiras{Cadeiras} autocarros{Autocarros} locais{Locais} restaurantes{Restaurantes} calendario{Calendário} biblioteca{Biblioteca} uteis{Úteis} other{Outros}}", "@nav_title": {}, "news": "Notícias", "@news": {}, @@ -226,6 +238,8 @@ "@remove": {}, "report_error": "Reportar erro", "@report_error": {}, + "restaurant_main_page" : "Queres ver os teus restaurantes favoritos na página principal?", + "@restaurant_main_page": {}, "room": "Sala", "@room": {}, "school_calendar": "Calendário Escolar", @@ -263,5 +277,9 @@ "widget_prompt": "Escolhe um widget para adicionares à tua área pessoal:", "@widget_prompt": {}, "year": "Ano", - "@year": {} + "@year": {}, + "confirm_logout": "Tens a certeza de que queres terminar sessão? Os teus dados locais serão apagados e terás de iniciar sessão novamente.", + "@confirm_logout": {}, + "collect_usage_stats": "Partilhar estatísticas de uso", + "@collect_usage_stats": {} } \ No newline at end of file diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 01fac7edd..d77c467c3 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -26,8 +26,6 @@ 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/drawer_items.dart'; -import 'package:uni/view/about/about.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'; @@ -38,7 +36,6 @@ import 'package:uni/view/library/library.dart'; import 'package:uni/view/locale_notifier.dart'; import 'package:uni/view/locations/locations.dart'; import 'package:uni/view/login/login.dart'; -import 'package:uni/view/navigation_service.dart'; import 'package:uni/view/restaurant/restaurant_page_view.dart'; import 'package:uni/view/schedule/schedule.dart'; import 'package:uni/view/theme.dart'; @@ -50,15 +47,15 @@ SentryEvent? beforeSend(SentryEvent event) { return event.level == SentryLevel.info ? event : null; } -Future firstRoute() async { +Future firstRoute() async { final userPersistentInfo = await AppSharedPreferences.getPersistentUserInfo(); if (userPersistentInfo != null) { - return '/${DrawerItem.navPersonalArea.title}'; + return const HomePageView(); } await acceptTermsAndConditions(); - return '/${DrawerItem.navLogIn.title}'; + return const LoginPageView(); } Future main() async { @@ -164,9 +161,9 @@ Future main() async { /// This class is necessary to track the app's state for /// the current execution. class Application extends StatefulWidget { - const Application(this.initialRoute, {super.key}); + const Application(this.initialWidget, {super.key}); - final String initialRoute; + final Widget initialWidget; static GlobalKey navigatorKey = GlobalKey(); @@ -196,7 +193,7 @@ class ApplicationState extends State { GlobalCupertinoLocalizations.delegate, ], supportedLocales: S.delegate.supportedLocales, - initialRoute: widget.initialRoute, + home: widget.initialWidget, onGenerateRoute: (RouteSettings settings) { final transitions = { '/${DrawerItem.navPersonalArea.title}': @@ -247,22 +244,6 @@ class ApplicationState extends State { 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.navLogIn.title}': PageTransition.makePageTransition( - page: const LoginPageView(), - settings: settings, - ), - '/${DrawerItem.navLogOut.title}': - NavigationService.buildLogoutRoute(), }; return transitions[settings.name]; }, diff --git a/uni/lib/utils/drawer_items.dart b/uni/lib/utils/drawer_items.dart index ca70697f0..09d1e6f7d 100644 --- a/uni/lib/utils/drawer_items.dart +++ b/uni/lib/utils/drawer_items.dart @@ -8,21 +8,14 @@ enum DrawerItem { navRestaurants('restaurantes'), navCalendar('calendario'), navLibrary('biblioteca', faculties: {'feup'}), - navUsefulInfo('uteis', faculties: {'feup'}), - navAbout('sobre'), - navBugReport('bugs'), - navLogIn('Iniciar sessão'), - navLogOut('Terminar sessão'); + navUsefulInfo('uteis', faculties: {'feup'}); const DrawerItem(this.title, {this.faculties}); + final String title; final Set? faculties; bool isVisible(List userFaculties) { - if (this == DrawerItem.navLogIn || this == DrawerItem.navLogOut) { - return false; - } - if (faculties == null) { return true; } diff --git a/uni/lib/view/about/about.dart b/uni/lib/view/about/about.dart index af9f90eb7..a0c17a67c 100644 --- a/uni/lib/view/about/about.dart +++ b/uni/lib/view/about/about.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:uni/view/about/widgets/terms_and_conditions.dart'; -import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; +import 'package:uni/view/common_widgets/pages_layouts/secondary/secondary.dart'; class AboutPageView extends StatefulWidget { const AboutPageView({super.key}); @@ -11,7 +11,7 @@ class AboutPageView extends StatefulWidget { } /// Manages the 'about' section of the app. -class AboutPageViewState extends GeneralPageViewState { +class AboutPageViewState extends SecondaryPageViewState { @override Widget getBody(BuildContext context) { final queryData = MediaQuery.of(context); diff --git a/uni/lib/view/bug_report/bug_report.dart b/uni/lib/view/bug_report/bug_report.dart index f9f7a5c82..26b9ae931 100644 --- a/uni/lib/view/bug_report/bug_report.dart +++ b/uni/lib/view/bug_report/bug_report.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:uni/view/bug_report/widgets/form.dart'; -import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; +import 'package:uni/view/common_widgets/pages_layouts/secondary/secondary.dart'; class BugReportPageView extends StatefulWidget { const BugReportPageView({super.key}); @@ -11,7 +11,7 @@ class BugReportPageView extends StatefulWidget { } /// Manages the 'Bugs and sugestions' section of the app. -class BugReportPageViewState extends GeneralPageViewState { +class BugReportPageViewState extends SecondaryPageViewState { @override Widget getBody(BuildContext context) { return Container( diff --git a/uni/lib/view/bug_report/widgets/form.dart b/uni/lib/view/bug_report/widgets/form.dart index 18ec82a16..672d7d8b3 100644 --- a/uni/lib/view/bug_report/widgets/form.dart +++ b/uni/lib/view/bug_report/widgets/form.dart @@ -8,7 +8,6 @@ import 'package:uni/controller/local_storage/app_shared_preferences.dart'; import 'package:uni/generated/l10n.dart'; import 'package:uni/model/entities/app_locale.dart'; import 'package:uni/model/entities/bug_report.dart'; -import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/bug_report/widgets/text_field.dart'; import 'package:uni/view/common_widgets/page_title.dart'; import 'package:uni/view/common_widgets/toast_message.dart'; @@ -81,69 +80,52 @@ class BugReportFormState extends State { Widget build(BuildContext context) { return Form( key: _formKey, - child: ListView(children: getFormWidget(context)), - ); - } - - List getFormWidget(BuildContext context) { - return [ - bugReportTitle(context), - bugReportIntro(context), - dropdownBugSelectWidget(context), - FormTextField( - titleController, - Icons.title, - maxLines: 2, - description: S.of(context).title, - labelText: S.of(context).problem_id, - bottomMargin: 30, - ), - FormTextField( - descriptionController, - Icons.description, - maxLines: 30, - description: S.of(context).description, - labelText: S.of(context).bug_description, - bottomMargin: 30, - ), - FormTextField( - emailController, - Icons.mail, - maxLines: 2, - description: S.of(context).contact, - labelText: S.of(context).desired_email, - bottomMargin: 30, - isOptional: true, - formatValidator: (String? value) { - if (value == null || value.isEmpty) { - return null; - } - - return EmailValidator.validate(value) - ? null - : S.of(context).valid_email; - }, - ), - consentBox(context), - submitButton(context), - ]; - } - - /// Returns a widget for the title of the bug report form - Widget bugReportTitle(BuildContext context) { - return Container( - margin: const EdgeInsets.symmetric(vertical: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - const Icon(Icons.bug_report, size: 40), + child: ListView( + children: [ + const Padding(padding: EdgeInsets.only(bottom: 10)), PageTitle( - name: S.of(context).nav_title( - DrawerItem.navBugReport.title, - ), - center: false, + name: S.of(context).report_error_suggestion, + pad: false, + ), + const Padding(padding: EdgeInsets.only(bottom: 10)), + bugReportIntro(context), + dropdownBugSelectWidget(context), + FormTextField( + titleController, + Icons.title, + maxLines: 2, + description: S.of(context).title, + labelText: S.of(context).problem_id, + bottomMargin: 30, + ), + FormTextField( + descriptionController, + Icons.description, + maxLines: 30, + description: S.of(context).description, + labelText: S.of(context).bug_description, + bottomMargin: 30, + ), + FormTextField( + emailController, + Icons.mail, + maxLines: 2, + description: S.of(context).contact, + labelText: S.of(context).desired_email, + bottomMargin: 30, + isOptional: true, + formatValidator: (String? value) { + if (value == null || value.isEmpty) { + return null; + } + + return EmailValidator.validate(value) + ? null + : S.of(context).valid_email; + }, ), - const Icon(Icons.bug_report, size: 40), + consentBox(context), + submitButton(context), ], ), ); diff --git a/uni/lib/view/common_widgets/generic_card.dart b/uni/lib/view/common_widgets/generic_card.dart index 9bd18de0c..5d56b915a 100644 --- a/uni/lib/view/common_widgets/generic_card.dart +++ b/uni/lib/view/common_widgets/generic_card.dart @@ -1,6 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:uni/generated/l10n.dart'; -import 'package:uni/model/entities/time_utilities.dart'; /// App default card abstract class GenericCard extends StatefulWidget { @@ -51,27 +49,6 @@ abstract class GenericCard extends StatefulWidget { style: Theme.of(context).textTheme.titleLarge, ); } - - StatelessWidget showLastRefreshedTime(String? time, BuildContext context) { - if (time == null) { - return const Text('N/A'); - } - - final parsedTime = DateTime.tryParse(time); - if (parsedTime == null) { - return const Text('N/A'); - } - - return Container( - alignment: Alignment.center, - child: Text( - S.of(context).last_refresh_time( - parsedTime.toTimeHourMinString(), - ), - style: Theme.of(context).textTheme.bodySmall, - ), - ); - } } class GenericCardState extends State { 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 0314f2eb4..bf601badd 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/general.dart @@ -64,9 +64,7 @@ abstract class GeneralPageViewState extends State { ); } - Widget getBody(BuildContext context) { - return Container(); - } + Widget getBody(BuildContext context); Future buildProfileDecorationImage( BuildContext context, { @@ -103,7 +101,16 @@ abstract class GeneralPageViewState extends State { Provider.of(context, listen: false).session, forceRetrieval: true, ).then((value) => onRefresh(context)), - child: child, + child: Builder( + builder: (context) => GestureDetector( + onHorizontalDragEnd: (dragDetails) { + if (dragDetails.primaryVelocity! > 2) { + Scaffold.of(context).openDrawer(); + } + }, + child: child, + ), + ), ); } @@ -138,23 +145,27 @@ abstract class GeneralPageViewState extends State { title: ButtonTheme( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: const RoundedRectangleBorder(), - child: TextButton( - onPressed: () { - final currentRouteName = ModalRoute.of(context)!.settings.name; - if (currentRouteName != DrawerItem.navPersonalArea.title) { - Navigator.pushNamed( - context, - '/${DrawerItem.navPersonalArea.title}', - ); - } - }, - child: SvgPicture.asset( - colorFilter: ColorFilter.mode( - Theme.of(context).primaryColor, - BlendMode.srcIn, + child: Builder( + builder: (context) => TextButton( + onPressed: () { + final currentRouteName = ModalRoute.of(context)!.settings.name; + if (currentRouteName != '/${DrawerItem.navPersonalArea.title}') { + Navigator.pushNamed( + context, + '/${DrawerItem.navPersonalArea.title}', + ); + } else { + Scaffold.of(context).openDrawer(); + } + }, + child: SvgPicture.asset( + colorFilter: ColorFilter.mode( + Theme.of(context).primaryColor, + BlendMode.srcIn, + ), + 'assets/images/logo_dark.svg', + height: queryData.size.height / 25, ), - 'assets/images/logo_dark.svg', - height: queryData.size.height / 25, ), ), ), diff --git a/uni/lib/view/common_widgets/pages_layouts/general/widgets/navigation_drawer.dart b/uni/lib/view/common_widgets/pages_layouts/general/widgets/navigation_drawer.dart index 18572148d..ad5fd1d74 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/widgets/navigation_drawer.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/widgets/navigation_drawer.dart @@ -3,11 +3,10 @@ import 'package:provider/provider.dart'; import 'package:uni/generated/l10n.dart'; import 'package:uni/model/providers/startup/session_provider.dart'; import 'package:uni/utils/drawer_items.dart'; -import 'package:uni/view/locale_notifier.dart'; -import 'package:uni/view/theme_notifier.dart'; class AppNavigationDrawer extends StatefulWidget { const AppNavigationDrawer({required this.parentContext, super.key}); + final BuildContext parentContext; @override @@ -31,7 +30,6 @@ class AppNavigationDrawerState extends State { } } - // Callback Functions String getCurrentRoute() => ModalRoute.of(widget.parentContext)!.settings.name == null ? drawerItems.keys.toList()[0].title @@ -39,21 +37,12 @@ class AppNavigationDrawerState extends State { void _onSelectPage(String key) { final prev = getCurrentRoute(); - Navigator.of(context).pop(); - if (prev != key) { Navigator.pushNamed(context, '/$key'); } } - void _onLogOut(String key) { - Navigator.of(context) - .pushNamedAndRemoveUntil('/$key', (Route route) => false); - } - - // End of Callback Functions - BoxDecoration? _getSelectionDecoration(String name) { return (name == getCurrentRoute()) ? BoxDecoration( @@ -68,73 +57,6 @@ class AppNavigationDrawerState extends State { : null; } - Widget createLogoutBtn() { - final logOutText = DrawerItem.navLogOut.title; - return TextButton( - onPressed: () => _onLogOut(logOutText), - style: TextButton.styleFrom( - elevation: 0, - padding: const EdgeInsets.symmetric(horizontal: 5), - ), - child: Container( - padding: const EdgeInsets.all(15), - child: Text( - S.of(context).logout, - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: Theme.of(context).primaryColor), - ), - ), - ); - } - - Widget createLocaleBtn() { - return Consumer( - builder: (context, localeNotifier, _) { - return TextButton( - onPressed: () => localeNotifier.setNextLocale(), - style: TextButton.styleFrom( - elevation: 0, - padding: const EdgeInsets.symmetric(horizontal: 5), - ), - child: Container( - padding: const EdgeInsets.all(15), - child: Text( - localeNotifier.getLocale().localeCode.languageCode.toUpperCase(), - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: Theme.of(context).primaryColor), - ), - ), - ); - }, - ); - } - - Widget createThemeSwitchBtn() { - Icon getThemeIcon(ThemeMode theme) { - switch (theme) { - case ThemeMode.light: - return const Icon(Icons.wb_sunny); - case ThemeMode.dark: - return const Icon(Icons.nightlight_round); - case ThemeMode.system: - return const Icon(Icons.brightness_6); - } - } - - return Consumer( - builder: (context, themeNotifier, _) { - return IconButton( - icon: getThemeIcon(themeNotifier.getTheme()), - onPressed: themeNotifier.setNextTheme, - ); - }, - ); - } - Widget createDrawerNavigationOption(DrawerItem d) { return DecoratedBox( decoration: _getSelectionDecoration(d.title) ?? const BoxDecoration(), @@ -161,7 +83,7 @@ class AppNavigationDrawerState extends State { @override Widget build(BuildContext context) { final drawerOptions = []; - final userSession = Provider.of(context).session; + final userSession = context.read().session; for (final key in drawerItems.keys) { if (key.isVisible(userSession.faculties)) { @@ -180,20 +102,6 @@ class AppNavigationDrawerState extends State { ), ), ), - Row( - children: [ - Expanded( - child: Align( - child: createLogoutBtn(), - ), - ), - Align( - alignment: Alignment.centerRight, - child: createLocaleBtn(), - ), - createThemeSwitchBtn(), - ], - ), ], ), ); diff --git a/uni/lib/view/common_widgets/pages_layouts/secondary/secondary.dart b/uni/lib/view/common_widgets/pages_layouts/secondary/secondary.dart index 473fb3299..9266ffc0c 100644 --- a/uni/lib/view/common_widgets/pages_layouts/secondary/secondary.dart +++ b/uni/lib/view/common_widgets/pages_layouts/secondary/secondary.dart @@ -11,4 +11,9 @@ abstract class SecondaryPageViewState body: refreshState(context, body), ); } + + @override + Widget getTopRightButton(BuildContext context) { + return Container(); + } } diff --git a/uni/lib/view/common_widgets/request_dependent_widget_builder.dart b/uni/lib/view/common_widgets/request_dependent_widget_builder.dart index 5efd0dfe6..924320dd1 100644 --- a/uni/lib/view/common_widgets/request_dependent_widget_builder.dart +++ b/uni/lib/view/common_widgets/request_dependent_widget_builder.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:shimmer/shimmer.dart'; import 'package:uni/generated/l10n.dart'; import 'package:uni/model/request_status.dart'; -import 'package:uni/utils/drawer_items.dart'; +import 'package:uni/view/bug_report/bug_report.dart'; /// Wraps content given its fetch data from the redux store, /// hydrating the component, displaying an empty message, @@ -93,9 +93,11 @@ class RequestDependentWidgetBuilder extends StatelessWidget { ), ), OutlinedButton( - onPressed: () => Navigator.pushNamed( + onPressed: () => Navigator.push( context, - '/${DrawerItem.navBugReport.title}', + MaterialPageRoute( + builder: (context) => const BugReportPageView(), + ), ), child: Text(S.of(context).report_error), ), diff --git a/uni/lib/view/home/widgets/main_cards_list.dart b/uni/lib/view/home/widgets/main_cards_list.dart index 241f6a2f1..2eede80c4 100644 --- a/uni/lib/view/home/widgets/main_cards_list.dart +++ b/uni/lib/view/home/widgets/main_cards_list.dart @@ -150,7 +150,7 @@ class MainCardsList extends StatelessWidget { HomePageProvider editingModeProvider, ) { return Container( - padding: const EdgeInsets.fromLTRB(20, 20, 20, 5), + padding: const EdgeInsets.fromLTRB(20, 10, 20, 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -159,18 +159,28 @@ class MainCardsList extends StatelessWidget { center: false, pad: false, ), - GestureDetector( - onTap: () => Provider.of(context, listen: false) - .setHomePageEditingMode( - editingMode: !editingModeProvider.isEditing, - ), - child: Text( - editingModeProvider.isEditing - ? S.of(context).edit_on - : S.of(context).edit_off, - style: Theme.of(context).textTheme.bodySmall, + if (editingModeProvider.isEditing) + ElevatedButton( + onPressed: () => + Provider.of(context, listen: false) + .setHomePageEditingMode( + editingMode: false, + ), + child: Text( + S.of(context).edit_on, + ), + ) + else + OutlinedButton( + onPressed: () => + Provider.of(context, listen: false) + .setHomePageEditingMode( + editingMode: true, + ), + child: Text( + S.of(context).edit_off, + ), ), - ), ], ), ); diff --git a/uni/lib/view/home/widgets/restaurant_card.dart b/uni/lib/view/home/widgets/restaurant_card.dart index 010264d9b..cc8274aa0 100644 --- a/uni/lib/view/home/widgets/restaurant_card.dart +++ b/uni/lib/view/home/widgets/restaurant_card.dart @@ -52,7 +52,7 @@ class RestaurantCard extends GenericCard { onNullContent: Column( children: [ Padding( - padding: const EdgeInsets.only(top: 15, bottom: 10), + padding: const EdgeInsets.only(top: 10, bottom: 10), child: Center( child: Text( S.of(context).no_favorite_restaurants, @@ -74,10 +74,32 @@ class RestaurantCard extends GenericCard { ); } - Widget generateRestaurants(List data, BuildContext context) { + Widget generateRestaurants( + List restaurants, + BuildContext context, + ) { final weekDay = DateTime.now().weekday; final offset = (weekDay - 1) % 7; - final restaurants = data; + + if (restaurants + .map((e) => e.meals[DayOfWeek.values[offset]]) + .every((element) => element?.isEmpty ?? true)) { + return Column( + children: [ + const SizedBox( + height: 15, + ), + Text( + S.of(context).no_menus, + style: Theme.of(context).textTheme.titleSmall, + ), + const SizedBox( + height: 15, + ), + ], + ); + } + return ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), @@ -108,12 +130,13 @@ class RestaurantCard extends GenericCard { Center( child: Container( alignment: Alignment.centerLeft, - padding: const EdgeInsets.fromLTRB(12, 20, 12, 5), + padding: const EdgeInsets.fromLTRB(10, 15, 5, 10), child: Text( restaurant.name, style: TextStyle( + fontSize: 16, color: Theme.of(context).primaryColor, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w400, ), ), ), @@ -143,6 +166,7 @@ class RestaurantCard extends GenericCard { ), ), ), + const SizedBox(height: 10), ], ); } diff --git a/uni/lib/view/library/widgets/library_occupation_card.dart b/uni/lib/view/library/widgets/library_occupation_card.dart index ee6a4548b..05a256194 100644 --- a/uni/lib/view/library/widgets/library_occupation_card.dart +++ b/uni/lib/view/library/widgets/library_occupation_card.dart @@ -66,7 +66,7 @@ class LibraryOccupationCard extends GenericCard { return Padding( padding: const EdgeInsets.symmetric(vertical: 6), child: CircularPercentIndicator( - radius: 60, + radius: 40, lineWidth: 8, percent: occupation.percentage / 100, center: Text( diff --git a/uni/lib/view/navigation_service.dart b/uni/lib/view/navigation_service.dart index 903f5410e..e896d904d 100644 --- a/uni/lib/view/navigation_service.dart +++ b/uni/lib/view/navigation_service.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:uni/controller/cleanup.dart'; import 'package:uni/main.dart'; -import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/login/login.dart'; /// Manages the navigation logic @@ -13,9 +12,11 @@ class NavigationService { unawaited(cleanupStoredData(context)); - Navigator.pushNamedAndRemoveUntil( + Navigator.pushAndRemoveUntil( context, - '/${DrawerItem.navLogIn.title}', + MaterialPageRoute( + builder: (context) => const LoginPageView(), + ), (route) => false, ); } diff --git a/uni/lib/view/profile/profile.dart b/uni/lib/view/profile/profile.dart index 6e23db12a..4ae9bc379 100644 --- a/uni/lib/view/profile/profile.dart +++ b/uni/lib/view/profile/profile.dart @@ -7,6 +7,7 @@ import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/profile/widgets/account_info_card.dart'; import 'package:uni/view/profile/widgets/course_info_card.dart'; import 'package:uni/view/profile/widgets/profile_overview.dart'; +import 'package:uni/view/settings/settings.dart'; class ProfilePageView extends StatefulWidget { const ProfilePageView({super.key}); @@ -35,6 +36,7 @@ class ProfilePageViewState extends SecondaryPageViewState { return ListView( children: [ const Padding(padding: EdgeInsets.all(5)), + const Padding(padding: EdgeInsets.all(10)), ProfileOverview( profile: profile, getProfileDecorationImage: getProfileDecorationImage, @@ -52,7 +54,18 @@ class ProfilePageViewState extends SecondaryPageViewState { @override Widget getTopRightButton(BuildContext context) { - return Container(); + return Container( + padding: const EdgeInsets.fromLTRB(0, 10, 20, 10), + child: IconButton( + icon: const Icon(Icons.settings), + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => const SettingsPage(), + ), + ), + ), + ); } @override diff --git a/uni/lib/view/profile/widgets/account_info_card.dart b/uni/lib/view/profile/widgets/account_info_card.dart index 9e5162fa3..3e5eca04d 100644 --- a/uni/lib/view/profile/widgets/account_info_card.dart +++ b/uni/lib/view/profile/widgets/account_info_card.dart @@ -8,7 +8,6 @@ import 'package:uni/model/providers/startup/profile_provider.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; import 'package:uni/view/lazy_consumer.dart'; import 'package:uni/view/profile/widgets/reference_section.dart'; -import 'package:uni/view/profile/widgets/tuition_notification_switch.dart'; /// Manages the 'Current account' section inside the user's page (accessible /// through the top-right widget with the user picture) @@ -95,50 +94,25 @@ class AccountInfoCard extends GenericCard { ), ], ), - TableRow( - children: [ - Container( - margin: const EdgeInsets.only( - top: 8, - bottom: 20, - left: 20, - ), - child: Text( - S.of(context).fee_notification, - style: Theme.of(context).textTheme.titleSmall, - ), - ), - Container( - margin: const EdgeInsets.only( - top: 8, - bottom: 20, - left: 20, - ), - child: const TuitionNotificationSwitch(), + ], + ), + if (references.isNotEmpty) + Container( + padding: const EdgeInsets.all(10), + child: Row( + children: [ + Text( + S.of(context).pendent_references, + style: Theme.of(context).textTheme.titleLarge?.apply( + color: Theme.of(context).colorScheme.secondary, + ), ), ], ), - ], - ), - Container( - padding: const EdgeInsets.all(10), - child: Row( - children: [ - Text( - S.of(context).pendent_references, - style: Theme.of(context).textTheme.titleLarge?.apply( - color: Theme.of(context).colorScheme.secondary, - ), - ), - ], ), - ), - ReferenceList(references: references), + if (references.isNotEmpty) + ReferenceList(references: references), const SizedBox(height: 10), - showLastRefreshedTime( - profileStateProvider.lastUpdateTime?.toIso8601String(), - context, - ), ], ); }, diff --git a/uni/lib/view/profile/widgets/print_info_card.dart b/uni/lib/view/profile/widgets/print_info_card.dart index cebb17675..b2acae5a8 100644 --- a/uni/lib/view/profile/widgets/print_info_card.dart +++ b/uni/lib/view/profile/widgets/print_info_card.dart @@ -66,10 +66,6 @@ class PrintInfoCard extends GenericCard { ), ], ), - showLastRefreshedTime( - profileStateProvider.lastUpdateTime?.toIso8601String(), - context, - ), ], ); }, diff --git a/uni/lib/view/profile/widgets/profile_overview.dart b/uni/lib/view/profile/widgets/profile_overview.dart index 2ea9b1f30..fcc49a8fc 100644 --- a/uni/lib/view/profile/widgets/profile_overview.dart +++ b/uni/lib/view/profile/widgets/profile_overview.dart @@ -32,7 +32,9 @@ class ProfileOverview extends StatelessWidget { height: 150, decoration: BoxDecoration( shape: BoxShape.circle, - image: getProfileDecorationImage(profilePic.data), + image: profilePic.data != null + ? getProfileDecorationImage(profilePic.data) + : null, ), ), const Padding(padding: EdgeInsets.all(8)), diff --git a/uni/lib/view/restaurant/restaurant_page_view.dart b/uni/lib/view/restaurant/restaurant_page_view.dart index 80a1c96b5..a31fefe11 100644 --- a/uni/lib/view/restaurant/restaurant_page_view.dart +++ b/uni/lib/view/restaurant/restaurant_page_view.dart @@ -65,12 +65,21 @@ class _RestaurantPageViewState extends GeneralPageViewState ], ), const SizedBox(height: 10), - RequestDependentWidgetBuilder( - status: restaurantProvider.status, - builder: () => - createTabViewBuilder(restaurantProvider.restaurants, context), - hasContentPredicate: restaurantProvider.restaurants.isNotEmpty, - onNullContent: Center(child: Text(S.of(context).no_menus)), + Expanded( + child: RequestDependentWidgetBuilder( + status: restaurantProvider.status, + builder: () => createTabViewBuilder( + restaurantProvider.restaurants, + context, + ), + hasContentPredicate: restaurantProvider.restaurants.isNotEmpty, + onNullContent: Center( + child: Text( + S.of(context).no_menus, + style: const TextStyle(fontSize: 18), + ), + ), + ), ), ], ); @@ -78,15 +87,24 @@ class _RestaurantPageViewState extends GeneralPageViewState ); } - Widget createTabViewBuilder(dynamic restaurants, BuildContext context) { - final List dayContents = DayOfWeek.values.map((dayOfWeek) { - var restaurantsWidgets = []; - if (restaurants is List) { - restaurantsWidgets = restaurants - .map( - (restaurant) => createRestaurant(context, restaurant, dayOfWeek), - ) - .toList(); + Widget createTabViewBuilder( + List restaurants, + BuildContext context, + ) { + final dayContents = DayOfWeek.values.map((dayOfWeek) { + final restaurantsWidgets = restaurants + .where((element) => element.meals[dayOfWeek]?.isNotEmpty ?? false) + .map( + (restaurant) => createRestaurant(context, restaurant, dayOfWeek), + ) + .toList(); + if (restaurantsWidgets.isEmpty) { + return Center( + child: Text( + S.of(context).no_menus, + style: const TextStyle(fontSize: 18), + ), + ); } return ListView(children: restaurantsWidgets); }).toList(); diff --git a/uni/lib/view/restaurant/widgets/restaurant_page_card.dart b/uni/lib/view/restaurant/widgets/restaurant_page_card.dart index d02d616aa..7e323e1c8 100644 --- a/uni/lib/view/restaurant/widgets/restaurant_page_card.dart +++ b/uni/lib/view/restaurant/widgets/restaurant_page_card.dart @@ -1,7 +1,11 @@ import 'package:flutter/material.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:provider/provider.dart'; +import 'package:uni/generated/l10n.dart'; import 'package:uni/model/entities/restaurant.dart'; +import 'package:uni/model/providers/lazy/home_page_provider.dart'; import 'package:uni/model/providers/lazy/restaurant_provider.dart'; +import 'package:uni/utils/favorite_widget_type.dart'; import 'package:uni/view/common_widgets/generic_card.dart'; import 'package:uni/view/lazy_consumer.dart'; @@ -45,11 +49,53 @@ class CardFavoriteButton extends StatelessWidget { restaurantProvider.favoriteRestaurants.contains(restaurant.name); return IconButton( icon: isFavorite ? Icon(MdiIcons.heart) : Icon(MdiIcons.heartOutline), - onPressed: () => restaurantProvider.toggleFavoriteRestaurant( - restaurant.name, - ), + onPressed: () { + restaurantProvider.toggleFavoriteRestaurant( + restaurant.name, + ); + final favoriteCardTypes = + context.read().favoriteCards; + if (!isFavorite && + !favoriteCardTypes.contains(FavoriteWidgetType.restaurant)) { + showRestaurantCardHomeDialog(context, favoriteCardTypes, + (newFavoriteCards) { + Provider.of(context, listen: false) + .setFavoriteCards(newFavoriteCards); + }); + } + }, ); }, ); } + + void showRestaurantCardHomeDialog( + BuildContext context, + List favoriteCardTypes, + void Function(List) updateHomePage, + ) { + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text(S.of(context).restaurant_main_page), + actions: [ + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).no), + ), + ElevatedButton( + onPressed: () { + updateHomePage( + favoriteCardTypes + [FavoriteWidgetType.restaurant], + ); + Navigator.of(context).pop(); + }, + child: Text(S.of(context).yes), + ), + ], + ), + ); + } } diff --git a/uni/lib/view/settings/settings.dart b/uni/lib/view/settings/settings.dart new file mode 100644 index 000000000..c1f0210a9 --- /dev/null +++ b/uni/lib/view/settings/settings.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni/view/about/about.dart'; +import 'package:uni/view/bug_report/bug_report.dart'; +import 'package:uni/view/common_widgets/page_title.dart'; +import 'package:uni/view/common_widgets/pages_layouts/secondary/secondary.dart'; +import 'package:uni/view/settings/widgets/locale_switch_button.dart'; +import 'package:uni/view/settings/widgets/logout_confirm_dialog.dart'; +import 'package:uni/view/settings/widgets/notifications_dialog.dart'; +import 'package:uni/view/settings/widgets/theme_switch_button.dart'; +import 'package:uni/view/settings/widgets/usage_stats_switch.dart'; + +class SettingsPage extends StatefulWidget { + const SettingsPage({super.key}); + + @override + State createState() { + return SettingsPageState(); + } +} + +class SettingsPageState extends SecondaryPageViewState { + @override + Widget getBody(BuildContext context) { + return Column( + children: [ + PageTitle(name: S.of(context).settings), + const Padding(padding: EdgeInsets.only(top: 10)), + Expanded( + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: ListView( + children: [ + ListTile( + title: Text(S.of(context).language), + trailing: const LocaleSwitchButton(), + ), + ListTile( + title: Text(S.of(context).theme), + trailing: const ThemeSwitchButton(), + ), + ListTile( + title: Text(S.of(context).collect_usage_stats), + trailing: const UsageStatsSwitch(), + ), + ListTile( + title: Text(S.of(context).notifications), + trailing: const Icon(Icons.arrow_forward_ios), + onTap: () { + showDialog( + context: context, + builder: (context) => const NotificationsDialog(), + ); + }, + ), + ListTile( + title: Text(S.of(context).report_error_suggestion), + trailing: const Icon(Icons.arrow_forward_ios), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const BugReportPageView(), + ), + ); + }, + ), + ListTile( + title: Text(S.of(context).about), + trailing: const Icon(Icons.arrow_forward_ios), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const AboutPageView(), + ), + ); + }, + ), + ListTile( + title: Text(S.of(context).logout), + trailing: const Icon(Icons.arrow_forward_ios), + onTap: () => showDialog( + context: context, + builder: (context) => const LogoutConfirmDialog(), + ), + ), + ], + ), + ), + ), + ], + ); + } + + @override + Future onRefresh(BuildContext context) async {} +} diff --git a/uni/lib/view/settings/widgets/locale_switch_button.dart b/uni/lib/view/settings/widgets/locale_switch_button.dart new file mode 100644 index 000000000..5b1963cbb --- /dev/null +++ b/uni/lib/view/settings/widgets/locale_switch_button.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:uni/view/locale_notifier.dart'; + +class LocaleSwitchButton extends StatelessWidget { + const LocaleSwitchButton({super.key}); + + @override + Widget build(BuildContext context) { + return Consumer( + builder: (context, localeNotifier, _) { + return ElevatedButton( + onPressed: () => localeNotifier.setNextLocale(), + child: Text( + localeNotifier.getLocale().localeCode.languageCode.toUpperCase(), + ), + ); + }, + ); + } +} diff --git a/uni/lib/view/settings/widgets/logout_confirm_dialog.dart b/uni/lib/view/settings/widgets/logout_confirm_dialog.dart new file mode 100644 index 000000000..2f632886f --- /dev/null +++ b/uni/lib/view/settings/widgets/logout_confirm_dialog.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni/view/navigation_service.dart'; + +class LogoutConfirmDialog extends StatelessWidget { + const LogoutConfirmDialog({super.key}); + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: Text(S.of(context).logout), + content: Text(S.of(context).confirm_logout), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(S.of(context).no), + ), + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + NavigationService.logoutAndPopHistory(); + }, + child: Text(S.of(context).yes), + ), + ], + ); + } +} diff --git a/uni/lib/view/settings/widgets/notifications_dialog.dart b/uni/lib/view/settings/widgets/notifications_dialog.dart new file mode 100644 index 000000000..f7bea693d --- /dev/null +++ b/uni/lib/view/settings/widgets/notifications_dialog.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; + +import 'package:uni/generated/l10n.dart'; +import 'package:uni/view/settings/widgets/tuition_notification_switch.dart'; + +class NotificationsDialog extends StatelessWidget { + const NotificationsDialog({super.key}); + + @override + 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(), + ), + ], + ), + ); + } +} diff --git a/uni/lib/view/settings/widgets/theme_switch_button.dart b/uni/lib/view/settings/widgets/theme_switch_button.dart new file mode 100644 index 000000000..21537c75c --- /dev/null +++ b/uni/lib/view/settings/widgets/theme_switch_button.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:uni/view/theme_notifier.dart'; + +class ThemeSwitchButton extends StatelessWidget { + const ThemeSwitchButton({super.key}); + + @override + Widget build(BuildContext context) { + return Consumer( + builder: (context, themeNotifier, _) { + final icon = switch (themeNotifier.getTheme()) { + ThemeMode.light => const Icon(Icons.wb_sunny), + ThemeMode.dark => const Icon(Icons.nightlight_round), + ThemeMode.system => const Icon(Icons.brightness_6), + }; + return ElevatedButton( + onPressed: themeNotifier.setNextTheme, + child: icon, + ); + }, + ); + } +} diff --git a/uni/lib/view/profile/widgets/tuition_notification_switch.dart b/uni/lib/view/settings/widgets/tuition_notification_switch.dart similarity index 100% rename from uni/lib/view/profile/widgets/tuition_notification_switch.dart rename to uni/lib/view/settings/widgets/tuition_notification_switch.dart diff --git a/uni/lib/view/settings/widgets/usage_stats_switch.dart b/uni/lib/view/settings/widgets/usage_stats_switch.dart new file mode 100644 index 000000000..54d1baa5b --- /dev/null +++ b/uni/lib/view/settings/widgets/usage_stats_switch.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:uni/controller/local_storage/app_shared_preferences.dart'; + +class UsageStatsSwitch extends StatefulWidget { + const UsageStatsSwitch({super.key}); + + @override + State createState() => _UsageStatsSwitchState(); +} + +class _UsageStatsSwitchState extends State { + bool usageStatsToggle = true; + + @override + void initState() { + super.initState(); + getUsageStatsToggle(); + } + + Future getUsageStatsToggle() async { + await AppSharedPreferences.getUsageStatsToggle() + .then((value) => setState(() => usageStatsToggle = value)); + } + + Future saveUsageStatsToggle({required bool value}) async { + await AppSharedPreferences.setUsageStatsToggle(value: value); + setState(() { + usageStatsToggle = value; + }); + } + + @override + Widget build(BuildContext context) { + return Switch.adaptive( + value: usageStatsToggle, + onChanged: (value) => saveUsageStatsToggle(value: value), + ); + } +} diff --git a/uni/pubspec.lock b/uni/pubspec.lock index 1ac709fa0..3c82202ea 100644 --- a/uni/pubspec.lock +++ b/uni/pubspec.lock @@ -109,10 +109,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + sha256: "67d591d602906ef9201caf93452495ad1812bea2074f04e25dbd7c133785821b" url: "https://pub.dev" source: hosted - version: "2.4.6" + version: "2.4.7" build_runner_core: dependency: transitive description: @@ -213,10 +213,10 @@ packages: dependency: "direct main" description: name: connectivity_plus - sha256: "94d51c6f1299133a2baa4c5c3d2c11ec7d7fb4768dee5c52a56f7d7522fcf70e" + sha256: "224a77051d52a11fbad53dd57827594d3bd24f945af28bd70bab376d68d437f0" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.0.2" connectivity_plus_platform_interface: dependency: transitive description: @@ -449,10 +449,10 @@ packages: dependency: "direct main" description: name: flutter_widget_from_html_core - sha256: a7dc9eb4bfdef4ea06d114528bf52a7efcdfc6ba46d933957c25067f17c1c6b4 + sha256: "86d40a9f26d10011664df057c950e9c348ee1a7dbf141f295a07b0075ffd780b" url: "https://pub.dev" source: hosted - version: "0.10.5" + version: "0.14.9" frontend_server_client: dependency: transitive description: @@ -866,26 +866,26 @@ packages: dependency: transitive description: name: sentry - sha256: "830667eadc0398fea3a3424ed1b74568e2db603a42758d0922e2f2974ce55a60" + sha256: e7ded42974bac5f69e4ca4ddc57d30499dd79381838f24b7e8fd9aa4139e7b79 url: "https://pub.dev" source: hosted - version: "7.10.1" + version: "7.13.2" sentry_flutter: dependency: "direct main" description: name: sentry_flutter - sha256: "6730f41b304c6fb0fa590dacccaf73ba11082fc64b274cfe8a79776f2b95309c" + sha256: d6f55ec7a1f681784165021f749007712a72ff57eadf91e963331b6ae326f089 url: "https://pub.dev" source: hosted - version: "7.10.1" + version: "7.13.2" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_android: dependency: transitive description: diff --git a/uni/pubspec.yaml b/uni/pubspec.yaml index 4a5dd2f55..9e2d230f6 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.7.18+208 +version: 1.7.25+215 environment: sdk: ">=3.0.0 <4.0.0" @@ -17,7 +17,7 @@ dependencies: add_2_calendar: ^2.2.5 cached_network_image: ^3.2.3 collection: ^1.16.0 - connectivity_plus: ^5.0.0 + connectivity_plus: ^5.0.2 crypto: ^3.0.1 cupertino_icons: ^1.0.2 currency_text_input_formatter: ^2.1.5 @@ -34,7 +34,7 @@ dependencies: flutter_map_marker_popup: ^5.0.0 flutter_markdown: ^0.6.0 flutter_svg: ^2.0.0+1 - flutter_widget_from_html_core: ^0.10.3 + flutter_widget_from_html_core: ^0.14.9 html: ^0.15.0 http: ^1.1.0 image: ^4.0.13 @@ -46,8 +46,8 @@ dependencies: path_provider: ^2.0.0 percent_indicator: ^4.2.2 provider: ^6.0.4 - sentry_flutter: ^7.9.0 - shared_preferences: ^2.0.3 + sentry_flutter: ^7.13.2 + shared_preferences: ^2.2.2 shimmer: ^3.0.0 sqflite: ^2.0.3 synchronized: ^3.0.0 @@ -57,7 +57,7 @@ dependencies: workmanager: ^0.5.2 dev_dependencies: - build_runner: ^2.4.6 + build_runner: ^2.4.7 flutter_launcher_icons: ^0.13.1 flutter_test: sdk: flutter