diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart new file mode 100644 index 000000000..e11aaca21 --- /dev/null +++ b/lib/generated/intl/messages_all.dart @@ -0,0 +1,62 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that looks up messages for specific locales by +// delegating to the appropriate library. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:implementation_imports, file_names, unnecessary_new +// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering +// ignore_for_file:argument_type_not_assignable, invalid_assignment +// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases +// ignore_for_file:comment_references + +import 'dart:async'; + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; +import 'package:intl/src/intl_helpers.dart'; + +import 'messages_en.dart' as messages_en; + +typedef Future LibraryLoader(); +Map _deferredLibraries = { + 'en': () => new Future.value(null), +}; + +MessageLookupByLibrary? _findExact(String localeName) { + switch (localeName) { + case 'en': + return messages_en.messages; + default: + return null; + } +} + +/// User programs should call this before using [localeName] for messages. +Future initializeMessages(String localeName) async { + var availableLocale = Intl.verifiedLocale( + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); + if (availableLocale == null) { + return new Future.value(false); + } + var lib = _deferredLibraries[availableLocale]; + await (lib == null ? new Future.value(false) : lib()); + initializeInternalMessageLookup(() => new CompositeMessageLookup()); + messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); + return new Future.value(true); +} + +bool _messagesExistFor(String locale) { + try { + return _findExact(locale) != null; + } catch (e) { + return false; + } +} + +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + if (actualLocale == null) return null; + return _findExact(actualLocale); +} diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart new file mode 100644 index 000000000..082ba0b8c --- /dev/null +++ b/lib/generated/intl/messages_en.dart @@ -0,0 +1,24 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that provides messages for a en locale. All the +// messages from the main program should be duplicated here with the same +// function name. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; + +final messages = new MessageLookup(); + +typedef String MessageIfAbsent(String messageStr, List args); + +class MessageLookup extends MessageLookupByLibrary { + String get localeName => 'en'; + + final messages = _notInlinedMessages(_notInlinedMessages); + static _notInlinedMessages(_) => {}; +} diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart new file mode 100644 index 000000000..561ebd560 --- /dev/null +++ b/lib/generated/l10n.dart @@ -0,0 +1,78 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'intl/messages_all.dart'; + +// ************************************************************************** +// Generator: Flutter Intl IDE plugin +// Made by Localizely +// ************************************************************************** + +// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars +// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each +// ignore_for_file: avoid_redundant_argument_values + +class S { + S(); + + static S? _current; + + static S get current { + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + return _current!; + } + + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); + + static Future load(Locale locale) { + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); + return initializeMessages(localeName).then((_) { + Intl.defaultLocale = localeName; + final instance = S(); + S._current = instance; + + return instance; + }); + } + + static S of(BuildContext context) { + final instance = S.maybeOf(context); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + return instance!; + } + + static S? maybeOf(BuildContext context) { + return Localizations.of(context, S); + } +} + +class AppLocalizationDelegate extends LocalizationsDelegate { + const AppLocalizationDelegate(); + + List get supportedLocales { + return const [ + Locale.fromSubtags(languageCode: 'en'), + ]; + } + + @override + bool isSupported(Locale locale) => _isSupported(locale); + @override + Future load(Locale locale) => S.load(locale); + @override + bool shouldReload(AppLocalizationDelegate old) => false; + + bool _isSupported(Locale locale) { + for (var supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale.languageCode) { + return true; + } + } + return false; + } +} diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/lib/l10n/intl_en.arb @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/uni_app/assets/images/personal_info.png b/packages/uni_app/assets/images/personal_info.png new file mode 100644 index 000000000..820f552ee Binary files /dev/null and b/packages/uni_app/assets/images/personal_info.png differ diff --git a/packages/uni_app/lib/controller/fetchers/profile_info_fetcher.dart b/packages/uni_app/lib/controller/fetchers/profile_info_fetcher.dart new file mode 100644 index 000000000..03239b084 --- /dev/null +++ b/packages/uni_app/lib/controller/fetchers/profile_info_fetcher.dart @@ -0,0 +1,39 @@ +import 'package:uni/controller/fetchers/session_dependant_fetcher.dart'; +import 'package:uni/controller/networking/network_router.dart'; +import 'package:uni/controller/parsers/parser_profile_info.dart'; +import 'package:uni/model/entities/profile_info.dart'; +import 'package:uni/session/flows/base/session.dart'; + +class ProfileInfoFetcher implements SessionDependantFetcher { + @override + List getEndpoints(Session session) { + final url = NetworkRouter.getBaseUrlsFromSession( + session, + )[0]; // user profile is the same on all faculties + return [url]; + } + + /// Returns the user's [ProfileInfo]. + static Future fetchProfileInfo(Session session) async { + final now = DateTime.now(); + final dummy = + '${now.year}-${now.month}-${now.day}T${now.hour}:${now.minute}:${now.second}.${now.millisecond}Z'; + final urlProfileInfo = + '${NetworkRouter.getBaseUrlsFromSession(session, languageSensitive: true)[0]}' + 'fest_geral.info_pessoal_view?'; + final responseProfileInfo = await NetworkRouter.getWithCookies( + urlProfileInfo, + {'pv_num_unico': session.username, 'pv_dummy': dummy}, + session, + ); + + if (responseProfileInfo.statusCode != 200) { + return null; + } + final data = parseProfileDetails(responseProfileInfo); + + final profileInfo = ProfileInfo.fromList(data); + + return profileInfo; + } +} diff --git a/packages/uni_app/lib/controller/local_storage/database/database.dart b/packages/uni_app/lib/controller/local_storage/database/database.dart index f3a9ee4ac..51ff9249f 100644 --- a/packages/uni_app/lib/controller/local_storage/database/database.dart +++ b/packages/uni_app/lib/controller/local_storage/database/database.dart @@ -10,6 +10,7 @@ import 'package:uni/model/entities/lecture.dart'; import 'package:uni/model/entities/meal.dart'; import 'package:uni/model/entities/news.dart'; import 'package:uni/model/entities/profile.dart'; +import 'package:uni/model/entities/profile_info.dart'; import 'package:uni/model/entities/reference.dart'; import 'package:uni/model/entities/restaurant.dart'; import 'package:uni/objectbox.g.dart'; @@ -35,43 +36,50 @@ class Database { late final Box _mealBox; late final Box _newsBox; late final Box _profileBox; + late final Box _profileInfoBox; List get exams => _examBox.getAll(); - void saveExams(List exams) => saveEntities(_examBox, exams); + Future saveExams(List exams) => saveEntities(_examBox, exams); List get news => _newsBox.getAll(); - void saveNews(List news) => saveEntities(_newsBox, news); + Future saveNews(List news) => saveEntities(_newsBox, news); List get lectures => _lectureBox.getAll(); - void saveLectures(List lectures) => + Future saveLectures(List lectures) => saveEntities(_lectureBox, lectures); List get calendarEvents => _calendarBox.getAll(); - void saveCalendarEvents(List calendarEvents) => + Future saveCalendarEvents(List calendarEvents) => saveEntities(_calendarBox, calendarEvents); List get courseUnits => _courseUnitBox.getAll(); - void saveCourseUnits(List courseUnits) => + Future saveCourseUnits(List courseUnits) => saveEntities(_courseUnitBox, courseUnits); List get courses => _courseBox.getAll(); - void saveCourses(List courses) => saveEntities(_courseBox, courses); + Future saveCourses(List courses) => + saveEntities(_courseBox, courses); List get libraryOccupations => _libraryOccupationBox.getAll(); - void saveLibraryOccupations(List libraryOccupations) => - saveEntities(_libraryOccupationBox, libraryOccupations); + Future saveLibraryOccupations( + List libraryOccupations, + ) => saveEntities(_libraryOccupationBox, libraryOccupations); List get references => _referenceBox.getAll(); - void saveReferences(List references) => + Future saveReferences(List references) => saveEntities(_referenceBox, references); List get restaurants => _restaurantBox.getAll(); - void saveRestaurants(List restaurants) => + Future saveRestaurants(List restaurants) => saveEntities(_restaurantBox, restaurants); Profile? get profile => _profileBox.getAll().firstOrNull; - void saveProfile(Profile profile) => saveEntity(_profileBox, profile); + Future saveProfile(Profile profile) => saveEntity(_profileBox, profile); + + ProfileInfo? get profileInfo => _profileInfoBox.getAll().firstOrNull; + Future saveProfileInfo(ProfileInfo profileInfo) => + saveEntity(_profileInfoBox, profileInfo); /// Whether the session is persistent or not. bool? _persistentSession; @@ -119,6 +127,7 @@ class Database { void _boxesInitialization() { _profileBox = _store.box(); + _profileInfoBox = _store.box(); _examBox = _store.box(); _lectureBox = _store.box(); _calendarBox = _store.box(); @@ -133,6 +142,7 @@ class Database { void clear() { _profileBox.removeAll(); + _profileInfoBox.removeAll(); _examBox.removeAll(); _lectureBox.removeAll(); _calendarBox.removeAll(); diff --git a/packages/uni_app/lib/controller/parsers/parser_profile_info.dart b/packages/uni_app/lib/controller/parsers/parser_profile_info.dart new file mode 100644 index 000000000..28d09f870 --- /dev/null +++ b/packages/uni_app/lib/controller/parsers/parser_profile_info.dart @@ -0,0 +1,41 @@ +import 'package:html/parser.dart' show parse; +import 'package:http/http.dart' as http; + +List> parseProfileDetails(http.Response response) { + final document = parse(response.body); + final tables = document.querySelectorAll('table'); + final List>> eachTable = []; + + for (final tableRaw in tables) { + final table = tableRaw + .querySelectorAll('td') + .map((cell) => cell.text.trim().replaceAll(':', '')) + .where((cell) => cell.isNotEmpty) + .toList(); + final List> tableWithPairs = []; + if (table.length.isOdd) { + table.removeLast(); + } + for (var i = 0; i < table.length; i += 2) { + final key = table[i]; + final value = table[i + 1]; + final cleanedKey = key.endsWith(':') + ? key.substring(0, key.length - 1) + : key; + tableWithPairs.add([cleanedKey, value]); + } + + eachTable.add(tableWithPairs); + } + + final List> result = []; + + for (final tableInList in eachTable) { + final tableInMap = { + for (final element in tableInList) element[0]: element[1], + }; + result.add(tableInMap); + } + + return result; +} diff --git a/packages/uni_app/lib/generated/intl/messages_en.dart b/packages/uni_app/lib/generated/intl/messages_en.dart index d46e7c889..484ad2716 100644 --- a/packages/uni_app/lib/generated/intl/messages_en.dart +++ b/packages/uni_app/lib/generated/intl/messages_en.dart @@ -49,6 +49,7 @@ class MessageLookup extends MessageLookupByLibrary { "add_restaurants": MessageLookupByLibrary.simpleMessage("Add restaurants"), "add_to_calendar": MessageLookupByLibrary.simpleMessage("Add to calendar"), "add_widget": MessageLookupByLibrary.simpleMessage("Add widget"), + "addresses": MessageLookupByLibrary.simpleMessage("Addresses"), "agree_terms": MessageLookupByLibrary.simpleMessage( "By entering you agree with these", ), @@ -138,6 +139,7 @@ class MessageLookup extends MessageLookupByLibrary { "I consent to this information being reviewed by NIAEFEUP and may be deleted at my request.", ), "contact": MessageLookupByLibrary.simpleMessage("Contact (optional)"), + "contacts": MessageLookupByLibrary.simpleMessage("Contacts"), "copy_center": MessageLookupByLibrary.simpleMessage("Copy center"), "copy_center_building": MessageLookupByLibrary.simpleMessage( "Floor -1 of building B | AEFEUP building", @@ -244,6 +246,9 @@ class MessageLookup extends MessageLookupByLibrary { "goi": MessageLookupByLibrary.simpleMessage( "Orientation and Integration Office", ), + "identification_documents": MessageLookupByLibrary.simpleMessage( + "Identification Documents", + ), "improvement_registration": MessageLookupByLibrary.simpleMessage( "Enrollment for Improvement", ), @@ -286,6 +291,8 @@ class MessageLookup extends MessageLookupByLibrary { "multimedia_center": MessageLookupByLibrary.simpleMessage( "Multimedia center", ), + "nationalities": MessageLookupByLibrary.simpleMessage("Nationalities"), + "nationality": MessageLookupByLibrary.simpleMessage("Nationality"), "nav_title": m3, "news": MessageLookupByLibrary.simpleMessage("News"), "no": MessageLookupByLibrary.simpleMessage("No"), @@ -353,6 +360,9 @@ class MessageLookup extends MessageLookupByLibrary { "no_info": MessageLookupByLibrary.simpleMessage( "There is no information to display", ), + "no_info_description": MessageLookupByLibrary.simpleMessage( + "Try to refresh the page", + ), "no_internet": MessageLookupByLibrary.simpleMessage( "It looks like you\'re offline", ), @@ -503,6 +513,9 @@ class MessageLookup extends MessageLookupByLibrary { ), "unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"), "until": MessageLookupByLibrary.simpleMessage("Until"), + "user_informations": MessageLookupByLibrary.simpleMessage( + "Personal Information", + ), "valid_email": MessageLookupByLibrary.simpleMessage( "Please enter a valid email", ), diff --git a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart index 8b45709a3..a82729526 100644 --- a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart +++ b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart @@ -53,6 +53,7 @@ class MessageLookup extends MessageLookupByLibrary { "Adicionar ao calendário", ), "add_widget": MessageLookupByLibrary.simpleMessage("Adicionar widget"), + "addresses": MessageLookupByLibrary.simpleMessage("Moradas"), "agree_terms": MessageLookupByLibrary.simpleMessage( "Ao entrares confirmas que concordas com estes", ), @@ -146,6 +147,7 @@ class MessageLookup extends MessageLookupByLibrary { "Consinto que esta informação seja revista pelo NIAEFEUP, podendo ser eliminada a meu pedido.", ), "contact": MessageLookupByLibrary.simpleMessage("Contacto (opcional)"), + "contacts": MessageLookupByLibrary.simpleMessage("Contactos Gerais"), "copy_center": MessageLookupByLibrary.simpleMessage("Centro de cópias"), "copy_center_building": MessageLookupByLibrary.simpleMessage( "Piso -1 do edifício B | Edifício da AEFEUP", @@ -256,6 +258,9 @@ class MessageLookup extends MessageLookupByLibrary { "goi": MessageLookupByLibrary.simpleMessage( "Gabinete de Orientação e Integração", ), + "identification_documents": MessageLookupByLibrary.simpleMessage( + "Documentos de Identificação", + ), "improvement_registration": MessageLookupByLibrary.simpleMessage( "Inscrição para Melhoria", ), @@ -298,6 +303,8 @@ class MessageLookup extends MessageLookupByLibrary { "multimedia_center": MessageLookupByLibrary.simpleMessage( "Centro de multimédia", ), + "nationalities": MessageLookupByLibrary.simpleMessage("Nacionalidades"), + "nationality": MessageLookupByLibrary.simpleMessage("Nacionalidade"), "nav_title": m3, "news": MessageLookupByLibrary.simpleMessage("Notícias"), "no": MessageLookupByLibrary.simpleMessage("Não"), @@ -373,6 +380,9 @@ class MessageLookup extends MessageLookupByLibrary { "no_info": MessageLookupByLibrary.simpleMessage( "Não existem informações para apresentar", ), + "no_info_description": MessageLookupByLibrary.simpleMessage( + "Tenta refrescar a página", + ), "no_internet": MessageLookupByLibrary.simpleMessage( "Parece que estás offline", ), @@ -531,6 +541,9 @@ class MessageLookup extends MessageLookupByLibrary { ), "unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"), "until": MessageLookupByLibrary.simpleMessage("Até"), + "user_informations": MessageLookupByLibrary.simpleMessage( + "Informações Pessoais", + ), "valid_email": MessageLookupByLibrary.simpleMessage( "Por favor insere um email válido", ), diff --git a/packages/uni_app/lib/generated/l10n.dart b/packages/uni_app/lib/generated/l10n.dart index 2f83c2931..27fab32f7 100644 --- a/packages/uni_app/lib/generated/l10n.dart +++ b/packages/uni_app/lib/generated/l10n.dart @@ -399,6 +399,11 @@ class S { ); } + /// `Contacts` + String get contacts { + return Intl.message('Contacts', name: 'contacts', desc: '', args: []); + } + /// `Copy center` String get copy_center { return Intl.message('Copy center', name: 'copy_center', desc: '', args: []); @@ -1473,6 +1478,16 @@ class S { return Intl.message('Unavailable', name: 'unavailable', desc: '', args: []); } + /// `Personal Information` + String get user_informations { + return Intl.message( + 'Personal Information', + name: 'user_informations', + desc: '', + args: [], + ); + } + /// `Please enter a valid email` String get valid_email { return Intl.message( @@ -1951,6 +1966,46 @@ class S { ); } + /// `Nationalities` + String get nationalities { + return Intl.message( + 'Nationalities', + name: 'nationalities', + desc: '', + args: [], + ); + } + + /// `Nationality` + String get nationality { + return Intl.message('Nationality', name: 'nationality', desc: '', args: []); + } + + /// `Identification Documents` + String get identification_documents { + return Intl.message( + 'Identification Documents', + name: 'identification_documents', + desc: '', + args: [], + ); + } + + /// `Addresses` + String get addresses { + return Intl.message('Addresses', name: 'addresses', desc: '', args: []); + } + + /// `Try to refresh the page` + String get no_info_description { + return Intl.message( + 'Try to refresh the page', + name: 'no_info_description', + desc: '', + args: [], + ); + } + /// `No classes have been assigned to this course unit yet` String get no_course_unit_classes { return Intl.message( diff --git a/packages/uni_app/lib/l10n/intl_en.arb b/packages/uni_app/lib/l10n/intl_en.arb index b19e4cd39..d449ffc26 100644 --- a/packages/uni_app/lib/l10n/intl_en.arb +++ b/packages/uni_app/lib/l10n/intl_en.arb @@ -88,6 +88,8 @@ "@consent": {}, "contact": "Contact (optional)", "@contact": {}, + "contacts": "Contacts", + "@contacts": {}, "copy_center": "Copy center", "@copy_center": {}, "copy_center_building": "Floor -1 of building B | AEFEUP building", @@ -346,6 +348,8 @@ "@uc_info": {}, "unavailable": "Unavailable", "@unavailable": {}, + "user_informations": "Personal Information", + "@user_informations": {}, "valid_email": "Please enter a valid email", "@valid_email": {}, "widget_prompt": "Choose a widget to add to your personal area:", @@ -466,6 +470,16 @@ "@services": {}, "goi": "Orientation and Integration Office", "@goi": {}, + "nationalities": "Nationalities", + "@nationalities": {}, + "nationality": "Nationality", + "@nationality": {}, + "identification_documents": "Identification Documents", + "@identification_documents": {}, + "addresses": "Addresses", + "@addresses": {}, + "no_info_description": "Try to refresh the page", + "@no_info_description": {}, "no_course_unit_classes": "No classes have been assigned to this course unit yet", "@no_course_unit_classes": {}, "no_course_unit_info": "This course unit has no information available yet", diff --git a/packages/uni_app/lib/l10n/intl_pt_PT.arb b/packages/uni_app/lib/l10n/intl_pt_PT.arb index 255d763ba..e86329700 100644 --- a/packages/uni_app/lib/l10n/intl_pt_PT.arb +++ b/packages/uni_app/lib/l10n/intl_pt_PT.arb @@ -90,6 +90,8 @@ "@consent": {}, "contact": "Contacto (opcional)", "@contact": {}, + "contacts": "Contactos", + "@contacts": {}, "copy_center": "Centro de cópias", "@copy_center": {}, "copy_center_building": "Piso -1 do edifício B | Edifício da AEFEUP", @@ -346,6 +348,8 @@ "@uc_info": {}, "unavailable": "Indisponível", "@unavailable": {}, + "user_informations": "Informações Pessoais", + "@user_informations": {}, "valid_email": "Por favor insere um email válido", "@valid_email": {}, "widget_prompt": "Escolhe um widget para adicionares à tua área pessoal:", @@ -466,12 +470,24 @@ "@services": {}, "goi": "Gabinete de Orientação e Integração", "@goi": {}, + "nationalities": "Nacionalidades", + "@nationalities": {}, + "nationality": "Nacionalidade", + "@nationality": {}, + "identification_documents": "Documentos de Identificação", + "@identification_documents": {}, + "contacts": "Contactos Gerais", + "@contacts": {}, + "addresses": "Moradas", + "@addresses": {}, "no_course_unit_classes": "Não foram atribuídas turmas a esta unidade curricular", "@no_course_unit_classes": {}, "no_course_unit_info": "Esta unidade curricular ainda não tem informação disponível", "@no_course_unit_info": {}, "unable_to_load_data": "Não foi possível carregar dados", "@unable_to_load_data": {}, + "no_info_description": "Tenta refrescar a página", + "@no_info_description": {}, "pedagogical_surveys": "Inquéritos Pedagógicos", "@pedagogical_surveys": {}, "pedagogical_surveys_description": "Já preencheste os inquéritos pedagógicos? Se ainda não, por favor tira um momento para os preencher. O teu feedback é valioso e ajuda a melhorar a qualidade do ensino do teu curso.", diff --git a/packages/uni_app/lib/main.dart b/packages/uni_app/lib/main.dart index 9dba5145e..e4330471b 100644 --- a/packages/uni_app/lib/main.dart +++ b/packages/uni_app/lib/main.dart @@ -34,6 +34,7 @@ import 'package:uni/view/locale_notifier.dart'; import 'package:uni/view/login/login.dart'; import 'package:uni/view/map/map.dart'; import 'package:uni/view/profile/profile.dart'; +import 'package:uni/view/profile_info/profile_info.dart'; import 'package:uni/view/restaurant/restaurant_page_view.dart'; import 'package:uni/view/splash/splash.dart'; import 'package:uni/view/widgets/page_transition.dart'; @@ -251,6 +252,11 @@ class ApplicationState extends ConsumerState { page: CourseUnitDetailPageView(courseUnit!), settings: settings, ), + '/${NavigationItem.navProfileInfo.route}': () => + PageTransition.makePageTransition( + page: const ProfileInfoPageView(), + settings: settings, + ), }; final builder = transitionFunctions[settings.name]; diff --git a/packages/uni_app/lib/model/entities/profile_info.dart b/packages/uni_app/lib/model/entities/profile_info.dart new file mode 100644 index 000000000..2999caa11 --- /dev/null +++ b/packages/uni_app/lib/model/entities/profile_info.dart @@ -0,0 +1,86 @@ +import 'dart:convert'; +import 'package:objectbox/objectbox.dart'; + +/// Stores information about the user's profile. +@Entity() +class ProfileInfo { + ProfileInfo({ + this.id = 0, + this.dbProfileInfo = '{}', + this.dbNationalities = '{}', + this.dbIdentification = '{}', + this.dbContacts = '{}', + this.dbAddresses = '{}', + }); + + factory ProfileInfo.fromList(List> list) { + return ProfileInfo( + dbProfileInfo: jsonEncode(list.isNotEmpty ? list[0] : {}), + dbNationalities: jsonEncode( + list.length > 1 ? list[1] : {}, + ), + dbIdentification: jsonEncode( + list.length > 2 ? list[2] : {}, + ), + dbContacts: jsonEncode(list.length > 3 ? list[3] : {}), + dbAddresses: jsonEncode(list.length > 4 ? list[4] : {}), + ); + } + + @Id() + int id; + + String dbProfileInfo; + String dbNationalities; + String dbIdentification; + String dbContacts; + String dbAddresses; + + @Transient() + Map get profileInfo => + Map.castFrom( + jsonDecode(dbProfileInfo) as Map, + ); + set profileInfo(Map value) => + dbProfileInfo = jsonEncode(value); + + @Transient() + Map get nationalities => + Map.castFrom( + jsonDecode(dbNationalities) as Map, + ); + set nationalities(Map value) => + dbNationalities = jsonEncode(value); + + @Transient() + Map get identification => + Map.castFrom( + jsonDecode(dbIdentification) as Map, + ); + set identification(Map value) => + dbIdentification = jsonEncode(value); + + @Transient() + Map get contacts => + Map.castFrom( + jsonDecode(dbContacts) as Map, + ); + set contacts(Map value) => dbContacts = jsonEncode(value); + + @Transient() + Map get addresses => + Map.castFrom( + jsonDecode(dbAddresses) as Map, + ); + set addresses(Map value) => dbAddresses = jsonEncode(value); + + List<(String, Map)> keymapValues() { + return [ + ('profileInfo', profileInfo), + ('nationalities', nationalities), + ('identification', identification), + ('contacts', contacts), + ('addresses', addresses), + ]; + } +} diff --git a/packages/uni_app/lib/model/providers/riverpod/course_units_info_provider.dart b/packages/uni_app/lib/model/providers/riverpod/course_units_info_provider.dart index f2d817ea7..15217c2a0 100644 --- a/packages/uni_app/lib/model/providers/riverpod/course_units_info_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/course_units_info_provider.dart @@ -256,7 +256,7 @@ class CourseUnitsInfoNotifier } } } - } catch (e) { + } catch (err) { continue; } } diff --git a/packages/uni_app/lib/model/providers/riverpod/exam_provider.dart b/packages/uni_app/lib/model/providers/riverpod/exam_provider.dart index 21823ba8f..66e4801b8 100644 --- a/packages/uni_app/lib/model/providers/riverpod/exam_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/exam_provider.dart @@ -40,7 +40,7 @@ class ExamNotifier extends CachedAsyncNotifier> { final exams = await ExamFetcher(profile.courseUnits).extractExams(session); exams.sort((exam1, exam2) => exam1.start.compareTo(exam2.start)); - Database().saveExams(exams); + await Database().saveExams(exams); return exams; } } diff --git a/packages/uni_app/lib/model/providers/riverpod/faculty_locations_provider.dart b/packages/uni_app/lib/model/providers/riverpod/faculty_locations_provider.dart index 92e791f94..db8868f41 100644 --- a/packages/uni_app/lib/model/providers/riverpod/faculty_locations_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/faculty_locations_provider.dart @@ -20,7 +20,7 @@ class FacultyLocationsNotifier @override Future> loadFromRemote() { - //since locations are stored in assets, we don't need internet for this. + // since locations are stored in assets, we don't need internet for this. return LocationFetcherAsset().getLocations(); } } diff --git a/packages/uni_app/lib/model/providers/riverpod/lecture_provider.dart b/packages/uni_app/lib/model/providers/riverpod/lecture_provider.dart index e9f8d2b46..1b1d568e5 100644 --- a/packages/uni_app/lib/model/providers/riverpod/lecture_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/lecture_provider.dart @@ -31,11 +31,11 @@ class LectureNotifier extends CachedAsyncNotifier> { final lectures = (await _getLectures(session)).toSet().toList(); try { - Database().saveLectures(lectures); - } catch (e, st) { + await Database().saveLectures(lectures); + } catch (err, st) { Logger().e( 'Failed to save lectures to local database', - error: e, + error: err, stackTrace: st, ); } diff --git a/packages/uni_app/lib/model/providers/riverpod/library_occupation_provider.dart b/packages/uni_app/lib/model/providers/riverpod/library_occupation_provider.dart index be0b2ec51..8880b4352 100644 --- a/packages/uni_app/lib/model/providers/riverpod/library_occupation_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/library_occupation_provider.dart @@ -25,11 +25,11 @@ final class LibraryOccupationNotifier @override Future loadFromRemote() async { - //try to fetch from internet + // try to fetch from internet final occupation = await LibraryOccupationFetcher().getLibraryOccupation(); - //if success save to database - Database().saveLibraryOccupations(occupation.floors); + // if success save to database + await Database().saveLibraryOccupations(occupation.floors); return occupation; } diff --git a/packages/uni_app/lib/model/providers/riverpod/news_provider.dart b/packages/uni_app/lib/model/providers/riverpod/news_provider.dart index dc318092d..7c79c3fba 100644 --- a/packages/uni_app/lib/model/providers/riverpod/news_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/news_provider.dart @@ -20,7 +20,7 @@ class NewsNotifier extends CachedAsyncNotifier?> { @override Future> loadFromRemote() async { final news = await fetchNews(); - Database().saveNews(news); + await Database().saveNews(news); return news; } } diff --git a/packages/uni_app/lib/model/providers/riverpod/profile_info_provider.dart b/packages/uni_app/lib/model/providers/riverpod/profile_info_provider.dart new file mode 100644 index 000000000..9d6d2af59 --- /dev/null +++ b/packages/uni_app/lib/model/providers/riverpod/profile_info_provider.dart @@ -0,0 +1,52 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:uni/controller/fetchers/profile_info_fetcher.dart'; +import 'package:uni/controller/local_storage/database/database.dart'; +import 'package:uni/model/entities/profile_info.dart'; +import 'package:uni/model/providers/riverpod/cached_async_notifier.dart'; +import 'package:uni/model/providers/riverpod/session_provider.dart'; +import 'package:uni/session/flows/base/session.dart'; + +final profileInfoProvider = + AsyncNotifierProvider( + ProfileInfoNotifier.new, + ); + +class ProfileInfoNotifier extends CachedAsyncNotifier { + @override + Duration? get cacheDuration => const Duration(days: 30); + + @override + Future loadFromStorage() async { + final profileInfo = Database().profileInfo; + + return profileInfo; + } + + @override + Future loadFromRemote() async { + final session = await ref.read(sessionProvider.future); + if (session == null) { + return null; + } + + // try to fetch all data from internet + final profileInfo = await _fetchUserInfo(session); + if (profileInfo == null) { + return null; + } + + // if successful save everything to cache + await Database().saveProfileInfo(profileInfo); + + return profileInfo; + } + + Future _fetchUserInfo(Session session) async { + final profileInfo = await ProfileInfoFetcher.fetchProfileInfo(session); + if (profileInfo == null) { + return null; + } + + return profileInfo; + } +} diff --git a/packages/uni_app/lib/model/providers/riverpod/profile_provider.dart b/packages/uni_app/lib/model/providers/riverpod/profile_provider.dart index 1865826c4..dc71768b3 100644 --- a/packages/uni_app/lib/model/providers/riverpod/profile_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/profile_provider.dart @@ -42,7 +42,7 @@ class ProfileNotifier extends CachedAsyncNotifier { return null; } - //try to fetch all data from internet + // try to fetch all data from internet final profile = await _fetchUserInfo(session); if (profile == null) { return null; @@ -71,7 +71,7 @@ class ProfileNotifier extends CachedAsyncNotifier { PreferencesController.shouldShowPedagogicalSurveysDialog(); // if successful save everything to cache - Database().saveProfile(profile); + await Database().saveProfile(profile); return profile; } @@ -102,8 +102,8 @@ class ProfileNotifier extends CachedAsyncNotifier { ); if (allCourseUnits != null) { - Database().saveCourses(profile.courses); - Database().saveCourseUnits(allCourseUnits); + await Database().saveCourses(profile.courses); + await Database().saveCourseUnits(allCourseUnits); } return allCourseUnits; diff --git a/packages/uni_app/lib/model/providers/riverpod/restaurant_provider.dart b/packages/uni_app/lib/model/providers/riverpod/restaurant_provider.dart index 3c0890683..32bdbc62e 100644 --- a/packages/uni_app/lib/model/providers/riverpod/restaurant_provider.dart +++ b/packages/uni_app/lib/model/providers/riverpod/restaurant_provider.dart @@ -27,11 +27,11 @@ class RestaurantNotifier extends CachedAsyncNotifier?> { return null; } - //try to fetch from the internet + // try to fetch from the internet final restaurants = await RestaurantFetcher().getRestaurants(session); - //if success save to database - Database().saveRestaurants(restaurants); + // if success save to database + await Database().saveRestaurants(restaurants); return restaurants; } diff --git a/packages/uni_app/lib/objectbox-model.json b/packages/uni_app/lib/objectbox-model.json index aaac7c0fb..b26e0cfef 100644 --- a/packages/uni_app/lib/objectbox-model.json +++ b/packages/uni_app/lib/objectbox-model.json @@ -4,27 +4,27 @@ "_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.", "entities": [ { - "id": "1:8433064441398452856", - "lastPropertyId": "4:513168983912717896", + "id": "1:5302605391467104440", + "lastPropertyId": "4:5797193138877681335", "name": "CalendarEvent", "properties": [ { - "id": "1:7486026848397696840", + "id": "1:5503077758349165", "name": "name", "type": 9 }, { - "id": "2:3671646895456891136", + "id": "2:7357483879645154786", "name": "startDate", "type": 10 }, { - "id": "3:5024673501620615181", + "id": "3:4969646617027653778", "name": "endDate", "type": 10 }, { - "id": "4:513168983912717896", + "id": "4:5797193138877681335", "name": "uniqueId", "type": 6, "flags": 1 @@ -33,58 +33,58 @@ "relations": [] }, { - "id": "2:6255920829998343914", - "lastPropertyId": "10:961244772353001235", + "id": "2:4315467723036850752", + "lastPropertyId": "10:3077254944509581302", "name": "Course", "properties": [ { - "id": "1:613504880024009748", + "id": "1:6742583233811479684", "name": "id", "type": 6, "flags": 129 }, { - "id": "2:5727093430514372181", + "id": "2:8651818331666752326", "name": "festId", "type": 6 }, { - "id": "3:5978258367696042659", + "id": "3:4772153436933285027", "name": "name", "type": 9 }, { - "id": "4:7724304633294559622", + "id": "4:985953530638408558", "name": "abbreviation", "type": 9 }, { - "id": "5:7295580769000628550", + "id": "5:1914709668910806860", "name": "currYear", "type": 9 }, { - "id": "6:1796501827767720559", + "id": "6:2860104212007092639", "name": "firstEnrollment", "type": 6 }, { - "id": "7:2840372378950542939", + "id": "7:187800101097391645", "name": "faculty", "type": 9 }, { - "id": "8:2201102876981640663", + "id": "8:2056145371444161964", "name": "state", "type": 9 }, { - "id": "9:9150862467323502539", + "id": "9:1111011935334371861", "name": "finishedEcts", "type": 8 }, { - "id": "10:961244772353001235", + "id": "10:3077254944509581302", "name": "currentAverage", "type": 8 } @@ -92,112 +92,166 @@ "relations": [] }, { - "id": "3:8214580190937133698", - "lastPropertyId": "16:5977232238826302161", + "id": "3:7263491283156097496", + "lastPropertyId": "16:3033994229299603667", "name": "CourseUnit", "properties": [ { - "id": "1:2253776073825088003", + "id": "1:6810706505131706599", "name": "id", "type": 6, "flags": 129 }, { - "id": "2:3935341434608929928", + "id": "2:4622608213853414662", "name": "code", "type": 9 }, { - "id": "3:2598021670133571802", + "id": "3:6376017859393648726", "name": "abbreviation", "type": 9 }, { - "id": "4:2550072549928863575", + "id": "4:1509960349788473622", "name": "name", "type": 9 }, { - "id": "5:7270666108556881750", + "id": "5:6666028993308151148", "name": "curricularYear", "type": 6 }, { - "id": "6:3023610039425825294", + "id": "6:5420757909315157398", "name": "occurrId", "type": 6 }, { - "id": "7:8511895207792407376", + "id": "7:1761504252405887777", "name": "semesterCode", "type": 9 }, { - "id": "8:4839823113645245964", + "id": "8:4380389448840884911", "name": "semesterName", "type": 9 }, { - "id": "9:2495682496492504714", + "id": "9:310075277709484279", "name": "type", "type": 9 }, { - "id": "10:7238947967828141626", + "id": "10:8813062319973056539", "name": "status", "type": 9 }, { - "id": "11:8139946415046279091", + "id": "11:6079439784483057307", "name": "grade", "type": 9 }, { - "id": "12:6187261196262916832", + "id": "12:4281452734915971467", "name": "ectsGrade", "type": 9 }, { - "id": "13:2897110313869122670", + "id": "13:3791606578840953923", "name": "result", "type": 9 }, { - "id": "14:591464439888426636", + "id": "14:5358362792184218322", + "name": "ects", + "type": 8 + }, + { + "id": "15:2465659758248901500", "name": "festId", "type": 6 }, { - "id": "15:2817971108358835885", + "id": "16:3033994229299603667", "name": "schoolYear", "type": 9 + } + ], + "relations": [] + }, + { + "id": "4:7971984820205642133", + "lastPropertyId": "9:372533802605469321", + "name": "Exam", + "properties": [ + { + "id": "1:281983176820095774", + "name": "start", + "type": 10 }, { - "id": "16:5977232238826302161", - "name": "ects", - "type": 8 + "id": "2:3247433705133311353", + "name": "finish", + "type": 10 + }, + { + "id": "3:1744673006593456038", + "name": "id", + "type": 9 + }, + { + "id": "4:8892438397441606429", + "name": "subjectAcronym", + "type": 9 + }, + { + "id": "5:793011350351970788", + "name": "subject", + "type": 9 + }, + { + "id": "6:3761694166108867558", + "name": "rooms", + "type": 30 + }, + { + "id": "7:3691752375694619268", + "name": "examType", + "type": 9 + }, + { + "id": "8:4945285468225389477", + "name": "occurrId", + "type": 9 + }, + { + "id": "9:372533802605469321", + "name": "dbId", + "type": 6, + "flags": 1 } ], "relations": [] }, { - "id": "5:3662266281288419262", - "lastPropertyId": "3:686576101048946938", + "id": "5:7963613868686569285", + "lastPropertyId": "3:5420251642333408075", "name": "FloorOccupation", "properties": [ { - "id": "1:4621395315858749483", + "id": "1:4992200964824919170", "name": "number", "type": 6, "flags": 129 }, { - "id": "2:1076696553155564834", + "id": "2:2084540709976072336", "name": "occupation", "type": 6 }, { - "id": "3:686576101048946938", + "id": "3:5420251642333408075", "name": "capacity", "type": 6 } @@ -205,68 +259,68 @@ "relations": [] }, { - "id": "6:1226039642817714958", - "lastPropertyId": "12:2133201273068889544", + "id": "6:1461318235647317622", + "lastPropertyId": "12:5152759235045438995", "name": "Lecture", "properties": [ { - "id": "1:759370965955861957", + "id": "1:6701748320494041795", "name": "uniqueId", "type": 6, "flags": 1 }, { - "id": "2:7062500116814451026", + "id": "2:5731470226248978882", "name": "acronym", "type": 9 }, { - "id": "3:5263364803383053946", + "id": "3:4792314729920034712", "name": "subject", "type": 9 }, { - "id": "4:7533944378053275558", + "id": "4:8845650491247381445", "name": "typeClass", "type": 9 }, { - "id": "5:5294596055999853088", + "id": "5:7945458042326213101", "name": "room", "type": 9 }, { - "id": "6:5867958853439024806", + "id": "6:5148074725148522794", "name": "teacher", "type": 9 }, { - "id": "7:7842774665774825279", + "id": "7:4053641709659475685", "name": "teacherName", "type": 9 }, { - "id": "8:2803834092189108043", + "id": "8:3480832395393684098", "name": "teacherId", "type": 6 }, { - "id": "9:4865841025734468779", + "id": "9:9139730659474983427", "name": "classNumber", "type": 9 }, { - "id": "10:1472641118525183499", + "id": "10:244389858596388621", "name": "startTime", "type": 10 }, { - "id": "11:3443162639035322988", + "id": "11:2404503561347115222", "name": "endTime", "type": 10 }, { - "id": "12:2133201273068889544", + "id": "12:5152759235045438995", "name": "occurrId", "type": 6 } @@ -274,90 +328,124 @@ "relations": [] }, { - "id": "7:1600806775073131844", - "lastPropertyId": "7:8203753070348115332", + "id": "7:2758409591693259312", + "lastPropertyId": "7:2910283670887119070", "name": "Meal", "properties": [ { - "id": "1:9170741951979078808", + "id": "1:3953646381678908874", "name": "id", "type": 6, "flags": 1 }, { - "id": "2:8873289557542576008", + "id": "2:1155059277153967278", "name": "type", "type": 9 }, { - "id": "3:3661344739186856128", + "id": "3:1461467095868872351", "name": "namePt", "type": 9 }, { - "id": "4:1263802476016082853", + "id": "4:9111362011587212228", "name": "nameEn", "type": 9 }, { - "id": "5:6143062850301903507", + "id": "5:609742110755467921", + "name": "dbDayOfWeek", + "type": 6 + }, + { + "id": "6:2025321705760792585", "name": "date", "type": 10 }, { - "id": "6:2491917120285294168", + "id": "7:2910283670887119070", "name": "restaurantId", - "indexId": "1:860778994234728762", + "indexId": "1:6559110197396702796", "type": 11, "flags": 520, "relationTarget": "Restaurant" + } + ], + "relations": [] + }, + { + "id": "8:4853540030964354142", + "lastPropertyId": "5:389016429589472186", + "name": "News", + "properties": [ + { + "id": "1:4290014196748812725", + "name": "id", + "type": 6, + "flags": 1 }, { - "id": "7:8203753070348115332", - "name": "dbDayOfWeek", - "type": 6 + "id": "2:4437344577422499083", + "name": "title", + "type": 9 + }, + { + "id": "3:6348957780887855361", + "name": "description", + "type": 9 + }, + { + "id": "4:5854310086759254728", + "name": "image", + "type": 9 + }, + { + "id": "5:389016429589472186", + "name": "link", + "type": 9 } ], "relations": [] }, { - "id": "8:5892835885906588151", - "lastPropertyId": "7:5380446091846266850", + "id": "9:2667456385677078406", + "lastPropertyId": "7:1947507333062357966", "name": "Profile", "properties": [ { - "id": "1:617296174571961246", + "id": "1:4202980778803173935", "name": "id", "type": 6, "flags": 1 }, { - "id": "2:7942989141198800933", + "id": "2:1875064955468583380", "name": "name", "type": 9 }, { - "id": "3:6337113120302229827", + "id": "3:6865404374902221804", "name": "email", "type": 9 }, { - "id": "4:4546371605322217842", + "id": "4:4415847556907978648", "name": "printBalance", "type": 9 }, { - "id": "5:4157885067992705268", + "id": "5:4851136016534324414", "name": "feesBalance", "type": 9 }, { - "id": "6:3994951413998147073", + "id": "6:7157791953379904424", "name": "feesLimit", "type": 10 }, { - "id": "7:5380446091846266850", + "id": "7:1947507333062357966", "name": "answeredPedagogicalSurveys", "type": 1 } @@ -365,38 +453,77 @@ "relations": [] }, { - "id": "9:5094931065199645551", - "lastPropertyId": "6:3264787483906970751", + "id": "10:922783939952528203", + "lastPropertyId": "6:2830288554895083365", + "name": "ProfileInfo", + "properties": [ + { + "id": "1:8569900553789516116", + "name": "id", + "type": 6, + "flags": 1 + }, + { + "id": "2:5828169048906513518", + "name": "dbProfileInfo", + "type": 9 + }, + { + "id": "3:3465265641240967824", + "name": "dbNationalities", + "type": 9 + }, + { + "id": "4:7007012828787970201", + "name": "dbIdentification", + "type": 9 + }, + { + "id": "5:6301870427040977068", + "name": "dbContacts", + "type": 9 + }, + { + "id": "6:2830288554895083365", + "name": "dbAddresses", + "type": 9 + } + ], + "relations": [] + }, + { + "id": "11:6554512570041553083", + "lastPropertyId": "6:1116133550396136368", "name": "Reference", "properties": [ { - "id": "1:2725070122282783949", + "id": "1:3134271021568886242", "name": "id", "type": 6, "flags": 1 }, { - "id": "2:3696036906817439496", + "id": "2:7269934126227896914", "name": "description", "type": 9 }, { - "id": "3:3616899723767103362", + "id": "3:7588914179532198782", "name": "limitDate", "type": 10 }, { - "id": "4:2968235157363378927", + "id": "4:3618283678110075128", "name": "entity", "type": 6 }, { - "id": "5:4991227288258034933", + "id": "5:1691845377865886513", "name": "reference", "type": 6 }, { - "id": "6:3264787483906970751", + "id": "6:1116133550396136368", "name": "amount", "type": 8 } @@ -404,192 +531,79 @@ "relations": [] }, { - "id": "10:3321826961057235514", - "lastPropertyId": "11:3291647992299716809", + "id": "12:4484109055609216657", + "lastPropertyId": "11:4921430619914457967", "name": "Restaurant", "properties": [ { - "id": "1:3346959339317794721", + "id": "1:5020520903882099143", "name": "uniqueId", "type": 6, "flags": 1 }, { - "id": "2:2229596616814563275", + "id": "2:8477170474939315457", "name": "id", "type": 6 }, { - "id": "3:5028102306153135128", + "id": "3:5413761272654987267", "name": "typePt", "type": 9 }, { - "id": "4:6028624645721986145", + "id": "4:1034465791282995058", "name": "typeEn", "type": 9 }, { - "id": "5:1294103232513190814", + "id": "5:2869448469764434889", "name": "namePt", "type": 9 }, { - "id": "6:4498193186466725742", + "id": "6:1137441946919859693", "name": "nameEn", "type": 9 }, { - "id": "7:408072625498193958", + "id": "7:3809521740651135171", "name": "period", "type": 9 }, { - "id": "8:3110109544161090174", - "name": "reference", - "type": 9 - }, - { - "id": "9:1874674258003398941", - "name": "openingHours", - "type": 30 - }, - { - "id": "10:4766416763141335510", - "name": "email", - "type": 9 - }, - { - "id": "11:3291647992299716809", + "id": "8:3151754287089188606", "name": "campusId", "type": 6 - } - ], - "relations": [] - }, - { - "id": "11:6737946482330485890", - "lastPropertyId": "5:3080427417569816128", - "name": "News", - "properties": [ - { - "id": "1:6901086034113728774", - "name": "id", - "type": 6, - "flags": 1 - }, - { - "id": "2:5841942946880606349", - "name": "title", - "type": 9 - }, - { - "id": "3:7308991078768361909", - "name": "description", - "type": 9 - }, - { - "id": "4:9015797628589992550", - "name": "image", - "type": 9 }, { - "id": "5:3080427417569816128", - "name": "link", - "type": 9 - } - ], - "relations": [] - }, - { - "id": "13:6490444939705629128", - "lastPropertyId": "10:8007243344551155313", - "name": "Exam", - "properties": [ - { - "id": "1:156478052443479597", - "name": "start", - "type": 10 - }, - { - "id": "2:6221939923983776269", - "name": "finish", - "type": 10 - }, - { - "id": "3:7872921544934032039", - "name": "id", - "type": 9 - }, - { - "id": "4:1796550337519661183", - "name": "subjectAcronym", - "type": 9 - }, - { - "id": "5:6065589177224784387", - "name": "subject", + "id": "9:4109386476443343797", + "name": "reference", "type": 9 }, { - "id": "6:6688485810784861801", - "name": "rooms", + "id": "10:2961108682807961565", + "name": "openingHours", "type": 30 }, { - "id": "7:8558475996860160266", - "name": "examType", - "type": 9 - }, - { - "id": "9:3233632092608389517", - "name": "occurrId", + "id": "11:4921430619914457967", + "name": "email", "type": 9 - }, - { - "id": "10:8007243344551155313", - "name": "dbId", - "type": 6, - "flags": 1 } ], "relations": [] } ], - "lastEntityId": "13:6490444939705629128", - "lastIndexId": "1:860778994234728762", + "lastEntityId": "12:4484109055609216657", + "lastIndexId": "1:6559110197396702796", "lastRelationId": "0:0", "lastSequenceId": "0:0", "modelVersion": 5, "modelVersionParserMinimum": 5, - "retiredEntityUids": [ - 7433696585737747799, - 2134435878788098394 - ], + "retiredEntityUids": [], "retiredIndexUids": [], - "retiredPropertyUids": [ - 6987337288438589113, - 1315405305605818236, - 3970356124527746475, - 219584084854926435, - 2999963298892952116, - 8584035388144963725, - 3581020021394973372, - 5477126519043307170, - 2707328368115093876, - 1565565007615085610, - 3449964008339683749, - 3051965366602037426, - 2529474153044582513, - 8904716583028535510, - 4642934423200130776, - 6318243260289414891, - 2568050699050704594, - 6912083259861338117, - 6333156226926030205, - 5485256109039678113, - 3014197187509270418 - ], + "retiredPropertyUids": [], "retiredRelationUids": [], "version": 1 } \ No newline at end of file diff --git a/packages/uni_app/lib/objectbox.g.dart b/packages/uni_app/lib/objectbox.g.dart index 1144bb020..445d5d664 100644 --- a/packages/uni_app/lib/objectbox.g.dart +++ b/packages/uni_app/lib/objectbox.g.dart @@ -23,6 +23,7 @@ import 'model/entities/lecture.dart'; import 'model/entities/meal.dart'; import 'model/entities/news.dart'; import 'model/entities/profile.dart'; +import 'model/entities/profile_info.dart'; import 'model/entities/reference.dart'; import 'model/entities/restaurant.dart'; @@ -30,31 +31,31 @@ export 'package:objectbox/objectbox.dart'; // so that callers only have to impor final _entities = [ obx_int.ModelEntity( - id: const obx_int.IdUid(1, 8433064441398452856), + id: const obx_int.IdUid(1, 5302605391467104440), name: 'CalendarEvent', - lastPropertyId: const obx_int.IdUid(4, 513168983912717896), + lastPropertyId: const obx_int.IdUid(4, 5797193138877681335), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 7486026848397696840), + id: const obx_int.IdUid(1, 5503077758349165), name: 'name', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 3671646895456891136), + id: const obx_int.IdUid(2, 7357483879645154786), name: 'startDate', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 5024673501620615181), + id: const obx_int.IdUid(3, 4969646617027653778), name: 'endDate', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 513168983912717896), + id: const obx_int.IdUid(4, 5797193138877681335), name: 'uniqueId', type: 6, flags: 1, @@ -64,67 +65,67 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(2, 6255920829998343914), + id: const obx_int.IdUid(2, 4315467723036850752), name: 'Course', - lastPropertyId: const obx_int.IdUid(10, 961244772353001235), + lastPropertyId: const obx_int.IdUid(10, 3077254944509581302), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 613504880024009748), + id: const obx_int.IdUid(1, 6742583233811479684), name: 'id', type: 6, flags: 129, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 5727093430514372181), + id: const obx_int.IdUid(2, 8651818331666752326), name: 'festId', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 5978258367696042659), + id: const obx_int.IdUid(3, 4772153436933285027), name: 'name', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 7724304633294559622), + id: const obx_int.IdUid(4, 985953530638408558), name: 'abbreviation', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 7295580769000628550), + id: const obx_int.IdUid(5, 1914709668910806860), name: 'currYear', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 1796501827767720559), + id: const obx_int.IdUid(6, 2860104212007092639), name: 'firstEnrollment', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 2840372378950542939), + id: const obx_int.IdUid(7, 187800101097391645), name: 'faculty', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(8, 2201102876981640663), + id: const obx_int.IdUid(8, 2056145371444161964), name: 'state', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(9, 9150862467323502539), + id: const obx_int.IdUid(9, 1111011935334371861), name: 'finishedEcts', type: 8, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(10, 961244772353001235), + id: const obx_int.IdUid(10, 3077254944509581302), name: 'currentAverage', type: 8, flags: 0, @@ -134,131 +135,195 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(3, 8214580190937133698), + id: const obx_int.IdUid(3, 7263491283156097496), name: 'CourseUnit', - lastPropertyId: const obx_int.IdUid(16, 5977232238826302161), + lastPropertyId: const obx_int.IdUid(16, 3033994229299603667), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 2253776073825088003), + id: const obx_int.IdUid(1, 6810706505131706599), name: 'id', type: 6, flags: 129, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 3935341434608929928), + id: const obx_int.IdUid(2, 4622608213853414662), name: 'code', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 2598021670133571802), + id: const obx_int.IdUid(3, 6376017859393648726), name: 'abbreviation', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 2550072549928863575), + id: const obx_int.IdUid(4, 1509960349788473622), name: 'name', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 7270666108556881750), + id: const obx_int.IdUid(5, 6666028993308151148), name: 'curricularYear', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 3023610039425825294), + id: const obx_int.IdUid(6, 5420757909315157398), name: 'occurrId', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 8511895207792407376), + id: const obx_int.IdUid(7, 1761504252405887777), name: 'semesterCode', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(8, 4839823113645245964), + id: const obx_int.IdUid(8, 4380389448840884911), name: 'semesterName', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(9, 2495682496492504714), + id: const obx_int.IdUid(9, 310075277709484279), name: 'type', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(10, 7238947967828141626), + id: const obx_int.IdUid(10, 8813062319973056539), name: 'status', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(11, 8139946415046279091), + id: const obx_int.IdUid(11, 6079439784483057307), name: 'grade', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(12, 6187261196262916832), + id: const obx_int.IdUid(12, 4281452734915971467), name: 'ectsGrade', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(13, 2897110313869122670), + id: const obx_int.IdUid(13, 3791606578840953923), name: 'result', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(14, 591464439888426636), + id: const obx_int.IdUid(14, 5358362792184218322), + name: 'ects', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(15, 2465659758248901500), name: 'festId', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(15, 2817971108358835885), + id: const obx_int.IdUid(16, 3033994229299603667), name: 'schoolYear', type: 9, flags: 0, ), + ], + relations: [], + backlinks: [], + ), + obx_int.ModelEntity( + id: const obx_int.IdUid(4, 7971984820205642133), + name: 'Exam', + lastPropertyId: const obx_int.IdUid(9, 372533802605469321), + flags: 0, + properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(16, 5977232238826302161), - name: 'ects', - type: 8, + id: const obx_int.IdUid(1, 281983176820095774), + name: 'start', + type: 10, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 3247433705133311353), + name: 'finish', + type: 10, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 1744673006593456038), + name: 'id', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 8892438397441606429), + name: 'subjectAcronym', + type: 9, flags: 0, ), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 793011350351970788), + name: 'subject', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 3761694166108867558), + name: 'rooms', + type: 30, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 3691752375694619268), + name: 'examType', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 4945285468225389477), + name: 'occurrId', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(9, 372533802605469321), + name: 'dbId', + type: 6, + flags: 1, + ), ], relations: [], backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(5, 3662266281288419262), + id: const obx_int.IdUid(5, 7963613868686569285), name: 'FloorOccupation', - lastPropertyId: const obx_int.IdUid(3, 686576101048946938), + lastPropertyId: const obx_int.IdUid(3, 5420251642333408075), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 4621395315858749483), + id: const obx_int.IdUid(1, 4992200964824919170), name: 'number', type: 6, flags: 129, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1076696553155564834), + id: const obx_int.IdUid(2, 2084540709976072336), name: 'occupation', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 686576101048946938), + id: const obx_int.IdUid(3, 5420251642333408075), name: 'capacity', type: 6, flags: 0, @@ -268,79 +333,79 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(6, 1226039642817714958), + id: const obx_int.IdUid(6, 1461318235647317622), name: 'Lecture', - lastPropertyId: const obx_int.IdUid(12, 2133201273068889544), + lastPropertyId: const obx_int.IdUid(12, 5152759235045438995), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 759370965955861957), + id: const obx_int.IdUid(1, 6701748320494041795), name: 'uniqueId', type: 6, flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 7062500116814451026), + id: const obx_int.IdUid(2, 5731470226248978882), name: 'acronym', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 5263364803383053946), + id: const obx_int.IdUid(3, 4792314729920034712), name: 'subject', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 7533944378053275558), + id: const obx_int.IdUid(4, 8845650491247381445), name: 'typeClass', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 5294596055999853088), + id: const obx_int.IdUid(5, 7945458042326213101), name: 'room', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 5867958853439024806), + id: const obx_int.IdUid(6, 5148074725148522794), name: 'teacher', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 7842774665774825279), + id: const obx_int.IdUid(7, 4053641709659475685), name: 'teacherName', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(8, 2803834092189108043), + id: const obx_int.IdUid(8, 3480832395393684098), name: 'teacherId', type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(9, 4865841025734468779), + id: const obx_int.IdUid(9, 9139730659474983427), name: 'classNumber', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(10, 1472641118525183499), + id: const obx_int.IdUid(10, 244389858596388621), name: 'startTime', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(11, 3443162639035322988), + id: const obx_int.IdUid(11, 2404503561347115222), name: 'endTime', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(12, 2133201273068889544), + id: const obx_int.IdUid(12, 5152759235045438995), name: 'occurrId', type: 6, flags: 0, @@ -350,54 +415,94 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(7, 1600806775073131844), + id: const obx_int.IdUid(7, 2758409591693259312), name: 'Meal', - lastPropertyId: const obx_int.IdUid(7, 8203753070348115332), + lastPropertyId: const obx_int.IdUid(7, 2910283670887119070), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 9170741951979078808), + id: const obx_int.IdUid(1, 3953646381678908874), name: 'id', type: 6, flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 8873289557542576008), + id: const obx_int.IdUid(2, 1155059277153967278), name: 'type', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 3661344739186856128), + id: const obx_int.IdUid(3, 1461467095868872351), name: 'namePt', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 1263802476016082853), + id: const obx_int.IdUid(4, 9111362011587212228), name: 'nameEn', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 6143062850301903507), + id: const obx_int.IdUid(5, 609742110755467921), + name: 'dbDayOfWeek', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 2025321705760792585), name: 'date', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 2491917120285294168), + id: const obx_int.IdUid(7, 2910283670887119070), name: 'restaurantId', type: 11, flags: 520, - indexId: const obx_int.IdUid(1, 860778994234728762), + indexId: const obx_int.IdUid(1, 6559110197396702796), relationField: 'restaurant', relationTarget: 'Restaurant', ), + ], + relations: [], + backlinks: [], + ), + obx_int.ModelEntity( + id: const obx_int.IdUid(8, 4853540030964354142), + name: 'News', + lastPropertyId: const obx_int.IdUid(5, 389016429589472186), + flags: 0, + properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(7, 8203753070348115332), - name: 'dbDayOfWeek', + id: const obx_int.IdUid(1, 4290014196748812725), + name: 'id', type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 4437344577422499083), + name: 'title', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 6348957780887855361), + name: 'description', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 5854310086759254728), + name: 'image', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 389016429589472186), + name: 'link', + type: 9, flags: 0, ), ], @@ -405,49 +510,49 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(8, 5892835885906588151), + id: const obx_int.IdUid(9, 2667456385677078406), name: 'Profile', - lastPropertyId: const obx_int.IdUid(7, 5380446091846266850), + lastPropertyId: const obx_int.IdUid(7, 1947507333062357966), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 617296174571961246), + id: const obx_int.IdUid(1, 4202980778803173935), name: 'id', type: 6, flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 7942989141198800933), + id: const obx_int.IdUid(2, 1875064955468583380), name: 'name', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 6337113120302229827), + id: const obx_int.IdUid(3, 6865404374902221804), name: 'email', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 4546371605322217842), + id: const obx_int.IdUid(4, 4415847556907978648), name: 'printBalance', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 4157885067992705268), + id: const obx_int.IdUid(5, 4851136016534324414), name: 'feesBalance', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 3994951413998147073), + id: const obx_int.IdUid(6, 7157791953379904424), name: 'feesLimit', type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 5380446091846266850), + id: const obx_int.IdUid(7, 1947507333062357966), name: 'answeredPedagogicalSurveys', type: 1, flags: 0, @@ -457,45 +562,45 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(9, 5094931065199645551), - name: 'Reference', - lastPropertyId: const obx_int.IdUid(6, 3264787483906970751), + id: const obx_int.IdUid(10, 922783939952528203), + name: 'ProfileInfo', + lastPropertyId: const obx_int.IdUid(6, 2830288554895083365), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 2725070122282783949), + id: const obx_int.IdUid(1, 8569900553789516116), name: 'id', type: 6, flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 3696036906817439496), - name: 'description', + id: const obx_int.IdUid(2, 5828169048906513518), + name: 'dbProfileInfo', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 3616899723767103362), - name: 'limitDate', - type: 10, + id: const obx_int.IdUid(3, 3465265641240967824), + name: 'dbNationalities', + type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 2968235157363378927), - name: 'entity', - type: 6, + id: const obx_int.IdUid(4, 7007012828787970201), + name: 'dbIdentification', + type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 4991227288258034933), - name: 'reference', - type: 6, + id: const obx_int.IdUid(5, 6301870427040977068), + name: 'dbContacts', + type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 3264787483906970751), - name: 'amount', - type: 8, + id: const obx_int.IdUid(6, 2830288554895083365), + name: 'dbAddresses', + type: 9, flags: 0, ), ], @@ -503,190 +608,132 @@ final _entities = [ backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(10, 3321826961057235514), - name: 'Restaurant', - lastPropertyId: const obx_int.IdUid(11, 3291647992299716809), + id: const obx_int.IdUid(11, 6554512570041553083), + name: 'Reference', + lastPropertyId: const obx_int.IdUid(6, 1116133550396136368), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3346959339317794721), - name: 'uniqueId', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 2229596616814563275), + id: const obx_int.IdUid(1, 3134271021568886242), name: 'id', type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 5028102306153135128), - name: 'typePt', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 6028624645721986145), - name: 'typeEn', - type: 9, - flags: 0, + flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 1294103232513190814), - name: 'namePt', + id: const obx_int.IdUid(2, 7269934126227896914), + name: 'description', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 4498193186466725742), - name: 'nameEn', - type: 9, + id: const obx_int.IdUid(3, 7588914179532198782), + name: 'limitDate', + type: 10, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 408072625498193958), - name: 'period', - type: 9, + id: const obx_int.IdUid(4, 3618283678110075128), + name: 'entity', + type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(8, 3110109544161090174), + id: const obx_int.IdUid(5, 1691845377865886513), name: 'reference', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(9, 1874674258003398941), - name: 'openingHours', - type: 30, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(10, 4766416763141335510), - name: 'email', - type: 9, + type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(11, 3291647992299716809), - name: 'campusId', - type: 6, + id: const obx_int.IdUid(6, 1116133550396136368), + name: 'amount', + type: 8, flags: 0, ), ], relations: [], - backlinks: [ - obx_int.ModelBacklink( - name: 'meals', - srcEntity: 'Meal', - srcField: 'restaurant', - ), - ], + backlinks: [], ), obx_int.ModelEntity( - id: const obx_int.IdUid(11, 6737946482330485890), - name: 'News', - lastPropertyId: const obx_int.IdUid(5, 3080427417569816128), + id: const obx_int.IdUid(12, 4484109055609216657), + name: 'Restaurant', + lastPropertyId: const obx_int.IdUid(11, 4921430619914457967), flags: 0, properties: [ obx_int.ModelProperty( - id: const obx_int.IdUid(1, 6901086034113728774), - name: 'id', + id: const obx_int.IdUid(1, 5020520903882099143), + name: 'uniqueId', type: 6, flags: 1, ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 5841942946880606349), - name: 'title', - type: 9, + id: const obx_int.IdUid(2, 8477170474939315457), + name: 'id', + type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7308991078768361909), - name: 'description', + id: const obx_int.IdUid(3, 5413761272654987267), + name: 'typePt', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 9015797628589992550), - name: 'image', + id: const obx_int.IdUid(4, 1034465791282995058), + name: 'typeEn', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 3080427417569816128), - name: 'link', + id: const obx_int.IdUid(5, 2869448469764434889), + name: 'namePt', type: 9, flags: 0, ), - ], - relations: [], - backlinks: [], - ), - obx_int.ModelEntity( - id: const obx_int.IdUid(13, 6490444939705629128), - name: 'Exam', - lastPropertyId: const obx_int.IdUid(10, 8007243344551155313), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 156478052443479597), - name: 'start', - type: 10, - flags: 0, - ), obx_int.ModelProperty( - id: const obx_int.IdUid(2, 6221939923983776269), - name: 'finish', - type: 10, + id: const obx_int.IdUid(6, 1137441946919859693), + name: 'nameEn', + type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7872921544934032039), - name: 'id', + id: const obx_int.IdUid(7, 3809521740651135171), + name: 'period', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(4, 1796550337519661183), - name: 'subjectAcronym', - type: 9, + id: const obx_int.IdUid(8, 3151754287089188606), + name: 'campusId', + type: 6, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(5, 6065589177224784387), - name: 'subject', + id: const obx_int.IdUid(9, 4109386476443343797), + name: 'reference', type: 9, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(6, 6688485810784861801), - name: 'rooms', + id: const obx_int.IdUid(10, 2961108682807961565), + name: 'openingHours', type: 30, flags: 0, ), obx_int.ModelProperty( - id: const obx_int.IdUid(7, 8558475996860160266), - name: 'examType', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(9, 3233632092608389517), - name: 'occurrId', + id: const obx_int.IdUid(11, 4921430619914457967), + name: 'email', type: 9, flags: 0, ), - obx_int.ModelProperty( - id: const obx_int.IdUid(10, 8007243344551155313), - name: 'dbId', - type: 6, - flags: 1, - ), ], relations: [], - backlinks: [], + backlinks: [ + obx_int.ModelBacklink( + name: 'meals', + srcEntity: 'Meal', + srcField: 'restaurant', + ), + ], ), ]; @@ -733,35 +780,13 @@ obx_int.ModelDefinition getObjectBoxModel() { // Typically, this is done with `dart run build_runner build`. generatorVersion: obx_int.GeneratorVersion.v2025_12_16, entities: _entities, - lastEntityId: const obx_int.IdUid(13, 6490444939705629128), - lastIndexId: const obx_int.IdUid(1, 860778994234728762), + lastEntityId: const obx_int.IdUid(12, 4484109055609216657), + lastIndexId: const obx_int.IdUid(1, 6559110197396702796), lastRelationId: const obx_int.IdUid(0, 0), lastSequenceId: const obx_int.IdUid(0, 0), - retiredEntityUids: const [7433696585737747799, 2134435878788098394], + retiredEntityUids: const [], retiredIndexUids: const [], - retiredPropertyUids: const [ - 6987337288438589113, - 1315405305605818236, - 3970356124527746475, - 219584084854926435, - 2999963298892952116, - 8584035388144963725, - 3581020021394973372, - 5477126519043307170, - 2707328368115093876, - 1565565007615085610, - 3449964008339683749, - 3051965366602037426, - 2529474153044582513, - 8904716583028535510, - 4642934423200130776, - 6318243260289414891, - 2568050699050704594, - 6912083259861338117, - 6333156226926030205, - 5485256109039678113, - 3014197187509270418, - ], + retiredPropertyUids: const [], retiredRelationUids: const [], modelVersion: 5, modelVersionParserMinimum: 5, @@ -971,9 +996,9 @@ obx_int.ModelDefinition getObjectBoxModel() { fbb.addOffset(10, gradeOffset); fbb.addOffset(11, ectsGradeOffset); fbb.addOffset(12, resultOffset); - fbb.addInt64(13, object.festId); - fbb.addOffset(14, schoolYearOffset); - fbb.addFloat64(15, object.ects); + fbb.addFloat64(13, object.ects); + fbb.addInt64(14, object.festId); + fbb.addOffset(15, schoolYearOffset); fbb.finish(fbb.endTable()); return object.id ?? 0; }, @@ -1028,15 +1053,15 @@ obx_int.ModelDefinition getObjectBoxModel() { final ectsParam = const fb.Float64Reader().vTableGetNullable( buffer, rootOffset, - 34, + 30, ); final schoolYearParam = const fb.StringReader( asciiOptimization: true, - ).vTableGetNullable(buffer, rootOffset, 32); + ).vTableGetNullable(buffer, rootOffset, 34); final festIdParam = const fb.Int64Reader().vTableGetNullable( buffer, rootOffset, - 30, + 32, ); final object = CourseUnit( abbreviation: abbreviationParam, @@ -1060,19 +1085,97 @@ obx_int.ModelDefinition getObjectBoxModel() { return object; }, ), - FloorOccupation: obx_int.EntityDefinition( + Exam: obx_int.EntityDefinition( model: _entities[3], - toOneRelations: (FloorOccupation object) => [], - toManyRelations: (FloorOccupation object) => {}, - getId: (FloorOccupation object) => object.number, - setId: (FloorOccupation object, int id) { - object.number = id; + toOneRelations: (Exam object) => [], + toManyRelations: (Exam object) => {}, + getId: (Exam object) => object.dbId, + setId: (Exam object, int id) { + object.dbId = id; }, - objectToFB: (FloorOccupation object, fb.Builder fbb) { - fbb.startTable(4); - fbb.addInt64(0, object.number); - fbb.addInt64(1, object.occupation); - fbb.addInt64(2, object.capacity); + objectToFB: (Exam object, fb.Builder fbb) { + final idOffset = fbb.writeString(object.id); + final subjectAcronymOffset = fbb.writeString(object.subjectAcronym); + final subjectOffset = fbb.writeString(object.subject); + final roomsOffset = fbb.writeList( + object.rooms.map(fbb.writeString).toList(growable: false), + ); + final examTypeOffset = fbb.writeString(object.examType); + final occurrIdOffset = fbb.writeString(object.occurrId); + fbb.startTable(10); + fbb.addInt64(0, object.start.millisecondsSinceEpoch); + fbb.addInt64(1, object.finish.millisecondsSinceEpoch); + fbb.addOffset(2, idOffset); + fbb.addOffset(3, subjectAcronymOffset); + fbb.addOffset(4, subjectOffset); + fbb.addOffset(5, roomsOffset); + fbb.addOffset(6, examTypeOffset); + fbb.addOffset(7, occurrIdOffset); + fbb.addInt64(8, object.dbId ?? 0); + fbb.finish(fbb.endTable()); + return object.dbId ?? 0; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final idParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 8, ''); + final startParam = DateTime.fromMillisecondsSinceEpoch( + const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0), + ); + final finishParam = DateTime.fromMillisecondsSinceEpoch( + const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0), + ); + final subjectAcronymParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 10, ''); + final subjectParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 12, ''); + final roomsParam = const fb.ListReader( + fb.StringReader(asciiOptimization: true), + lazy: false, + ).vTableGet(buffer, rootOffset, 14, []); + final examTypeParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 16, ''); + final occurrIdParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 18, ''); + final object = + Exam( + idParam, + startParam, + finishParam, + subjectAcronymParam, + subjectParam, + roomsParam, + examTypeParam, + occurrIdParam, + ) + ..dbId = const fb.Int64Reader().vTableGetNullable( + buffer, + rootOffset, + 20, + ); + + return object; + }, + ), + FloorOccupation: obx_int.EntityDefinition( + model: _entities[4], + toOneRelations: (FloorOccupation object) => [], + toManyRelations: (FloorOccupation object) => {}, + getId: (FloorOccupation object) => object.number, + setId: (FloorOccupation object, int id) { + object.number = id; + }, + objectToFB: (FloorOccupation object, fb.Builder fbb) { + fbb.startTable(4); + fbb.addInt64(0, object.number); + fbb.addInt64(1, object.occupation); + fbb.addInt64(2, object.capacity); fbb.finish(fbb.endTable()); return object.number; }, @@ -1107,7 +1210,7 @@ obx_int.ModelDefinition getObjectBoxModel() { }, ), Lecture: obx_int.EntityDefinition( - model: _entities[4], + model: _entities[5], toOneRelations: (Lecture object) => [], toManyRelations: (Lecture object) => {}, getId: (Lecture object) => object.uniqueId, @@ -1204,7 +1307,7 @@ obx_int.ModelDefinition getObjectBoxModel() { }, ), Meal: obx_int.EntityDefinition( - model: _entities[5], + model: _entities[6], toOneRelations: (Meal object) => [object.restaurant], toManyRelations: (Meal object) => {}, getId: (Meal object) => object.id, @@ -1220,9 +1323,9 @@ obx_int.ModelDefinition getObjectBoxModel() { fbb.addOffset(1, typeOffset); fbb.addOffset(2, namePtOffset); fbb.addOffset(3, nameEnOffset); - fbb.addInt64(4, object.date.millisecondsSinceEpoch); - fbb.addInt64(5, object.restaurant.targetId); - fbb.addInt64(6, object.dbDayOfWeek); + fbb.addInt64(4, object.dbDayOfWeek); + fbb.addInt64(5, object.date.millisecondsSinceEpoch); + fbb.addInt64(6, object.restaurant.targetId); fbb.finish(fbb.endTable()); return object.id ?? 0; }, @@ -1239,12 +1342,12 @@ obx_int.ModelDefinition getObjectBoxModel() { asciiOptimization: true, ).vTableGet(buffer, rootOffset, 10, ''); final dateParam = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0), + const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0), ); final dbDayOfWeekParam = const fb.Int64Reader().vTableGet( buffer, rootOffset, - 16, + 12, 0, ); final object = Meal( @@ -1257,15 +1360,69 @@ obx_int.ModelDefinition getObjectBoxModel() { object.restaurant.targetId = const fb.Int64Reader().vTableGet( buffer, rootOffset, - 14, + 16, 0, ); object.restaurant.attach(store); return object; }, ), + News: obx_int.EntityDefinition( + model: _entities[7], + toOneRelations: (News object) => [], + toManyRelations: (News object) => {}, + getId: (News object) => object.id, + setId: (News object, int id) { + object.id = id; + }, + objectToFB: (News object, fb.Builder fbb) { + final titleOffset = fbb.writeString(object.title); + final descriptionOffset = fbb.writeString(object.description); + final imageOffset = fbb.writeString(object.image); + final linkOffset = fbb.writeString(object.link); + fbb.startTable(6); + fbb.addInt64(0, object.id); + fbb.addOffset(1, titleOffset); + fbb.addOffset(2, descriptionOffset); + fbb.addOffset(3, imageOffset); + fbb.addOffset(4, linkOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final idParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 4, + 0, + ); + final titleParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 6, ''); + final descriptionParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 8, ''); + final imageParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 10, ''); + final linkParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 12, ''); + final object = News( + id: idParam, + title: titleParam, + description: descriptionParam, + image: imageParam, + link: linkParam, + ); + + return object; + }, + ), Profile: obx_int.EntityDefinition( - model: _entities[6], + model: _entities[8], toOneRelations: (Profile object) => [], toManyRelations: (Profile object) => {}, getId: (Profile object) => object.id, @@ -1329,8 +1486,68 @@ obx_int.ModelDefinition getObjectBoxModel() { return object; }, ), + ProfileInfo: obx_int.EntityDefinition( + model: _entities[9], + toOneRelations: (ProfileInfo object) => [], + toManyRelations: (ProfileInfo object) => {}, + getId: (ProfileInfo object) => object.id, + setId: (ProfileInfo object, int id) { + object.id = id; + }, + objectToFB: (ProfileInfo object, fb.Builder fbb) { + final dbProfileInfoOffset = fbb.writeString(object.dbProfileInfo); + final dbNationalitiesOffset = fbb.writeString(object.dbNationalities); + final dbIdentificationOffset = fbb.writeString(object.dbIdentification); + final dbContactsOffset = fbb.writeString(object.dbContacts); + final dbAddressesOffset = fbb.writeString(object.dbAddresses); + fbb.startTable(7); + fbb.addInt64(0, object.id); + fbb.addOffset(1, dbProfileInfoOffset); + fbb.addOffset(2, dbNationalitiesOffset); + fbb.addOffset(3, dbIdentificationOffset); + fbb.addOffset(4, dbContactsOffset); + fbb.addOffset(5, dbAddressesOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final idParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 4, + 0, + ); + final dbProfileInfoParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 6, ''); + final dbNationalitiesParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 8, ''); + final dbIdentificationParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 10, ''); + final dbContactsParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 12, ''); + final dbAddressesParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 14, ''); + final object = ProfileInfo( + id: idParam, + dbProfileInfo: dbProfileInfoParam, + dbNationalities: dbNationalitiesParam, + dbIdentification: dbIdentificationParam, + dbContacts: dbContactsParam, + dbAddresses: dbAddressesParam, + ); + + return object; + }, + ), Reference: obx_int.EntityDefinition( - model: _entities[7], + model: _entities[10], toOneRelations: (Reference object) => [], toManyRelations: (Reference object) => {}, getId: (Reference object) => object.id, @@ -1388,11 +1605,11 @@ obx_int.ModelDefinition getObjectBoxModel() { }, ), Restaurant: obx_int.EntityDefinition( - model: _entities[8], + model: _entities[11], toOneRelations: (Restaurant object) => [], toManyRelations: (Restaurant object) => { obx_int.RelInfo.toOneBacklink( - 6, + 7, object.uniqueId!, (Meal srcObject) => srcObject.restaurant, ): object.meals, @@ -1424,10 +1641,10 @@ obx_int.ModelDefinition getObjectBoxModel() { fbb.addOffset(4, namePtOffset); fbb.addOffset(5, nameEnOffset); fbb.addOffset(6, periodOffset); - fbb.addOffset(7, referenceOffset); - fbb.addOffset(8, openingHoursOffset); - fbb.addOffset(9, emailOffset); - fbb.addInt64(10, object.campusId); + fbb.addInt64(7, object.campusId); + fbb.addOffset(8, referenceOffset); + fbb.addOffset(9, openingHoursOffset); + fbb.addOffset(10, emailOffset); fbb.finish(fbb.endTable()); return object.uniqueId ?? 0; }, @@ -1457,19 +1674,19 @@ obx_int.ModelDefinition getObjectBoxModel() { final campusIdParam = const fb.Int64Reader().vTableGet( buffer, rootOffset, - 24, + 18, 0, ); final referenceParam = const fb.StringReader( asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 18, ''); + ).vTableGet(buffer, rootOffset, 20, ''); final openingHoursParam = const fb.ListReader( fb.StringReader(asciiOptimization: true), lazy: false, - ).vTableGet(buffer, rootOffset, 20, []); + ).vTableGet(buffer, rootOffset, 22, []); final emailParam = const fb.StringReader( asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 22, ''); + ).vTableGet(buffer, rootOffset, 24, ''); final object = Restaurant( idParam, @@ -1492,7 +1709,7 @@ obx_int.ModelDefinition getObjectBoxModel() { object.meals, store, obx_int.RelInfo.toOneBacklink( - 6, + 7, object.uniqueId!, (Meal srcObject) => srcObject.restaurant, ), @@ -1500,138 +1717,6 @@ obx_int.ModelDefinition getObjectBoxModel() { return object; }, ), - News: obx_int.EntityDefinition( - model: _entities[9], - toOneRelations: (News object) => [], - toManyRelations: (News object) => {}, - getId: (News object) => object.id, - setId: (News object, int id) { - object.id = id; - }, - objectToFB: (News object, fb.Builder fbb) { - final titleOffset = fbb.writeString(object.title); - final descriptionOffset = fbb.writeString(object.description); - final imageOffset = fbb.writeString(object.image); - final linkOffset = fbb.writeString(object.link); - fbb.startTable(6); - fbb.addInt64(0, object.id); - fbb.addOffset(1, titleOffset); - fbb.addOffset(2, descriptionOffset); - fbb.addOffset(3, imageOffset); - fbb.addOffset(4, linkOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final idParam = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 4, - 0, - ); - final titleParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, ''); - final descriptionParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, ''); - final imageParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); - final linkParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 12, ''); - final object = News( - id: idParam, - title: titleParam, - description: descriptionParam, - image: imageParam, - link: linkParam, - ); - - return object; - }, - ), - Exam: obx_int.EntityDefinition( - model: _entities[10], - toOneRelations: (Exam object) => [], - toManyRelations: (Exam object) => {}, - getId: (Exam object) => object.dbId, - setId: (Exam object, int id) { - object.dbId = id; - }, - objectToFB: (Exam object, fb.Builder fbb) { - final idOffset = fbb.writeString(object.id); - final subjectAcronymOffset = fbb.writeString(object.subjectAcronym); - final subjectOffset = fbb.writeString(object.subject); - final roomsOffset = fbb.writeList( - object.rooms.map(fbb.writeString).toList(growable: false), - ); - final examTypeOffset = fbb.writeString(object.examType); - final occurrIdOffset = fbb.writeString(object.occurrId); - fbb.startTable(11); - fbb.addInt64(0, object.start.millisecondsSinceEpoch); - fbb.addInt64(1, object.finish.millisecondsSinceEpoch); - fbb.addOffset(2, idOffset); - fbb.addOffset(3, subjectAcronymOffset); - fbb.addOffset(4, subjectOffset); - fbb.addOffset(5, roomsOffset); - fbb.addOffset(6, examTypeOffset); - fbb.addOffset(8, occurrIdOffset); - fbb.addInt64(9, object.dbId ?? 0); - fbb.finish(fbb.endTable()); - return object.dbId ?? 0; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final idParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, ''); - final startParam = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0), - ); - final finishParam = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0), - ); - final subjectAcronymParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); - final subjectParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 12, ''); - final roomsParam = const fb.ListReader( - fb.StringReader(asciiOptimization: true), - lazy: false, - ).vTableGet(buffer, rootOffset, 14, []); - final examTypeParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 16, ''); - final occurrIdParam = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 20, ''); - final object = - Exam( - idParam, - startParam, - finishParam, - subjectAcronymParam, - subjectParam, - roomsParam, - examTypeParam, - occurrIdParam, - ) - ..dbId = const fb.Int64Reader().vTableGetNullable( - buffer, - rootOffset, - 22, - ); - - return object; - }, - ), }; return obx_int.ModelDefinition(model, bindings); @@ -1780,19 +1865,61 @@ class CourseUnit_ { _entities[2].properties[12], ); + /// See [CourseUnit.ects]. + static final ects = obx.QueryDoubleProperty( + _entities[2].properties[13], + ); + /// See [CourseUnit.festId]. static final festId = obx.QueryIntegerProperty( - _entities[2].properties[13], + _entities[2].properties[14], ); /// See [CourseUnit.schoolYear]. static final schoolYear = obx.QueryStringProperty( - _entities[2].properties[14], + _entities[2].properties[15], ); +} - /// See [CourseUnit.ects]. - static final ects = obx.QueryDoubleProperty( - _entities[2].properties[15], +/// [Exam] entity fields to define ObjectBox queries. +class Exam_ { + /// See [Exam.start]. + static final start = obx.QueryDateProperty(_entities[3].properties[0]); + + /// See [Exam.finish]. + static final finish = obx.QueryDateProperty(_entities[3].properties[1]); + + /// See [Exam.id]. + static final id = obx.QueryStringProperty(_entities[3].properties[2]); + + /// See [Exam.subjectAcronym]. + static final subjectAcronym = obx.QueryStringProperty( + _entities[3].properties[3], + ); + + /// See [Exam.subject]. + static final subject = obx.QueryStringProperty( + _entities[3].properties[4], + ); + + /// See [Exam.rooms]. + static final rooms = obx.QueryStringVectorProperty( + _entities[3].properties[5], + ); + + /// See [Exam.examType]. + static final examType = obx.QueryStringProperty( + _entities[3].properties[6], + ); + + /// See [Exam.occurrId]. + static final occurrId = obx.QueryStringProperty( + _entities[3].properties[7], + ); + + /// See [Exam.dbId]. + static final dbId = obx.QueryIntegerProperty( + _entities[3].properties[8], ); } @@ -1800,17 +1927,17 @@ class CourseUnit_ { class FloorOccupation_ { /// See [FloorOccupation.number]. static final number = obx.QueryIntegerProperty( - _entities[3].properties[0], + _entities[4].properties[0], ); /// See [FloorOccupation.occupation]. static final occupation = obx.QueryIntegerProperty( - _entities[3].properties[1], + _entities[4].properties[1], ); /// See [FloorOccupation.capacity]. static final capacity = obx.QueryIntegerProperty( - _entities[3].properties[2], + _entities[4].properties[2], ); } @@ -1818,132 +1945,189 @@ class FloorOccupation_ { class Lecture_ { /// See [Lecture.uniqueId]. static final uniqueId = obx.QueryIntegerProperty( - _entities[4].properties[0], + _entities[5].properties[0], ); /// See [Lecture.acronym]. static final acronym = obx.QueryStringProperty( - _entities[4].properties[1], + _entities[5].properties[1], ); /// See [Lecture.subject]. static final subject = obx.QueryStringProperty( - _entities[4].properties[2], + _entities[5].properties[2], ); /// See [Lecture.typeClass]. static final typeClass = obx.QueryStringProperty( - _entities[4].properties[3], + _entities[5].properties[3], ); /// See [Lecture.room]. static final room = obx.QueryStringProperty( - _entities[4].properties[4], + _entities[5].properties[4], ); /// See [Lecture.teacher]. static final teacher = obx.QueryStringProperty( - _entities[4].properties[5], + _entities[5].properties[5], ); /// See [Lecture.teacherName]. static final teacherName = obx.QueryStringProperty( - _entities[4].properties[6], + _entities[5].properties[6], ); /// See [Lecture.teacherId]. static final teacherId = obx.QueryIntegerProperty( - _entities[4].properties[7], + _entities[5].properties[7], ); /// See [Lecture.classNumber]. static final classNumber = obx.QueryStringProperty( - _entities[4].properties[8], + _entities[5].properties[8], ); /// See [Lecture.startTime]. static final startTime = obx.QueryDateProperty( - _entities[4].properties[9], + _entities[5].properties[9], ); /// See [Lecture.endTime]. static final endTime = obx.QueryDateProperty( - _entities[4].properties[10], + _entities[5].properties[10], ); /// See [Lecture.occurrId]. static final occurrId = obx.QueryIntegerProperty( - _entities[4].properties[11], + _entities[5].properties[11], ); } /// [Meal] entity fields to define ObjectBox queries. class Meal_ { /// See [Meal.id]. - static final id = obx.QueryIntegerProperty(_entities[5].properties[0]); + static final id = obx.QueryIntegerProperty(_entities[6].properties[0]); /// See [Meal.type]. - static final type = obx.QueryStringProperty(_entities[5].properties[1]); + static final type = obx.QueryStringProperty(_entities[6].properties[1]); /// See [Meal.namePt]. static final namePt = obx.QueryStringProperty( - _entities[5].properties[2], + _entities[6].properties[2], ); /// See [Meal.nameEn]. static final nameEn = obx.QueryStringProperty( - _entities[5].properties[3], + _entities[6].properties[3], + ); + + /// See [Meal.dbDayOfWeek]. + static final dbDayOfWeek = obx.QueryIntegerProperty( + _entities[6].properties[4], ); /// See [Meal.date]. - static final date = obx.QueryDateProperty(_entities[5].properties[4]); + static final date = obx.QueryDateProperty(_entities[6].properties[5]); /// See [Meal.restaurant]. static final restaurant = obx.QueryRelationToOne( - _entities[5].properties[5], + _entities[6].properties[6], ); +} - /// See [Meal.dbDayOfWeek]. - static final dbDayOfWeek = obx.QueryIntegerProperty( - _entities[5].properties[6], +/// [News] entity fields to define ObjectBox queries. +class News_ { + /// See [News.id]. + static final id = obx.QueryIntegerProperty(_entities[7].properties[0]); + + /// See [News.title]. + static final title = obx.QueryStringProperty( + _entities[7].properties[1], + ); + + /// See [News.description]. + static final description = obx.QueryStringProperty( + _entities[7].properties[2], + ); + + /// See [News.image]. + static final image = obx.QueryStringProperty( + _entities[7].properties[3], ); + + /// See [News.link]. + static final link = obx.QueryStringProperty(_entities[7].properties[4]); } /// [Profile] entity fields to define ObjectBox queries. class Profile_ { /// See [Profile.id]. static final id = obx.QueryIntegerProperty( - _entities[6].properties[0], + _entities[8].properties[0], ); /// See [Profile.name]. static final name = obx.QueryStringProperty( - _entities[6].properties[1], + _entities[8].properties[1], ); /// See [Profile.email]. static final email = obx.QueryStringProperty( - _entities[6].properties[2], + _entities[8].properties[2], ); /// See [Profile.printBalance]. static final printBalance = obx.QueryStringProperty( - _entities[6].properties[3], + _entities[8].properties[3], ); /// See [Profile.feesBalance]. static final feesBalance = obx.QueryStringProperty( - _entities[6].properties[4], + _entities[8].properties[4], ); /// See [Profile.feesLimit]. static final feesLimit = obx.QueryDateProperty( - _entities[6].properties[5], + _entities[8].properties[5], ); /// See [Profile.answeredPedagogicalSurveys]. static final answeredPedagogicalSurveys = obx.QueryBooleanProperty( - _entities[6].properties[6], + _entities[8].properties[6], + ); +} + +/// [ProfileInfo] entity fields to define ObjectBox queries. +class ProfileInfo_ { + /// See [ProfileInfo.id]. + static final id = obx.QueryIntegerProperty( + _entities[9].properties[0], + ); + + /// See [ProfileInfo.dbProfileInfo]. + static final dbProfileInfo = obx.QueryStringProperty( + _entities[9].properties[1], + ); + + /// See [ProfileInfo.dbNationalities]. + static final dbNationalities = obx.QueryStringProperty( + _entities[9].properties[2], + ); + + /// See [ProfileInfo.dbIdentification]. + static final dbIdentification = obx.QueryStringProperty( + _entities[9].properties[3], + ); + + /// See [ProfileInfo.dbContacts]. + static final dbContacts = obx.QueryStringProperty( + _entities[9].properties[4], + ); + + /// See [ProfileInfo.dbAddresses]. + static final dbAddresses = obx.QueryStringProperty( + _entities[9].properties[5], ); } @@ -1951,32 +2135,32 @@ class Profile_ { class Reference_ { /// See [Reference.id]. static final id = obx.QueryIntegerProperty( - _entities[7].properties[0], + _entities[10].properties[0], ); /// See [Reference.description]. static final description = obx.QueryStringProperty( - _entities[7].properties[1], + _entities[10].properties[1], ); /// See [Reference.limitDate]. static final limitDate = obx.QueryDateProperty( - _entities[7].properties[2], + _entities[10].properties[2], ); /// See [Reference.entity]. static final entity = obx.QueryIntegerProperty( - _entities[7].properties[3], + _entities[10].properties[3], ); /// See [Reference.reference]. static final reference = obx.QueryIntegerProperty( - _entities[7].properties[4], + _entities[10].properties[4], ); /// See [Reference.amount]. static final amount = obx.QueryDoubleProperty( - _entities[7].properties[5], + _entities[10].properties[5], ); } @@ -1984,57 +2168,57 @@ class Reference_ { class Restaurant_ { /// See [Restaurant.uniqueId]. static final uniqueId = obx.QueryIntegerProperty( - _entities[8].properties[0], + _entities[11].properties[0], ); /// See [Restaurant.id]. static final id = obx.QueryIntegerProperty( - _entities[8].properties[1], + _entities[11].properties[1], ); /// See [Restaurant.typePt]. static final typePt = obx.QueryStringProperty( - _entities[8].properties[2], + _entities[11].properties[2], ); /// See [Restaurant.typeEn]. static final typeEn = obx.QueryStringProperty( - _entities[8].properties[3], + _entities[11].properties[3], ); /// See [Restaurant.namePt]. static final namePt = obx.QueryStringProperty( - _entities[8].properties[4], + _entities[11].properties[4], ); /// See [Restaurant.nameEn]. static final nameEn = obx.QueryStringProperty( - _entities[8].properties[5], + _entities[11].properties[5], ); /// See [Restaurant.period]. static final period = obx.QueryStringProperty( - _entities[8].properties[6], + _entities[11].properties[6], + ); + + /// See [Restaurant.campusId]. + static final campusId = obx.QueryIntegerProperty( + _entities[11].properties[7], ); /// See [Restaurant.reference]. static final reference = obx.QueryStringProperty( - _entities[8].properties[7], + _entities[11].properties[8], ); /// See [Restaurant.openingHours]. static final openingHours = obx.QueryStringVectorProperty( - _entities[8].properties[8], + _entities[11].properties[9], ); /// See [Restaurant.email]. static final email = obx.QueryStringProperty( - _entities[8].properties[9], - ); - - /// See [Restaurant.campusId]. - static final campusId = obx.QueryIntegerProperty( - _entities[8].properties[10], + _entities[11].properties[10], ); /// see [Restaurant.meals] @@ -2042,71 +2226,3 @@ class Restaurant_ { Meal_.restaurant, ); } - -/// [News] entity fields to define ObjectBox queries. -class News_ { - /// See [News.id]. - static final id = obx.QueryIntegerProperty(_entities[9].properties[0]); - - /// See [News.title]. - static final title = obx.QueryStringProperty( - _entities[9].properties[1], - ); - - /// See [News.description]. - static final description = obx.QueryStringProperty( - _entities[9].properties[2], - ); - - /// See [News.image]. - static final image = obx.QueryStringProperty( - _entities[9].properties[3], - ); - - /// See [News.link]. - static final link = obx.QueryStringProperty(_entities[9].properties[4]); -} - -/// [Exam] entity fields to define ObjectBox queries. -class Exam_ { - /// See [Exam.start]. - static final start = obx.QueryDateProperty(_entities[10].properties[0]); - - /// See [Exam.finish]. - static final finish = obx.QueryDateProperty( - _entities[10].properties[1], - ); - - /// See [Exam.id]. - static final id = obx.QueryStringProperty(_entities[10].properties[2]); - - /// See [Exam.subjectAcronym]. - static final subjectAcronym = obx.QueryStringProperty( - _entities[10].properties[3], - ); - - /// See [Exam.subject]. - static final subject = obx.QueryStringProperty( - _entities[10].properties[4], - ); - - /// See [Exam.rooms]. - static final rooms = obx.QueryStringVectorProperty( - _entities[10].properties[5], - ); - - /// See [Exam.examType]. - static final examType = obx.QueryStringProperty( - _entities[10].properties[6], - ); - - /// See [Exam.occurrId]. - static final occurrId = obx.QueryStringProperty( - _entities[10].properties[7], - ); - - /// See [Exam.dbId]. - static final dbId = obx.QueryIntegerProperty( - _entities[10].properties[8], - ); -} diff --git a/packages/uni_app/lib/utils/navigation_items.dart b/packages/uni_app/lib/utils/navigation_items.dart index e70a8dd2b..0abacd548 100644 --- a/packages/uni_app/lib/utils/navigation_items.dart +++ b/packages/uni_app/lib/utils/navigation_items.dart @@ -16,7 +16,8 @@ enum NavigationItem { navLogin('login'), navBugreport('bug_report'), navSplash('splash'), - navAboutus('sobre_nos'); + navAboutus('sobre_nos'), + navProfileInfo('informacoes_pessoais'); const NavigationItem(this.route, {this.faculties}); diff --git a/packages/uni_app/lib/view/academic_path/courses_page.dart b/packages/uni_app/lib/view/academic_path/courses_page.dart index f2ddc56b7..c3c97825d 100644 --- a/packages/uni_app/lib/view/academic_path/courses_page.dart +++ b/packages/uni_app/lib/view/academic_path/courses_page.dart @@ -20,23 +20,6 @@ class CoursesPage extends ConsumerStatefulWidget { } class CoursesPageState extends ConsumerState { - static Locale? _lastLocale; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final locale = Localizations.localeOf(context); - if (_lastLocale != locale) { - _lastLocale = locale; - Future.microtask(() { - ref.read(profileProvider.notifier).refreshRemote(); - if (mounted) { - setState(() {}); - } - }); - } - } - var _courseUnitIndex = 0; void _onCourseUnitSelected(int index) { diff --git a/packages/uni_app/lib/view/home/home.dart b/packages/uni_app/lib/view/home/home.dart index bce86d6d1..f9855138c 100644 --- a/packages/uni_app/lib/view/home/home.dart +++ b/packages/uni_app/lib/view/home/home.dart @@ -44,6 +44,23 @@ class HomePageView extends ConsumerStatefulWidget { } class HomePageViewState extends ConsumerState { + static Locale? _lastLocale; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final locale = Localizations.localeOf(context); + if (_lastLocale != locale) { + _lastLocale = locale; + Future.microtask(() { + ref.read(profileProvider.notifier).refreshRemote(); + if (mounted) { + setState(() {}); + } + }); + } + } + List favoriteCards = PreferencesController.getFavoriteCards(); diff --git a/packages/uni_app/lib/view/profile/profile.dart b/packages/uni_app/lib/view/profile/profile.dart index f9606c7fb..338656934 100644 --- a/packages/uni_app/lib/view/profile/profile.dart +++ b/packages/uni_app/lib/view/profile/profile.dart @@ -27,14 +27,13 @@ class ProfilePageViewState extends SecondaryPageViewState { builder: (context, ref, profile) => Column( children: [ ProfileOverview(profile: profile), - const ProfileInfo(), + const ProfileInfoWidget(), ], ), hasContent: (profile) => profile.courses.isNotEmpty, loadingWidget: const ProfileCardShimmer(), nullContentWidget: Container(), ), - const Settings(), ], ); diff --git a/packages/uni_app/lib/view/profile/widgets/profile_info.dart b/packages/uni_app/lib/view/profile/widgets/profile_info.dart index d0d2bfaa3..09362446a 100644 --- a/packages/uni_app/lib/view/profile/widgets/profile_info.dart +++ b/packages/uni_app/lib/view/profile/widgets/profile_info.dart @@ -10,8 +10,8 @@ import 'package:uni_ui/cards/profile_card.dart'; /// Manages the 'Current account' section inside the user's page (accessible /// through the top-right widget with the user picture) -class ProfileInfo extends ConsumerWidget { - const ProfileInfo({super.key}); +class ProfileInfoWidget extends ConsumerWidget { + const ProfileInfoWidget({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/packages/uni_app/lib/view/profile/widgets/settings.dart b/packages/uni_app/lib/view/profile/widgets/settings.dart index 8fc0123cd..b78154142 100644 --- a/packages/uni_app/lib/view/profile/widgets/settings.dart +++ b/packages/uni_app/lib/view/profile/widgets/settings.dart @@ -21,6 +21,24 @@ class Settings extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + GenericCard( + tooltip: S.of(context).user_informations, + margin: const EdgeInsets.symmetric(vertical: 8), + child: ProfileListTile( + icon: UniIcons.userIcon, + title: S.of(context).user_informations, + trailing: UniIcon( + UniIcons.caretRight, + color: Theme.of(context).colorScheme.onSecondary, + ), + onTap: () { + Navigator.pushNamed( + context, + '/${NavigationItem.navProfileInfo.route}', + ); + }, + ), + ), Text( S.of(context).settings, style: Theme.of(context).textTheme.headlineLarge, diff --git a/packages/uni_app/lib/view/profile_info/profile_info.dart b/packages/uni_app/lib/view/profile_info/profile_info.dart new file mode 100644 index 000000000..eb4bfd198 --- /dev/null +++ b/packages/uni_app/lib/view/profile_info/profile_info.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:uni/model/entities/profile.dart'; +import 'package:uni/model/entities/profile_info.dart'; +import 'package:uni/model/providers/riverpod/default_consumer.dart'; +import 'package:uni/model/providers/riverpod/profile_info_provider.dart'; +import 'package:uni/model/providers/riverpod/profile_provider.dart'; +import 'package:uni/view/profile/profile_shimmer.dart'; +import 'package:uni/view/profile_info/widgets/no_profile_data.dart'; +import 'package:uni/view/profile_info/widgets/profile_data.dart'; +import 'package:uni/view/profile_info/widgets/profile_info_shimmer.dart'; +import 'package:uni/view/profile_info/widgets/profile_overview.dart'; +import 'package:uni/view/widgets/pages_layouts/secondary/secondary.dart'; + +class ProfileInfoPageView extends ConsumerStatefulWidget { + const ProfileInfoPageView({super.key}); + + @override + ConsumerState createState() => + ProfileInfoPageViewState(); +} + +/// Manages the profile information page of the app. +class ProfileInfoPageViewState + extends SecondaryPageViewState { + @override + Widget getBody(BuildContext context) { + return ListView( + children: [ + DefaultConsumer( + provider: profileProvider, + builder: (context, ref, profile) => ProfileOverview(profile: profile), + hasContent: (profile) => true, + nullContentWidget: LayoutBuilder( + // Band-aid for allowing refresh on null content + builder: (context, constraints) => SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Container( + height: constraints.maxHeight, + padding: const EdgeInsets.only(bottom: 120), + child: const Center(child: NoProfileDataWidget()), + ), + ), + ), + loadingWidget: const ProfileCardShimmer(), + ), + + DefaultConsumer( + provider: profileInfoProvider, + builder: (context, ref, profileInfo) => + ProfileData(profileInfo: profileInfo), + hasContent: (profileInfo) => + true, // because profileInfo != null is allways true + nullContentWidget: const Center(child: NoProfileDataWidget()), + loadingWidget: const ShimmerProfileInfoPage(), + ), + ], + ); + } + + @override + Future onRefresh() async { + await Future.wait([ + ref.read(profileProvider.notifier).refreshRemote(), + ref.read(profileInfoProvider.notifier).refreshRemote(), + ]); + } + + @override + String? getTitle() { + return null; + } +} diff --git a/packages/uni_app/lib/view/profile_info/widgets/no_profile_data.dart b/packages/uni_app/lib/view/profile_info/widgets/no_profile_data.dart new file mode 100644 index 000000000..afe6d4de4 --- /dev/null +++ b/packages/uni_app/lib/view/profile_info/widgets/no_profile_data.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni/view/widgets/expanded_image_label.dart'; + +class NoProfileDataWidget extends StatelessWidget { + const NoProfileDataWidget({super.key}); + + @override + Widget build(BuildContext context) { + return ImageLabel( + imagePath: 'assets/images/personal_info.png', + label: S.of(context).no_info, + labelTextStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Theme.of(context).colorScheme.primary, + ), + sublabel: S.of(context).no_info_description, + sublabelTextStyle: Theme.of(context).textTheme.bodyLarge, + ); + } +} diff --git a/packages/uni_app/lib/view/profile_info/widgets/profile_data.dart b/packages/uni_app/lib/view/profile_info/widgets/profile_data.dart new file mode 100644 index 000000000..a7b20e95f --- /dev/null +++ b/packages/uni_app/lib/view/profile_info/widgets/profile_data.dart @@ -0,0 +1,131 @@ +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni/model/entities/profile_info.dart'; +import 'package:uni_ui/cards/data_list_tile.dart'; +import 'package:uni_ui/cards/generic_card.dart'; + +class ProfileData extends StatelessWidget { + const ProfileData({required this.profileInfo, super.key}); + + final ProfileInfo profileInfo; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20), + child: Column( + spacing: 16, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).user_informations, + style: Theme.of(context).textTheme.headlineLarge, + ), + GenericCard( + tooltip: S.of(context).user_informations, + margin: const EdgeInsets.symmetric(vertical: 8), + child: Column( + children: profileInfo.profileInfo.entries + .map( + (entry) => + DataListTile(prefix: entry.key, text: entry.value), + ) + .toList(), + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).nationalities, + style: Theme.of(context).textTheme.headlineLarge, + ), + GenericCard( + tooltip: S.of(context).nationalities, + margin: const EdgeInsets.symmetric(vertical: 8), + child: Column( + children: profileInfo.nationalities.entries + .map( + (entry) => DataListTile( + prefix: '${S.of(context).nationality} ${entry.key}', + text: entry.value, + ), + ) + .toList(), + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).identification_documents, + style: Theme.of(context).textTheme.headlineLarge, + ), + GenericCard( + tooltip: S.of(context).identification_documents, + margin: const EdgeInsets.symmetric(vertical: 8), + child: Column( + children: profileInfo.identification.entries + .map( + (entry) => + DataListTile(prefix: entry.key, text: entry.value), + ) + .toList(), + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).contacts, + style: Theme.of(context).textTheme.headlineLarge, + ), + GenericCard( + tooltip: S.of(context).contacts, + margin: const EdgeInsets.symmetric(vertical: 8), + child: Column( + children: profileInfo.contacts.entries + .map( + (entry) => + DataListTile(prefix: entry.key, text: entry.value), + ) + .toList(), + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).addresses, + style: Theme.of(context).textTheme.headlineLarge, + ), + GenericCard( + tooltip: S.of(context).addresses, + margin: const EdgeInsets.symmetric(vertical: 8), + child: Column( + children: profileInfo.addresses.entries + .map( + (entry) => + DataListTile(prefix: entry.key, text: entry.value), + ) + .toList(), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/packages/uni_app/lib/view/profile_info/widgets/profile_info_shimmer.dart b/packages/uni_app/lib/view/profile_info/widgets/profile_info_shimmer.dart new file mode 100644 index 000000000..17abcd37e --- /dev/null +++ b/packages/uni_app/lib/view/profile_info/widgets/profile_info_shimmer.dart @@ -0,0 +1,52 @@ +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:uni_ui/common/generic_squircle.dart'; + +class ShimmerProfileInfoPage extends StatelessWidget { + const ShimmerProfileInfoPage({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + ...List.generate( + 4, + (index) => Padding( + padding: EdgeInsets.zero, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(left: 16, right: 16, top: 50), + child: Align( + alignment: Alignment.centerLeft, + child: Shimmer.fromColors( + baseColor: Theme.of( + context, + ).disabledColor.withAlpha(0x7f), + highlightColor: Theme.of(context).disabledColor, + child: Container( + height: 40, + color: Colors.grey, + width: 250, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 16, right: 16, top: 20), + child: Shimmer.fromColors( + baseColor: Theme.of(context).disabledColor.withAlpha(0x7f), + highlightColor: Theme.of(context).disabledColor, + child: GenericSquircle( + child: Container(height: 200, color: Colors.grey), + ), + ), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/packages/uni_app/lib/view/profile_info/widgets/profile_overview.dart b/packages/uni_app/lib/view/profile_info/widgets/profile_overview.dart new file mode 100644 index 000000000..41df94f48 --- /dev/null +++ b/packages/uni_app/lib/view/profile_info/widgets/profile_overview.dart @@ -0,0 +1 @@ +export 'package:uni/view/profile/widgets/profile_overview.dart'; diff --git a/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart b/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart index d397c942e..7d138077e 100644 --- a/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart +++ b/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/bottom_navigation_bar.dart @@ -48,7 +48,7 @@ class AppBottomNavbar extends StatelessWidget { ), ); } - var bottomPadding = MediaQuery.of(context).systemGestureInsets.bottom; + var bottomPadding = MediaQuery.systemGestureInsetsOf(context).bottom; const iosAdditionalBottomPadding = 30.0; const androidMinimumBottomPadding = 20.0; diff --git a/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/profile_button.dart b/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/profile_button.dart index adccd109c..a627b0e6c 100644 --- a/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/profile_button.dart +++ b/packages/uni_app/lib/view/widgets/pages_layouts/general/widgets/profile_button.dart @@ -15,7 +15,7 @@ class ProfileButton extends StatelessWidget { onPressed: () => { Navigator.pushNamed(context, '/${NavigationItem.navProfile.route}'), }, - icon: const ProfileImage(radius: 20), + icon: const ProfileImage(radius: 22.56), ); } } diff --git a/packages/uni_ui/lib/cards/data_list_tile.dart b/packages/uni_ui/lib/cards/data_list_tile.dart new file mode 100644 index 000000000..27b2c7740 --- /dev/null +++ b/packages/uni_ui/lib/cards/data_list_tile.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; + +class DataListTile extends StatelessWidget { + const DataListTile({ + super.key, + required this.prefix, + required this.text, + this.subtitle, + this.trailing, + this.onTap, + this.alignPrefix = TextAlign.left, + }); + + final String prefix; + final String text; + final TextAlign? alignPrefix; + final String? subtitle; + final VoidCallback? onTap; + final Widget? trailing; + + @override + Widget build(BuildContext context) { + return ListTile( + leading: SizedBox( + child: Text( + prefix, + overflow: TextOverflow.visible, + softWrap: true, + style: Theme.of(context).textTheme.headlineSmall, + textAlign: alignPrefix, + ), + width: 100, + ), + title: Text( + text, + overflow: TextOverflow.visible, + softWrap: true, + style: Theme.of(context).textTheme.titleMedium, + textAlign: TextAlign.left, + ), + subtitle: subtitle != null ? Text(subtitle!) : null, + trailing: trailing, + onTap: onTap, + ); + } +} diff --git a/packages/uni_ui/lib/icons.dart b/packages/uni_ui/lib/icons.dart index 662e5c79a..da4bc265a 100644 --- a/packages/uni_ui/lib/icons.dart +++ b/packages/uni_ui/lib/icons.dart @@ -93,6 +93,7 @@ class UniIcons { static const courseUnit = PhosphorIconsDuotone.chalkboardTeacher; + static const userIcon = PhosphorIconsDuotone.userCircle; static const warning = PhosphorIconsDuotone.warningOctagon; } diff --git a/pubspec.lock b/pubspec.lock index ed88702b7..880070b88 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1026,10 +1026,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.18" material_color_utilities: dependency: transitive description: @@ -1720,26 +1720,26 @@ packages: dependency: transitive description: name: test - sha256: "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7" + sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a" url: "https://pub.dev" source: hosted - version: "1.30.0" + version: "1.29.0" test_api: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.9" test_core: dependency: transitive description: name: test_core - sha256: "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51" + sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943" url: "https://pub.dev" source: hosted - version: "0.6.16" + version: "0.6.15" timelines: dependency: transitive description: