Skip to content

Commit

Permalink
Settings page and general UI tweaks (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes authored Dec 11, 2023
2 parents 273ef29 + 4c641bf commit 5ff3c92
Show file tree
Hide file tree
Showing 32 changed files with 612 additions and 340 deletions.
13 changes: 13 additions & 0 deletions uni/lib/controller/local_storage/app_shared_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -293,4 +294,16 @@ class AppSharedPreferences {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(tuitionNotificationsToggleKey, value);
}

static Future<bool> getUsageStatsToggle() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getBool(usageStatsToggleKey) ?? true;
}

static Future<void> setUsageStatsToggle({
required bool value,
}) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(usageStatsToggleKey, value);
}
}
15 changes: 12 additions & 3 deletions uni/lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ class MessageLookup extends MessageLookupByLibrary {
'calendario': 'Calendar',
'biblioteca': 'Library',
'uteis': 'Utils',
'sobre': 'About',
'bugs': 'Bugs/Suggestions',
'other': 'Other',
})}";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"about": MessageLookupByLibrary.simpleMessage("About us"),
"academic_services":
MessageLookupByLibrary.simpleMessage("Academic services"),
"account_card_title":
Expand Down Expand Up @@ -80,13 +79,17 @@ class MessageLookup extends MessageLookupByLibrary {
"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)"),
Expand Down Expand Up @@ -122,7 +125,7 @@ class MessageLookup extends MessageLookupByLibrary {
"fee_date":
MessageLookupByLibrary.simpleMessage("Deadline for next fee:"),
"fee_notification":
MessageLookupByLibrary.simpleMessage("Notify next deadline:"),
MessageLookupByLibrary.simpleMessage("Fee deadline"),
"first_year_registration": MessageLookupByLibrary.simpleMessage(
"Year of first registration: "),
"floor": MessageLookupByLibrary.simpleMessage("Floor"),
Expand All @@ -139,6 +142,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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":
Expand Down Expand Up @@ -195,6 +199,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -217,6 +222,8 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -226,6 +233,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -238,6 +246,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Face-to-face and telephone assistance"),
"telephone": MessageLookupByLibrary.simpleMessage("Telephone"),
"terms": MessageLookupByLibrary.simpleMessage("Terms and Conditions"),
"theme": MessageLookupByLibrary.simpleMessage("Theme"),
"title": MessageLookupByLibrary.simpleMessage("Title"),
"unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"),
"valid_email":
Expand Down
17 changes: 13 additions & 4 deletions uni/lib/generated/intl/messages_pt_PT.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ class MessageLookup extends MessageLookupByLibrary {
'calendario': 'Calendário',
'biblioteca': 'Biblioteca',
'uteis': 'Úteis',
'sobre': 'Sobre',
'bugs': 'Bugs e Sugestões',
'other': 'Outros',
})}";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"about": MessageLookupByLibrary.simpleMessage("Sobre nós"),
"academic_services":
MessageLookupByLibrary.simpleMessage("Serviços académicos"),
"account_card_title":
Expand Down Expand Up @@ -80,13 +79,17 @@ class MessageLookup extends MessageLookupByLibrary {
"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)"),
Expand Down Expand Up @@ -120,8 +123,8 @@ class MessageLookup extends MessageLookupByLibrary {
"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:"),
"fee_notification":
MessageLookupByLibrary.simpleMessage("Data limite de propina"),
"first_year_registration":
MessageLookupByLibrary.simpleMessage("Ano da primeira inscrição: "),
"floor": MessageLookupByLibrary.simpleMessage("Piso"),
Expand All @@ -139,6 +142,7 @@ class MessageLookup extends MessageLookupByLibrary {
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":
Expand Down Expand Up @@ -196,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -218,6 +223,8 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -227,6 +234,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
Expand All @@ -239,6 +247,7 @@ class MessageLookup extends MessageLookupByLibrary {
"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"),
"unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"),
"valid_email": MessageLookupByLibrary.simpleMessage(
Expand Down
88 changes: 83 additions & 5 deletions uni/lib/generated/l10n.dart

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

22 changes: 19 additions & 3 deletions uni/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {},
Expand Down Expand Up @@ -144,6 +154,8 @@
"@loading_terms": {},
"login": "Login",
"@login": {},
"settings": "Settings",
"@settings": {},
"logout": "Log out",
"@logout": {},
"menus": "Menus",
Expand All @@ -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": {},
Expand Down Expand Up @@ -263,5 +275,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": {}
}
Loading

0 comments on commit 5ff3c92

Please sign in to comment.