Skip to content

Commit

Permalink
Add pinned icon to the courses
Browse files Browse the repository at this point in the history
  • Loading branch information
GravityDarkLab committed Feb 2, 2024
1 parent be7f5a4 commit 3504ea8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion lib/views/course_view/components/course_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ class CourseCard extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 3.0),
child: _buildCourseTitle(themeData.textTheme),
child: Row(
children: [
Expanded(child:
_buildCourseTitle(themeData.textTheme),
),
if (isPinned)
Icon(Icons.push_pin, color: themeData.primaryColor, size:16),
],
),
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions lib/views/course_view/components/course_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CourseSection extends StatelessWidget {
Widget _buildCourseList(BuildContext context) {
bool isTablet = MediaQuery.of(context).size.width >= 600 ? true : false;
int displayCount = math.min(courses.length, 3);
double cardHeight = 75;
double cardHeight = 95;

return ConstrainedBox(
constraints: BoxConstraints(maxHeight: isTablet ? double.infinity : cardHeight * displayCount,),
Expand All @@ -98,7 +98,7 @@ class CourseSection extends StatelessWidget {
isPinned: isPinned,
onPinUnpin: (course) => _togglePin(course, isPinned),
title: course.name,
tumID: course.tUMOnlineIdentifier,
tumID: course.slug,
live: streams.any((stream) => stream.courseID == course.id),
courseId: course.id,
onTap: () {
Expand Down

0 comments on commit 3504ea8

Please sign in to comment.