Skip to content

Commit

Permalink
Academyc page tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
thePeras committed Nov 4, 2024
1 parent 1ebbced commit d7ae8a6
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 28 deletions.
3 changes: 3 additions & 0 deletions packages/uni_app/lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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":
Expand Down Expand Up @@ -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"),
Expand Down
3 changes: 3 additions & 0 deletions packages/uni_app/lib/generated/intl/messages_pt_PT.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: "),
Expand All @@ -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(
Expand Down Expand Up @@ -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"),
Expand Down
30 changes: 30 additions & 0 deletions packages/uni_app/lib/generated/l10n.dart

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

8 changes: 7 additions & 1 deletion packages/uni_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
8 changes: 7 additions & 1 deletion packages/uni_app/lib/l10n/intl_pt_PT.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
66 changes: 40 additions & 26 deletions packages/uni_app/lib/view/academic_path/academic_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -11,40 +13,52 @@ class AcademicPathPageView extends StatefulWidget {
State<StatefulWidget> 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'),
),
),
],
);
}

Expand Down
8 changes: 8 additions & 0 deletions packages/uni_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions packages/uni_ui/lib/icons.dart
Original file line number Diff line number Diff line change
@@ -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;
}
26 changes: 26 additions & 0 deletions packages/uni_ui/lib/tabs/tab_icon.dart
Original file line number Diff line number Diff line change
@@ -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),
],
),
);
}
}

0 comments on commit d7ae8a6

Please sign in to comment.