You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.7 KiB
Dart
59 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:adv_basics/questions_summary/question_identifier.dart';
|
|
|
|
class SummaryItem extends StatelessWidget {
|
|
const SummaryItem(this.itemData, {super.key});
|
|
|
|
final Map<String, Object> itemData;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isCorrectAnswer =
|
|
itemData['user_answer'] == itemData['correct_answer'];
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(
|
|
vertical: 8,
|
|
),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
QuestionIdentifier(
|
|
isCorrectAnswer: isCorrectAnswer,
|
|
questionIndex: itemData['question_index'] as int,
|
|
),
|
|
const SizedBox(width: 20),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
itemData['question'] as String,
|
|
style: GoogleFonts.lato(
|
|
color: Colors.white,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 5,
|
|
),
|
|
Text(itemData['user_answer'] as String,
|
|
style: const TextStyle(
|
|
color: Color.fromARGB(255, 202, 171, 252),
|
|
)),
|
|
Text(itemData['correct_answer'] as String,
|
|
style: const TextStyle(
|
|
color: Color.fromARGB(255, 181, 254, 246),
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|