Mudanças na aba de quiz
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,10 @@ class _QuizManagementPageState extends State<QuizManagementPage> {
|
||||
bool _loading = true;
|
||||
String _userRole = '';
|
||||
|
||||
// Disciplina seleccionada (null = vista de disciplinas)
|
||||
String? _selectedDisciplineId;
|
||||
Map<String, String> _classNames = {}; // classId → name
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -116,16 +120,37 @@ class _QuizManagementPageState extends State<QuizManagementPage> {
|
||||
}
|
||||
|
||||
final snapshot = await query.get();
|
||||
final quizzes = snapshot.docs
|
||||
.map((doc) {
|
||||
final data = Map<String, dynamic>.from(doc.data() as Map);
|
||||
data['id'] = doc.id;
|
||||
return data;
|
||||
})
|
||||
.cast<Map<String, dynamic>>()
|
||||
.toList();
|
||||
|
||||
// Obter nomes das disciplinas
|
||||
final classIdSet = <String>{};
|
||||
for (final q in quizzes) {
|
||||
final ids = (q['classIds'] as List?)?.cast<String>() ?? [];
|
||||
classIdSet.addAll(ids);
|
||||
}
|
||||
final classNamesMap = <String, String>{};
|
||||
if (classIdSet.isNotEmpty) {
|
||||
final docs = await Future.wait(
|
||||
classIdSet.map(
|
||||
(id) =>
|
||||
FirebaseFirestore.instance.collection('classes').doc(id).get(),
|
||||
),
|
||||
);
|
||||
for (final doc in docs.where((d) => d.exists)) {
|
||||
classNamesMap[doc.id] = doc.data()?['name'] as String? ?? doc.id;
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_quizHistory = snapshot.docs
|
||||
.map((doc) {
|
||||
final data = Map<String, dynamic>.from(doc.data() as Map);
|
||||
data['id'] = doc.id;
|
||||
return data;
|
||||
})
|
||||
.cast<Map<String, dynamic>>()
|
||||
.toList();
|
||||
_quizHistory = quizzes;
|
||||
_classNames = classNamesMap;
|
||||
_loading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
@@ -277,61 +302,222 @@ class _QuizManagementPageState extends State<QuizManagementPage> {
|
||||
return result ?? false;
|
||||
}
|
||||
|
||||
Map<String, List<Map<String, dynamic>>> _groupByDiscipline() {
|
||||
final Map<String, List<Map<String, dynamic>>> groups = {};
|
||||
for (final quiz in _quizHistory) {
|
||||
final quizClassIds = (quiz['classIds'] as List?)?.cast<String>() ?? [];
|
||||
String? groupId = quizClassIds.cast<String?>().firstWhere(
|
||||
(cid) => cid != null && _classNames.containsKey(cid),
|
||||
orElse: () => null,
|
||||
);
|
||||
groupId ??= quizClassIds.isNotEmpty ? quizClassIds.first : '__geral__';
|
||||
groups.putIfAbsent(groupId, () => []).add(quiz);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
_userRole == 'teacher' ? 'Gerenciar Quizzes' : 'Meu Histórico',
|
||||
),
|
||||
return PopScope(
|
||||
canPop: _selectedDisciplineId == null,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (!didPop && _selectedDisciplineId != null) {
|
||||
setState(() => _selectedDisciplineId = null);
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
foregroundColor: cs.onSurface,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
if (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
context.go(
|
||||
_userRole == 'teacher'
|
||||
? '/teacher-dashboard'
|
||||
: '/student-dashboard',
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [cs.primary.withValues(alpha: 0.05), cs.surface],
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
_userRole == 'teacher' ? 'Gerenciar Quizzes' : 'Meu Histórico',
|
||||
),
|
||||
backgroundColor: cs.surface,
|
||||
foregroundColor: cs.onSurface,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
if (_userRole == 'teacher' && _selectedDisciplineId != null) {
|
||||
setState(() => _selectedDisciplineId = null);
|
||||
return;
|
||||
}
|
||||
if (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
context.go(
|
||||
_userRole == 'teacher'
|
||||
? '/teacher-dashboard'
|
||||
: '/student-dashboard',
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
child: _loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: _quizHistory.isEmpty
|
||||
? _buildEmptyState()
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _quizHistory.length,
|
||||
itemBuilder: (context, index) {
|
||||
final quiz = _quizHistory[index];
|
||||
return _buildQuizCard(quiz)
|
||||
.animate()
|
||||
.slideX(duration: const Duration(milliseconds: 300))
|
||||
.then(delay: Duration(milliseconds: index * 50));
|
||||
},
|
||||
),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [cs.primary.withValues(alpha: 0.05), cs.surface],
|
||||
),
|
||||
),
|
||||
child: _loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: _quizHistory.isEmpty
|
||||
? _buildEmptyState()
|
||||
: _userRole == 'teacher'
|
||||
? _buildTeacherBody(cs)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _quizHistory.length,
|
||||
itemBuilder: (context, index) {
|
||||
final quiz = _quizHistory[index];
|
||||
return _buildQuizCard(quiz)
|
||||
.animate()
|
||||
.slideX(duration: const Duration(milliseconds: 300))
|
||||
.then(delay: Duration(milliseconds: index * 50));
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTeacherBody(ColorScheme cs) {
|
||||
final groups = _groupByDiscipline();
|
||||
|
||||
// Vista de quizzes de uma disciplina
|
||||
if (_selectedDisciplineId != null) {
|
||||
final quizzes = groups[_selectedDisciplineId] ?? [];
|
||||
final disciplineName =
|
||||
_classNames[_selectedDisciplineId] ??
|
||||
(_selectedDisciplineId == '__geral__'
|
||||
? 'Geral'
|
||||
: _selectedDisciplineId!);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 8, 16, 0),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: cs.onSurface),
|
||||
onPressed: () => setState(() => _selectedDisciplineId = null),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Expanded(
|
||||
child: Text(
|
||||
disciplineName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${quizzes.length} quiz${quizzes.length != 1 ? 'zes' : ''}',
|
||||
style: TextStyle(fontSize: 13, color: cs.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: quizzes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final quiz = quizzes[index];
|
||||
return _buildQuizCard(quiz)
|
||||
.animate()
|
||||
.slideX(duration: const Duration(milliseconds: 300))
|
||||
.then(delay: Duration(milliseconds: index * 50));
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// Vista de disciplinas
|
||||
final disciplineIds = groups.keys.toList();
|
||||
return ListView.separated(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: disciplineIds.length,
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 12),
|
||||
itemBuilder: (context, i) {
|
||||
final dId = disciplineIds[i];
|
||||
final dName = _classNames[dId] ?? (dId == '__geral__' ? 'Geral' : dId);
|
||||
final count = groups[dId]!.length;
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
onTap: () => setState(() => _selectedDisciplineId = dId),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline.withValues(alpha: 0.15)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.shadow.withValues(alpha: 0.05),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: cs.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(Icons.school, color: cs.primary, size: 26),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
dName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'$count quiz${count != 1 ? 'zes' : ''} criado${count != 1 ? 's' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: cs.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.chevron_right, color: cs.onSurfaceVariant),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEmptyState() {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
@@ -443,7 +629,9 @@ class _QuizManagementPageState extends State<QuizManagementPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
if (_userRole == 'teacher' && quiz['classIds'] != null) ...[
|
||||
if (_userRole == 'teacher' &&
|
||||
quiz['classIds'] != null &&
|
||||
_selectedDisciplineId == null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 4,
|
||||
|
||||
@@ -67,6 +67,9 @@ class _TeacherQuizPageState extends State<TeacherQuizPage>
|
||||
bool _loadingHistory = true;
|
||||
String? _generatingForId;
|
||||
|
||||
// Disciplina seleccionada no histórico (null = vista de disciplinas)
|
||||
String? _selectedHistoryDisciplineId;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -256,7 +259,13 @@ class _TeacherQuizPageState extends State<TeacherQuizPage>
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => context.go('/teacher-dashboard'),
|
||||
onPressed: () {
|
||||
if (_selectedHistoryDisciplineId != null) {
|
||||
setState(() => _selectedHistoryDisciplineId = null);
|
||||
} else {
|
||||
context.go('/teacher-dashboard');
|
||||
}
|
||||
},
|
||||
),
|
||||
bottom: TabBar(
|
||||
controller: _tabController,
|
||||
@@ -330,6 +339,82 @@ class _TeacherQuizPageState extends State<TeacherQuizPage>
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, String> get _classNamesMap {
|
||||
return {for (final c in _teacherClasses) c['id']!: c['name'] ?? c['id']!};
|
||||
}
|
||||
|
||||
Map<String, List<Map<String, dynamic>>> _groupHistoryByDiscipline() {
|
||||
final classNames = _classNamesMap;
|
||||
final Map<String, List<Map<String, dynamic>>> groups = {};
|
||||
for (final quiz in _history) {
|
||||
final quizClassIds = (quiz['classIds'] as List?)?.cast<String>() ?? [];
|
||||
String? groupId = quizClassIds.cast<String?>().firstWhere(
|
||||
(cid) => cid != null && classNames.containsKey(cid),
|
||||
orElse: () => null,
|
||||
);
|
||||
groupId ??= quizClassIds.isNotEmpty ? quizClassIds.first : '__geral__';
|
||||
groups.putIfAbsent(groupId, () => []).add(quiz);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
Widget _buildHistoryQuizTile(Map<String, dynamic> item, ColorScheme cs) {
|
||||
final name = (item['materialName'] as String? ?? 'Material')
|
||||
.replaceAll('.pdf', '')
|
||||
.replaceAll('_', ' ');
|
||||
final ts = item['createdAt'];
|
||||
String dateStr = '';
|
||||
if (ts is Timestamp) {
|
||||
final dt = ts.toDate();
|
||||
dateStr =
|
||||
'${dt.day.toString().padLeft(2, '0')}/${dt.month.toString().padLeft(2, '0')}/${dt.year} ${dt.hour.toString().padLeft(2, '0')}:${dt.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline.withValues(alpha: 0.15)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.shadow.withValues(alpha: 0.05),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
leading: Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: cs.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(Icons.quiz, color: cs.primary, size: 22),
|
||||
),
|
||||
title: Text(
|
||||
name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
subtitle: dateStr.isNotEmpty
|
||||
? Text(
|
||||
dateStr,
|
||||
style: TextStyle(fontSize: 12, color: cs.onSurfaceVariant),
|
||||
)
|
||||
: null,
|
||||
trailing: Icon(Icons.bar_chart, color: cs.onSurfaceVariant),
|
||||
onTap: () => _showResultsPopup(item),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHistoryTab(ColorScheme cs) {
|
||||
if (_loadingHistory)
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
@@ -355,67 +440,131 @@ class _TeacherQuizPageState extends State<TeacherQuizPage>
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final groups = _groupHistoryByDiscipline();
|
||||
final classNames = _classNamesMap;
|
||||
|
||||
// Vista de quizzes de uma disciplina
|
||||
if (_selectedHistoryDisciplineId != null) {
|
||||
final quizzes = groups[_selectedHistoryDisciplineId] ?? [];
|
||||
final disciplineName =
|
||||
classNames[_selectedHistoryDisciplineId] ??
|
||||
(_selectedHistoryDisciplineId == '__geral__'
|
||||
? 'Geral'
|
||||
: _selectedHistoryDisciplineId!);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 8, 16, 0),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: cs.onSurface),
|
||||
onPressed: () =>
|
||||
setState(() => _selectedHistoryDisciplineId = null),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Expanded(
|
||||
child: Text(
|
||||
disciplineName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${quizzes.length} quiz${quizzes.length != 1 ? 'zes' : ''}',
|
||||
style: TextStyle(fontSize: 13, color: cs.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: quizzes.length,
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 12),
|
||||
itemBuilder: (context, i) =>
|
||||
_buildHistoryQuizTile(quizzes[i], cs),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// Vista de disciplinas
|
||||
final disciplineIds = groups.keys.toList();
|
||||
return ListView.separated(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _history.length,
|
||||
itemCount: disciplineIds.length,
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 12),
|
||||
itemBuilder: (context, i) {
|
||||
final item = _history[i];
|
||||
final name = (item['materialName'] as String? ?? 'Material')
|
||||
.replaceAll('.pdf', '')
|
||||
.replaceAll('_', ' ');
|
||||
final ts = item['createdAt'];
|
||||
String dateStr = '';
|
||||
if (ts is Timestamp) {
|
||||
final dt = ts.toDate();
|
||||
dateStr =
|
||||
'${dt.day.toString().padLeft(2, '0')}/${dt.month.toString().padLeft(2, '0')}/${dt.year} ${dt.hour.toString().padLeft(2, '0')}:${dt.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline.withValues(alpha: 0.15)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.shadow.withValues(alpha: 0.05),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 8,
|
||||
final dId = disciplineIds[i];
|
||||
final dName = classNames[dId] ?? (dId == '__geral__' ? 'Geral' : dId);
|
||||
final count = groups[dId]!.length;
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
onTap: () => setState(() => _selectedHistoryDisciplineId = dId),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline.withValues(alpha: 0.15)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.shadow.withValues(alpha: 0.05),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
leading: Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: cs.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(Icons.quiz, color: cs.primary, size: 22),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: cs.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(Icons.school, color: cs.primary, size: 26),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
dName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'$count quiz${count != 1 ? 'zes' : ''} criado${count != 1 ? 's' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: cs.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.chevron_right, color: cs.onSurfaceVariant),
|
||||
],
|
||||
),
|
||||
title: Text(
|
||||
name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
color: cs.onSurface,
|
||||
),
|
||||
),
|
||||
subtitle: dateStr.isNotEmpty
|
||||
? Text(
|
||||
dateStr,
|
||||
style: TextStyle(fontSize: 12, color: cs.onSurfaceVariant),
|
||||
)
|
||||
: null,
|
||||
trailing: Icon(Icons.bar_chart, color: cs.onSurfaceVariant),
|
||||
onTap: () => _showResultsPopup(item),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user