Skip to content

Commit

Permalink
Implemented exams row in course unit information
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano-7 committed Dec 27, 2024
1 parent 40e323b commit 8a0d8fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ class CourseUnitSheetView extends StatelessWidget {
'Exams',
style: TextStyle(fontSize: 20),
),
buildExamsRow(context, exams),
if (exams.isNotEmpty) ...[
SizedBox(
height: 120,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: buildExamsRow(context, exams),
),
),

],
_buildCard(S.of(context).program, courseUnitSheet.content, context),
_buildCard(
S.of(context).evaluation,
Expand Down Expand Up @@ -201,16 +210,21 @@ Widget buildExpandedProfessors(
}

Widget buildExamsRow(BuildContext context, List<Exam> exams) {
return Wrap(
spacing: 8,
return Row(
children: exams.map((exam) {
return ExamCard(
name: exam.subject,
acronym: exam.subject,
rooms: exam.rooms,
type: exam.examType,
startTime: exam.startTime,
showIcon: false,
return Padding(
padding: const EdgeInsets.only(right: 8),
child: SizedBox(
width: 230,
child: ExamCard(
name: exam.subject,
acronym: exam.subject,
rooms: exam.rooms,
type: exam.examType,
startTime: exam.startTime,
showIcon: false,
),
),
);
}).toList(),
);
Expand Down
1 change: 1 addition & 0 deletions packages/uni_ui/lib/cards/exam_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ExamCard extends StatelessWidget {
opacity: isInvisible ? 0.6 : 1.0,
child: GenericCard(
key: key,
color: Color.fromRGBO(255, 245, 243, 1), //TODO: Use theme
child: Row(
children: [
Expanded(
Expand Down

0 comments on commit 8a0d8fb

Please sign in to comment.