diff --git a/frontend/app_student/assets/fonts/arial.ttf b/frontend/app_student/assets/fonts/arial.ttf new file mode 100644 index 0000000..ad7d8ea Binary files /dev/null and b/frontend/app_student/assets/fonts/arial.ttf differ diff --git a/frontend/app_student/assets/images/eating.svg b/frontend/app_student/assets/images/eating.svg new file mode 100644 index 0000000..096cb2c --- /dev/null +++ b/frontend/app_student/assets/images/eating.svg @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/frontend/app_student/assets/images/microsoft-teams.svg b/frontend/app_student/assets/images/microsoft-teams.svg deleted file mode 100644 index 4b02f7a..0000000 --- a/frontend/app_student/assets/images/microsoft-teams.svg +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/frontend/app_student/assets/images/school.svg b/frontend/app_student/assets/images/school.svg new file mode 100644 index 0000000..09f871f --- /dev/null +++ b/frontend/app_student/assets/images/school.svg @@ -0,0 +1,49 @@ + + \ No newline at end of file diff --git a/frontend/app_student/assets/images/teams.svg b/frontend/app_student/assets/images/teams.svg new file mode 100644 index 0000000..b61b0cd --- /dev/null +++ b/frontend/app_student/assets/images/teams.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/app_student/lib/api/day_schedule/models/day_schedule_model.dart b/frontend/app_student/lib/api/day_schedule/models/day_schedule_model.dart index 5bd09d6..c848034 100644 --- a/frontend/app_student/lib/api/day_schedule/models/day_schedule_model.dart +++ b/frontend/app_student/lib/api/day_schedule/models/day_schedule_model.dart @@ -1,4 +1,4 @@ -import '../../events/entities/event_entity.dart'; +import 'package:app_student/api/events/models/event_model.dart'; import '../entities/day_schedule_entity.dart'; class DayScheduleModel { @@ -10,7 +10,8 @@ class DayScheduleModel { int get jour => entity.jour; - List get events => entity.events; + List get events => + entity.events.map((e) => EventModel(entity: e)).toList(); factory DayScheduleModel.fromEntity(DayScheduleEntity entity) { return DayScheduleModel( diff --git a/frontend/app_student/lib/api/events/models/event_model.dart b/frontend/app_student/lib/api/events/models/event_model.dart index b0fa2e9..659d7e4 100644 --- a/frontend/app_student/lib/api/events/models/event_model.dart +++ b/frontend/app_student/lib/api/events/models/event_model.dart @@ -12,4 +12,5 @@ class EventModel { String get couleur => entity.couleur; EventHoursModel get horaires => EventHoursModel(entity: entity.horaires); String get salle => entity.salle; + bool get visio => entity.visio; } diff --git a/frontend/app_student/lib/main_dev.dart b/frontend/app_student/lib/main_dev.dart index 1c55e87..f1e1723 100644 --- a/frontend/app_student/lib/main_dev.dart +++ b/frontend/app_student/lib/main_dev.dart @@ -39,6 +39,7 @@ class MyApp extends StatelessWidget { theme: ThemeData( primarySwatch: Colors.blue, focusColor: const Color(0xffE84E0F), + fontFamily: 'Arial', ), home: BlocProvider( create: (context) => LoginCubit(), diff --git a/frontend/app_student/lib/week_schedule/views/week_schedule.dart b/frontend/app_student/lib/week_schedule/views/week_schedule.dart index 7c06259..616e516 100644 --- a/frontend/app_student/lib/week_schedule/views/week_schedule.dart +++ b/frontend/app_student/lib/week_schedule/views/week_schedule.dart @@ -1,6 +1,7 @@ import 'package:app_student/api/week_schedule/repositories/week_schedule_repository.dart'; import 'package:app_student/week_schedule/cubit/week_schedule_cubit.dart'; import 'package:app_student/week_schedule/views/widgets/day_schedule_widget.dart'; +import 'package:app_student/week_schedule/views/widgets/components/custom_appbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -18,22 +19,31 @@ class WeekSchedulePage extends StatelessWidget { create: (context) => weekScheduleCubit..fetchWeekSchedule('B3 Groupe 3 DLW-FA'), child: Scaffold( - appBar: AppBar( - title: const Text('Week Schedule'), - ), + appBar: const AppBarWeekSchedule(), body: BlocBuilder( builder: (context, state) { if (state is WeekScheduleLoading) { return const Center(child: CircularProgressIndicator()); } else if (state is WeekScheduleLoaded) { - return Expanded( - child: PageView.builder( - itemCount: state.weekSchedule[0].daySchedules.length, - itemBuilder: (context, index) { - final daySchedule = - state.weekSchedule[0].daySchedules[index]; - return DayScheduleWidget(daySchedule: daySchedule); - }, + return Padding( + padding: const EdgeInsets.only( + top: 30.0), // Ajoutez un espacement en haut + child: SizedBox( + height: MediaQuery.of(context).size.height, + child: PageView.builder( + itemCount: state.weekSchedule.length, // Nombre de semaines + itemBuilder: (context, weekIndex) { + final week = state.weekSchedule[weekIndex]; + return PageView.builder( + itemCount: week.daySchedules + .length, // Nombre de jours dans la semaine + itemBuilder: (context, dayIndex) { + final daySchedule = week.daySchedules[dayIndex]; + return DayScheduleWidget(daySchedule: daySchedule); + }, + ); + }, + ), ), ); } else if (state is WeekScheduleError) { diff --git a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_card.dart b/frontend/app_student/lib/week_schedule/views/widgets/card/courses_card.dart deleted file mode 100644 index 2bc7df8..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_card.dart +++ /dev/null @@ -1,21 +0,0 @@ -// import 'package:flutter/material.dart'; -// import 'courses_details.dart'; -// import 'courses_time.dart'; -// -// class CourseCard extends StatelessWidget { -// final Map course; -// -// const CourseCard({super.key, required this.course}); -// -// @override -// Widget build(BuildContext context) { -// return Center( -// child: Row( -// children: [ -// CourseTime(course: course), -// CourseDetails(course: course), -// ], -// ), -// ); -// } -// } diff --git a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_cours.dart b/frontend/app_student/lib/week_schedule/views/widgets/card/courses_cours.dart deleted file mode 100644 index 9ab573c..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_cours.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; - -class CourseCours extends StatelessWidget { - final Map course; - - const CourseCours({super.key, required this.course}); - - @override - Widget build(BuildContext context) { - return Row( - children: [ - Text(course['cours']), - const Expanded(child: SizedBox.shrink()), - SvgPicture.asset( - 'assets/images/microsoft-teams.svg', - width: 30, - height: 30, - ), - ], - ); - } -} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_details.dart b/frontend/app_student/lib/week_schedule/views/widgets/card/courses_details.dart deleted file mode 100644 index 6124dbe..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_details.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:app_student/api/events/entities/event_entity.dart'; -import 'package:flutter/material.dart'; - -class CourseDetails extends StatelessWidget { - final EventEntity event; - - const CourseDetails({super.key, required this.event}); - - @override - Widget build(BuildContext context) { - const borderColor = Color(0xFF005067); - const cardColor = Color.fromARGB(255, 144, 205, 255); - - return Card( - color: cardColor, - child: Container( - decoration: const BoxDecoration( - border: Border( - left: BorderSide( - color: borderColor, - width: 10.0, - ), - ), - ), - width: 300, - height: 120, - child: Padding( - padding: const EdgeInsets.only(left: 20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 45.0), - Text('Cours: ${event.activite}'), - const SizedBox(height: 10.0), - Text('Salle: ${event.salle}'), - ], - ), - ), - ), - ); - } -} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_time.dart b/frontend/app_student/lib/week_schedule/views/widgets/card/courses_time.dart deleted file mode 100644 index 963f2d8..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/card/courses_time.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:flutter/material.dart'; - -class CourseTime extends StatelessWidget { - final Map course; - - const CourseTime({super.key, required this.course}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(course['horaire-debut']), - Text(course['horaire-fin']), - ], - ), - ); - } -} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/components/custom_appbar.dart b/frontend/app_student/lib/week_schedule/views/widgets/components/custom_appbar.dart new file mode 100644 index 0000000..bb524d4 --- /dev/null +++ b/frontend/app_student/lib/week_schedule/views/widgets/components/custom_appbar.dart @@ -0,0 +1,23 @@ +import 'package:app_student/week_schedule/views/widgets/components/datepicker_button.dart'; +import 'package:flutter/material.dart'; + +class AppBarWeekSchedule extends StatelessWidget + implements PreferredSizeWidget { + const AppBarWeekSchedule({super.key}); + + @override + Widget build(BuildContext context) { + return AppBar( + backgroundColor: const Color(0xFF005067), + leading: Image.asset('assets/images/3il-logo.jpg'), + title: const Center( + child: Text('Classe Name', style: TextStyle(color: Colors.white))), + actions: const [ + DatePickerButton(), + ], + ); + } + + @override + Size get preferredSize => const Size.fromHeight(70.0); +} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/datepicker_button.dart b/frontend/app_student/lib/week_schedule/views/widgets/components/datepicker_button.dart similarity index 88% rename from frontend/app_student/lib/week_schedule/views/widgets/datepicker_button.dart rename to frontend/app_student/lib/week_schedule/views/widgets/components/datepicker_button.dart index 2a08b3a..73e05d3 100644 --- a/frontend/app_student/lib/week_schedule/views/widgets/datepicker_button.dart +++ b/frontend/app_student/lib/week_schedule/views/widgets/components/datepicker_button.dart @@ -6,7 +6,7 @@ class DatePickerButton extends StatelessWidget { @override Widget build(BuildContext context) { return IconButton( - icon: const Icon(Icons.calendar_today), + icon: const Icon(Icons.calendar_month, color: Colors.white), onPressed: () async { final date = await showDatePicker( context: context, diff --git a/frontend/app_student/lib/week_schedule/views/widgets/day_schedule_widget.dart b/frontend/app_student/lib/week_schedule/views/widgets/day_schedule_widget.dart index 0b387a3..bb3667a 100644 --- a/frontend/app_student/lib/week_schedule/views/widgets/day_schedule_widget.dart +++ b/frontend/app_student/lib/week_schedule/views/widgets/day_schedule_widget.dart @@ -1,5 +1,5 @@ import 'package:app_student/api/day_schedule/models/day_schedule_model.dart'; -import 'package:app_student/week_schedule/views/widgets/card/courses_details.dart'; +import 'package:app_student/week_schedule/views/widgets/events/event_details.dart'; import 'package:flutter/material.dart'; class DayScheduleWidget extends StatelessWidget { @@ -9,10 +9,12 @@ class DayScheduleWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - children: daySchedule.events.map((event) { - return CourseDetails(event: event); - }).toList(), + return SingleChildScrollView( + child: Column( + children: daySchedule.events.map((event) { + return EventDetails(event: event); + }).toList(), + ), ); } } diff --git a/frontend/app_student/lib/week_schedule/views/widgets/events/event_card.dart b/frontend/app_student/lib/week_schedule/views/widgets/events/event_card.dart new file mode 100644 index 0000000..c800d90 --- /dev/null +++ b/frontend/app_student/lib/week_schedule/views/widgets/events/event_card.dart @@ -0,0 +1,81 @@ +import 'package:app_student/api/events/models/event_model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; + +class EventCard extends StatelessWidget { + const EventCard({ + super.key, + required this.event, + }); + + final EventModel event; + + @override + Widget build(BuildContext context) { + return Card( + color: const Color(0xFF007A8D).withOpacity(0.3), + child: Container( + decoration: const BoxDecoration( + border: Border( + left: BorderSide( + color: Color(0xFF005067), + width: 10.0, + ), + ), + ), + width: 300, + height: 90, + child: Padding( + padding: + const EdgeInsets.only(left: 20.0, right: 20, bottom: 3, top: 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: event.creneau == 3 + ? MainAxisAlignment.center + : MainAxisAlignment.spaceEvenly, + children: event.creneau == 3 + ? [ + Center( + child: ColorFiltered( + colorFilter: const ColorFilter.mode( + Colors.white, BlendMode.srcIn), + child: SvgPicture.asset( + 'assets/images/eating.svg', + width: 40, + height: 40, + ), + ), + ) + ] + : [ + const Text('1h30', + style: TextStyle(color: Colors.white, fontSize: 12)), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(event.activite, + style: const TextStyle( + fontSize: 18, fontWeight: FontWeight.bold)), + ColorFiltered( + colorFilter: const ColorFilter.mode( + Colors.white, BlendMode.srcIn), + child: SvgPicture.asset( + event.visio + ? 'assets/images/teams.svg' + : 'assets/images/school.svg', + width: 40, + height: 40, + ), + ), + ], + ), + Text('Salle ${event.salle}', + style: const TextStyle( + fontSize: 15, fontWeight: FontWeight.bold)), + ], + ), + ), + ), + ); + } +} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/events/event_details.dart b/frontend/app_student/lib/week_schedule/views/widgets/events/event_details.dart new file mode 100644 index 0000000..d61ad2d --- /dev/null +++ b/frontend/app_student/lib/week_schedule/views/widgets/events/event_details.dart @@ -0,0 +1,21 @@ +import 'package:app_student/api/events/models/event_model.dart'; +import 'package:app_student/week_schedule/views/widgets/events/event_card.dart'; +import 'package:app_student/week_schedule/views/widgets/events/event_hours.dart'; +import 'package:flutter/material.dart'; + +class EventDetails extends StatelessWidget { + final EventModel event; + + const EventDetails({super.key, required this.event}); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + EventHours(event: event), + EventCard(event: event), + ], + ); + } +} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/events/event_hours.dart b/frontend/app_student/lib/week_schedule/views/widgets/events/event_hours.dart new file mode 100644 index 0000000..93c8228 --- /dev/null +++ b/frontend/app_student/lib/week_schedule/views/widgets/events/event_hours.dart @@ -0,0 +1,26 @@ +import 'package:app_student/api/events/models/event_model.dart'; +import 'package:flutter/material.dart'; + +class EventHours extends StatelessWidget { + const EventHours({ + super.key, + required this.event, + }); + + final EventModel event; + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 50, + child: Column( + children: [ + Text(event.horaires.startAt, + style: const TextStyle(fontWeight: FontWeight.bold)), + Text(event.horaires.endAt, + style: const TextStyle(fontWeight: FontWeight.bold)), + ], + ), + ); + } +} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/header/header_logo.dart b/frontend/app_student/lib/week_schedule/views/widgets/header/header_logo.dart deleted file mode 100644 index 449dfeb..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/header/header_logo.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:flutter/cupertino.dart'; - -class HeaderLogo extends StatelessWidget { - const HeaderLogo({super.key}); - - @override - Widget build(BuildContext context) { - return Container( - height: 100.0, // Réduisez la hauteur du Container - color: const Color(0xFF005067), - child: Align( - alignment: Alignment.centerLeft, // Alignez à gauche - child: Padding( - padding: - const EdgeInsets.all(8.0), // Ajoutez une marge autour du logo - child: SizedBox( - width: 100.0, // Réduisez la largeur de l'image - height: 100.0, // Réduisez la hauteur de l'image - child: Image.asset('assets/images/3il-logo.jpg'), - ), - ), - ), - ); - } -} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/header/header_text.dart b/frontend/app_student/lib/week_schedule/views/widgets/header/header_text.dart deleted file mode 100644 index c8b71a4..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/header/header_text.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'package:flutter/cupertino.dart'; - -class HeaderText extends StatelessWidget { - final String content; - - const HeaderText(this.content, {super.key}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only( - top: 5.0, - left: 25.0, - bottom: 10), // Ajout d'un espacement à gauche de 10px - child: Align( - alignment: Alignment.centerLeft, - child: Text( - content, - style: const TextStyle( - fontSize: 18.0, - fontFamily: 'Arial', - fontWeight: FontWeight.bold, - ), - ), - ), - ); - } -} diff --git a/frontend/app_student/lib/week_schedule/views/widgets/week_schedule_widget.dart b/frontend/app_student/lib/week_schedule/views/widgets/week_schedule_widget.dart deleted file mode 100644 index 52d834e..0000000 --- a/frontend/app_student/lib/week_schedule/views/widgets/week_schedule_widget.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:app_student/api/week_schedule/models/week_schedule_model.dart'; -import 'package:app_student/week_schedule/views/widgets/day_schedule_widget.dart'; -import 'package:flutter/material.dart'; - -class WeekScheduleWidget extends StatelessWidget { - final WeekScheduleModel weekSchedule; - - const WeekScheduleWidget({super.key, required this.weekSchedule}); - - @override - Widget build(BuildContext context) { - return ExpansionTile( - title: Text('Code: ${weekSchedule.code}'), - children: weekSchedule.daySchedules.map((daySchedule) { - return DayScheduleWidget(daySchedule: daySchedule); - }).toList(), - ); - } -} diff --git a/frontend/app_student/pubspec.yaml b/frontend/app_student/pubspec.yaml index 1dd14d0..f62920b 100644 --- a/frontend/app_student/pubspec.yaml +++ b/frontend/app_student/pubspec.yaml @@ -71,7 +71,7 @@ flutter: # - images/a_dot_ham.jpeg assets: - - assets/images/3il-logo.jpg + - assets/images/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware @@ -95,5 +95,10 @@ flutter: # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # + fonts: + - family: Arial + fonts: + - asset: assets/fonts/arial.ttf + # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages