diff --git a/packages/uni_app/lib/generated/intl/messages_en.dart b/packages/uni_app/lib/generated/intl/messages_en.dart index 24826a3e3..fb6c834dd 100644 --- a/packages/uni_app/lib/generated/intl/messages_en.dart +++ b/packages/uni_app/lib/generated/intl/messages_en.dart @@ -102,6 +102,7 @@ class MessageLookup extends MessageLookupByLibrary { "Floor -1 of building B | AEFEUP building"), "course_class": MessageLookupByLibrary.simpleMessage("Classes"), "course_info": MessageLookupByLibrary.simpleMessage("Info"), + "courses": MessageLookupByLibrary.simpleMessage("Courses"), "current_state": MessageLookupByLibrary.simpleMessage("Current state: "), "current_year": @@ -122,6 +123,7 @@ class MessageLookup extends MessageLookupByLibrary { "empty_text": MessageLookupByLibrary.simpleMessage("Please fill in this field"), "evaluation": MessageLookupByLibrary.simpleMessage("Evaluation"), + "exams": MessageLookupByLibrary.simpleMessage("Exams"), "exams_filter": MessageLookupByLibrary.simpleMessage("Exams Filter Settings"), "exit_confirm": @@ -264,6 +266,7 @@ class MessageLookup extends MessageLookupByLibrary { "restaurant_main_page": MessageLookupByLibrary.simpleMessage( "Do you want to see your favorite restaurants in the main page?"), "room": MessageLookupByLibrary.simpleMessage("Room"), + "schedule": MessageLookupByLibrary.simpleMessage("Schedule"), "school_calendar": MessageLookupByLibrary.simpleMessage("School Calendar"), "search": MessageLookupByLibrary.simpleMessage("Search"), 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 502e9f9ec..7bf937edc 100644 --- a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart +++ b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart @@ -102,6 +102,7 @@ class MessageLookup extends MessageLookupByLibrary { "Piso -1 do edifício B | Edifício da AEFEUP"), "course_class": MessageLookupByLibrary.simpleMessage("Turmas"), "course_info": MessageLookupByLibrary.simpleMessage("Ficha"), + "courses": MessageLookupByLibrary.simpleMessage("Cursos"), "current_state": MessageLookupByLibrary.simpleMessage("Estado atual: "), "current_year": MessageLookupByLibrary.simpleMessage("Ano curricular atual: "), @@ -121,6 +122,7 @@ class MessageLookup extends MessageLookupByLibrary { "empty_text": MessageLookupByLibrary.simpleMessage( "Por favor preenche este campo"), "evaluation": MessageLookupByLibrary.simpleMessage("Avaliação"), + "exams": MessageLookupByLibrary.simpleMessage("Exames"), "exams_filter": MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"), "exit_confirm": MessageLookupByLibrary.simpleMessage( @@ -265,6 +267,7 @@ class MessageLookup extends MessageLookupByLibrary { "restaurant_main_page": MessageLookupByLibrary.simpleMessage( "Queres ver os teus restaurantes favoritos na página principal?"), "room": MessageLookupByLibrary.simpleMessage("Sala"), + "schedule": MessageLookupByLibrary.simpleMessage("Horário"), "school_calendar": MessageLookupByLibrary.simpleMessage("Calendário Escolar"), "search": MessageLookupByLibrary.simpleMessage("Pesquisar"), diff --git a/packages/uni_app/lib/generated/l10n.dart b/packages/uni_app/lib/generated/l10n.dart index 4201d66c1..17931ff61 100644 --- a/packages/uni_app/lib/generated/l10n.dart +++ b/packages/uni_app/lib/generated/l10n.dart @@ -1697,6 +1697,36 @@ class S { args: [], ); } + + /// `Schedule` + String get schedule { + return Intl.message( + 'Schedule', + name: 'schedule', + desc: '', + args: [], + ); + } + + /// `Exams` + String get exams { + return Intl.message( + 'Exams', + name: 'exams', + desc: '', + args: [], + ); + } + + /// `Courses` + String get courses { + return Intl.message( + 'Courses', + name: 'courses', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/packages/uni_app/lib/l10n/intl_en.arb b/packages/uni_app/lib/l10n/intl_en.arb index 5e3eb22a6..1b17ec361 100644 --- a/packages/uni_app/lib/l10n/intl_en.arb +++ b/packages/uni_app/lib/l10n/intl_en.arb @@ -333,5 +333,11 @@ "wrong_credentials_exception": "Invalid credentials", "@wrong_credentials_exception": {}, "internet_status_exception": "Check your internet connection", - "@internet_status_exception": {} + "@internet_status_exception": {}, + "schedule": "Schedule", + "@schedule": {}, + "exams": "Exams", + "@exams": {}, + "courses": "Courses", + "@courses": {} } \ No newline at end of file diff --git a/packages/uni_app/lib/l10n/intl_pt_PT.arb b/packages/uni_app/lib/l10n/intl_pt_PT.arb index 4212fe69c..04fe68be7 100644 --- a/packages/uni_app/lib/l10n/intl_pt_PT.arb +++ b/packages/uni_app/lib/l10n/intl_pt_PT.arb @@ -333,5 +333,11 @@ "wrong_credentials_exception": "Credenciais inválidas", "@wrong_credentials_exception": {}, "internet_status_exception": "Verifique sua conexão com a internet", - "@internet_status_exception": {} + "@internet_status_exception": {}, + "schedule": "Horário", + "@schedule": {}, + "exams": "Exames", + "@exams": {}, + "courses": "Cursos", + "@courses": {} } \ No newline at end of file diff --git a/packages/uni_app/lib/view/academic_path/academic_path.dart b/packages/uni_app/lib/view/academic_path/academic_path.dart index e4e69c7be..a946ed8b6 100644 --- a/packages/uni_app/lib/view/academic_path/academic_path.dart +++ b/packages/uni_app/lib/view/academic_path/academic_path.dart @@ -3,6 +3,8 @@ import 'package:uni/generated/l10n.dart'; import 'package:uni/utils/navigation_items.dart'; import 'package:uni/view/academic_path/exam_page.dart'; import 'package:uni/view/common_widgets/pages_layouts/general/general.dart'; +import 'package:uni_ui/icons.dart'; +import 'package:uni_ui/tabs/tab_icon.dart'; class AcademicPathPageView extends StatefulWidget { const AcademicPathPageView({super.key}); @@ -11,40 +13,52 @@ class AcademicPathPageView extends StatefulWidget { State createState() => AcademicPathPageViewState(); } -class AcademicPathPageViewState extends GeneralPageViewState { +class AcademicPathPageViewState extends GeneralPageViewState + with SingleTickerProviderStateMixin { @override String? getTitle() => S.of(context).nav_title(NavigationItem.navAcademicPath.route); + late TabController tabController; + + @override + void initState() { + super.initState(); + tabController = TabController(vsync: this, length: 3); + } + + @override + void dispose() { + tabController.dispose(); + super.dispose(); + } + + @override + Widget? getHeader(BuildContext context) { + return TabBar( + controller: tabController, + dividerHeight: 1, + tabs: [ + TabIcon(icon: UniIcons.calendar, text: S.of(context).schedule), + TabIcon(icon: UniIcons.exam, text: S.of(context).exams), + TabIcon(icon: UniIcons.courses, text: S.of(context).courses), + ], + ); + } + @override Widget getBody(BuildContext context) { - return DefaultTabController( - length: 3, - child: Scaffold( - appBar: AppBar( - title: Text( - S.of(context).nav_title(NavigationItem.navAcademicPath.route), - ), - bottom: const TabBar( - tabs: [ - Tab(text: 'Schedule'), - Tab(text: 'Exams'), - Tab(text: 'Courses'), - ], - ), + return TabBarView( + controller: tabController, + children: const [ + Center( + child: Text('To be implemented'), ), - body: const TabBarView( - children: [ - Center( - child: Text('To be implemented'), - ), - ExamsPage(), - Center( - child: Text('To be implemented'), - ), - ], + ExamsPage(), + Center( + child: Text('To be implemented'), ), - ), + ], ); } diff --git a/packages/uni_app/pubspec.lock b/packages/uni_app/pubspec.lock index 04778b73c..e9483f5c4 100644 --- a/packages/uni_app/pubspec.lock +++ b/packages/uni_app/pubspec.lock @@ -1147,6 +1147,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.28.0" + scrollable_positioned_list: + dependency: transitive + description: + name: scrollable_positioned_list + sha256: "1b54d5f1329a1e263269abc9e2543d90806131aa14fe7c6062a8054d57249287" + url: "https://pub.dev" + source: hosted + version: "0.3.8" sentry: dependency: transitive description: diff --git a/packages/uni_ui/lib/icons.dart b/packages/uni_ui/lib/icons.dart new file mode 100644 index 000000000..60cf7ca43 --- /dev/null +++ b/packages/uni_ui/lib/icons.dart @@ -0,0 +1,7 @@ +import 'package:phosphor_flutter/phosphor_flutter.dart'; + +class UniIcons { + static const calendar = PhosphorIconsDuotone.calendarDots; + static const exam = PhosphorIconsDuotone.exam; + static const courses = PhosphorIconsDuotone.certificate; +} diff --git a/packages/uni_ui/lib/tabs/tab_icon.dart b/packages/uni_ui/lib/tabs/tab_icon.dart new file mode 100644 index 000000000..b8bbcb3a9 --- /dev/null +++ b/packages/uni_ui/lib/tabs/tab_icon.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +class TabIcon extends StatelessWidget { + const TabIcon({ + super.key, + required this.icon, + required this.text, + }); + + final IconData icon; + final String text; + + @override + Widget build(BuildContext context) { + return Tab( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon), + const SizedBox(width: 4), + Text(text), + ], + ), + ); + } +}