fix: adjustment on the detail history minor

This commit is contained in:
akhdanre 2025-05-04 02:46:36 +07:00
parent 8f7ca1b457
commit 572808a40d
1 changed files with 22 additions and 11 deletions

View File

@ -36,7 +36,10 @@ class QuizItemComponent extends StatelessWidget {
const SizedBox(height: 12), const SizedBox(height: 12),
_buildAnswerIndicator(), _buildAnswerIndicator(),
const SizedBox(height: 16), const SizedBox(height: 16),
const Divider(height: 24), const Divider(
height: 24,
color: AppColors.shadowPrimary,
),
_buildMetadata(), _buildMetadata(),
], ],
), ),
@ -59,14 +62,22 @@ class QuizItemComponent extends StatelessWidget {
final int index = entry.key; final int index = entry.key;
final String text = entry.value; final String text = entry.value;
final isCorrect = index == item.targetAnswer; final bool isCorrectAnswer = index == item.targetAnswer;
final isWrong = index == item.userAnswer && !isCorrect; final bool isUserWrongAnswer = index == item.userAnswer && !isCorrectAnswer;
final Color? backgroundColor = isCorrect Color? backgroundColor;
? AppColors.primaryBlue.withValues(alpha: 0.15) IconData icon = LucideIcons.circle;
: isWrong Color iconColor = AppColors.shadowPrimary;
? Colors.red.withValues(alpha: 0.15)
: null; if (isCorrectAnswer) {
backgroundColor = AppColors.primaryBlue.withValues(alpha: 0.15);
icon = LucideIcons.checkCircle2;
iconColor = AppColors.primaryBlue;
} else if (isUserWrongAnswer) {
backgroundColor = Colors.red.withValues(alpha: 0.15);
icon = LucideIcons.xCircle;
iconColor = Colors.red;
}
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -75,14 +86,14 @@ class QuizItemComponent extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor, color: backgroundColor,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300), border: Border.all(color: AppColors.shadowPrimary),
), ),
child: Row( child: Row(
children: [ children: [
Icon( Icon(
LucideIcons.circle, icon,
size: 16, size: 16,
color: Colors.grey.shade600, color: iconColor,
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Flexible( Flexible(