From b909e87c0dd3b272ac03e1581d6e080e1c620441 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Mon, 3 Nov 2025 09:36:26 -0500 Subject: [PATCH] chore: add padding to the bottom of course settings page --- .../course_settings/course_settings.dart | 267 +++++++++--------- 1 file changed, 136 insertions(+), 131 deletions(-) diff --git a/lib/pangea/course_settings/course_settings.dart b/lib/pangea/course_settings/course_settings.dart index 295360fe0..c85acba8d 100644 --- a/lib/pangea/course_settings/course_settings.dart +++ b/lib/pangea/course_settings/course_settings.dart @@ -122,146 +122,151 @@ class CourseSettings extends StatelessWidget { return Column( spacing: isColumnMode ? 40.0 : 36.0, mainAxisSize: MainAxisSize.min, - children: controller.course!.topicIds.mapIndexed((index, topicId) { - final topic = controller.course!.loadedTopics[topicId]; - if (topic == null) { - return const SizedBox(); - } + children: [ + ...controller.course!.topicIds.mapIndexed((index, topicId) { + final topic = controller.course!.loadedTopics[topicId]; + if (topic == null) { + return const SizedBox(); + } - final usersInTopic = userTopics[topicId] ?? []; - final activityError = controller.activityErrors[topicId]; + final usersInTopic = userTopics[topicId] ?? []; + final activityError = controller.activityErrors[topicId]; - final bool locked = topicIndex == null ? false : index > topicIndex; - final disabled = - locked || controller.loadingActivities || activityError != null; - return AbsorbPointer( - absorbing: disabled, - child: Opacity( - opacity: disabled ? 0.5 : 1.0, - child: Column( - spacing: 12.0, - mainAxisSize: MainAxisSize.min, - children: [ - LayoutBuilder( - builder: (context, constraints) { - return Row( - spacing: 8.0, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Row( - spacing: 4.0, - mainAxisSize: MainAxisSize.min, - children: [ - Stack( - children: [ - ClipPath( - clipper: PinClipper(), - child: ImageByUrl( - imageUrl: topic.imageUrl, - width: 54.0, - replacement: Container( + final bool locked = topicIndex == null ? false : index > topicIndex; + final disabled = + locked || controller.loadingActivities || activityError != null; + return AbsorbPointer( + absorbing: disabled, + child: Opacity( + opacity: disabled ? 0.5 : 1.0, + child: Column( + spacing: 12.0, + mainAxisSize: MainAxisSize.min, + children: [ + LayoutBuilder( + builder: (context, constraints) { + return Row( + spacing: 8.0, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Row( + spacing: 4.0, + mainAxisSize: MainAxisSize.min, + children: [ + Stack( + children: [ + ClipPath( + clipper: PinClipper(), + child: ImageByUrl( + imageUrl: topic.imageUrl, + width: 54.0, + replacement: Container( + width: 54.0, + height: 54.0, + decoration: BoxDecoration( + color: theme.colorScheme.secondary, + ), + ), + ), + ), + if (locked) + const Positioned( + bottom: 0, + right: 0, + child: Icon(Icons.lock, size: 24.0), + ) + else if (controller.loadingActivities) + const SizedBox( width: 54.0, height: 54.0, - decoration: BoxDecoration( - color: theme.colorScheme.secondary, - ), - ), - ), - ), - if (locked) - const Positioned( - bottom: 0, - right: 0, - child: Icon(Icons.lock, size: 24.0), - ) - else if (controller.loadingActivities) - const SizedBox( - width: 54.0, - height: 54.0, - child: - CircularProgressIndicator.adaptive(), - ), - ], - ), - Flexible( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - topic.title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: titleFontSize, - ), - ), - if (topic.location != null) - CourseInfoChip( - icon: Icons.location_on, - text: topic.location!, - fontSize: descFontSize, - iconSize: iconSize, - ), - if (constraints.maxWidth < 700.0) - Padding( - padding: - const EdgeInsetsGeometry.symmetric( - vertical: 4.0, - ), - child: TopicParticipantList( - room: room, - users: usersInTopic, - avatarSize: - isColumnMode ? 50.0 : 25.0, - overlap: isColumnMode ? 20.0 : 8.0, - ), + child: CircularProgressIndicator + .adaptive(), ), ], ), - ), - ], - ), - ), - if (constraints.maxWidth >= 700.0) - TopicParticipantList( - room: room, - users: usersInTopic, - avatarSize: isColumnMode ? 50.0 : 25.0, - overlap: isColumnMode ? 20.0 : 8.0, - ), - ], - ); - }, - ), - if (!locked) - controller.loadingActivities - ? ActivityCardPlaceholder( - activityCount: topic.activityIds.length, - ) - : activityError != null - ? ErrorIndicator( - message: L10n.of(context).oopsSomethingWentWrong, - ) - : topic.loadedActivities.isNotEmpty - ? SizedBox( - height: isColumnMode ? 290.0 : 210.0, - child: TopicActivitiesList( - room: room, - activities: topic.loadedActivities, - loading: controller.loadingCourseSummary, - hasCompletedActivity: - controller.hasCompletedActivity, + Flexible( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + topic.title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: titleFontSize, + ), + ), + if (topic.location != null) + CourseInfoChip( + icon: Icons.location_on, + text: topic.location!, + fontSize: descFontSize, + iconSize: iconSize, + ), + if (constraints.maxWidth < 700.0) + Padding( + padding: const EdgeInsetsGeometry + .symmetric( + vertical: 4.0, + ), + child: TopicParticipantList( + room: room, + users: usersInTopic, + avatarSize: + isColumnMode ? 50.0 : 25.0, + overlap: isColumnMode ? 20.0 : 8.0, + ), + ), + ], ), - ) - : const SizedBox(), - ], + ), + ], + ), + ), + if (constraints.maxWidth >= 700.0) + TopicParticipantList( + room: room, + users: usersInTopic, + avatarSize: isColumnMode ? 50.0 : 25.0, + overlap: isColumnMode ? 20.0 : 8.0, + ), + ], + ); + }, + ), + if (!locked) + controller.loadingActivities + ? ActivityCardPlaceholder( + activityCount: topic.activityIds.length, + ) + : activityError != null + ? ErrorIndicator( + message: + L10n.of(context).oopsSomethingWentWrong, + ) + : topic.loadedActivities.isNotEmpty + ? SizedBox( + height: isColumnMode ? 290.0 : 210.0, + child: TopicActivitiesList( + room: room, + activities: topic.loadedActivities, + loading: controller.loadingCourseSummary, + hasCompletedActivity: + controller.hasCompletedActivity, + ), + ) + : const SizedBox(), + ], + ), ), - ), - ); - }).toList(), + ); + }), + const SizedBox(height: 16.0), + ], ); } }