Fix UI overflows in SubjectHub/Grid and guarantee Socratic checkpoints response
This commit is contained in:
@@ -302,20 +302,30 @@ class _SubjectHubScreenState extends State<SubjectHubScreen> with SingleTickerPr
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(CupertinoIcons.question_circle, color: AppColors.textSecondaryDark, size: 14),
|
||||
const SizedBox(width: 4),
|
||||
Text('${exam.questionsCount} سؤال اختياري', style: const TextStyle(color: AppColors.textSecondaryDark, fontSize: 12)),
|
||||
const SizedBox(width: 14),
|
||||
const Icon(CupertinoIcons.time, color: AppColors.textSecondaryDark, size: 14),
|
||||
const SizedBox(width: 4),
|
||||
Text('${exam.durationMinutes} دقيقة', style: const TextStyle(color: AppColors.textSecondaryDark, fontSize: 12)),
|
||||
const Spacer(),
|
||||
LuxuryButton(
|
||||
text: 'بدء الاختبار 🚀',
|
||||
Row(
|
||||
children: [
|
||||
const Icon(CupertinoIcons.question_circle, color: AppColors.textSecondaryDark, size: 14),
|
||||
const SizedBox(width: 4),
|
||||
Text('${exam.questionsCount} أسئلة', style: const TextStyle(color: AppColors.textSecondaryDark, fontSize: 12)),
|
||||
const SizedBox(width: 12),
|
||||
const Icon(CupertinoIcons.time, color: AppColors.textSecondaryDark, size: 14),
|
||||
const SizedBox(width: 4),
|
||||
Text('${exam.durationMinutes} د', style: const TextStyle(color: AppColors.textSecondaryDark, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.appleBlue,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
onPressed: () {
|
||||
SaqelToast.showInfo(context, 'جاري توليد أسئلة الاختبار التكيفي من بنك الوزارة', title: 'بدء الامتحان 📝');
|
||||
},
|
||||
child: const Text('بدء الاختبار 🚀', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w700)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -275,10 +275,13 @@ class _SubjectsGridScreenState extends State<SubjectsGridScreen> {
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
int crossAxisCount = 4;
|
||||
double aspectRatio = 1.15;
|
||||
if (constraints.maxWidth < 600) {
|
||||
crossAxisCount = 2;
|
||||
aspectRatio = 0.95;
|
||||
} else if (constraints.maxWidth < 900) {
|
||||
crossAxisCount = 3;
|
||||
aspectRatio = 1.05;
|
||||
}
|
||||
|
||||
return GridView.builder(
|
||||
@@ -288,7 +291,7 @@ class _SubjectsGridScreenState extends State<SubjectsGridScreen> {
|
||||
crossAxisCount: crossAxisCount,
|
||||
crossAxisSpacing: 16,
|
||||
mainAxisSpacing: 16,
|
||||
childAspectRatio: 1.15,
|
||||
childAspectRatio: aspectRatio,
|
||||
),
|
||||
itemCount: state.filteredSubjects.length,
|
||||
itemBuilder: (context, idx) {
|
||||
|
||||
Reference in New Issue
Block a user