377 lines
12 KiB
Dart
377 lines
12 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_animate/flutter_animate.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
/// Quick access cards for teacher actions
|
|
class TeacherQuickActionsWidget extends StatelessWidget {
|
|
const TeacherQuickActionsWidget({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Ações Rápidas',
|
|
style: TextStyle(
|
|
color: const Color(0xFF2D3748),
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
|
|
// Primary Actions Row
|
|
Row(
|
|
children: [
|
|
// Upload Content Card (Primary)
|
|
Expanded(flex: 3, child: _buildUploadContentCard(context)),
|
|
const SizedBox(width: 16),
|
|
// Create Quiz Card (Secondary)
|
|
Expanded(flex: 2, child: _buildCreateQuizCard(context)),
|
|
],
|
|
),
|
|
const SizedBox(height: 16),
|
|
|
|
// Secondary Actions Row
|
|
Row(
|
|
children: [
|
|
// Manage Students Card
|
|
Expanded(child: _buildManageStudentsCard(context)),
|
|
const SizedBox(width: 16),
|
|
// View Analytics Card
|
|
Expanded(child: _buildViewAnalyticsCard(context)),
|
|
],
|
|
),
|
|
],
|
|
)
|
|
.animate()
|
|
.slideY(
|
|
duration: const Duration(milliseconds: 800),
|
|
curve: Curves.easeOut,
|
|
)
|
|
.then(delay: const Duration(milliseconds: 200));
|
|
}
|
|
|
|
Widget _buildUploadContentCard(BuildContext context) {
|
|
return Container(
|
|
height: 150,
|
|
decoration: BoxDecoration(
|
|
gradient: const LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [Color(0xFF82C9BD), Color(0xFF6BA8A0)],
|
|
),
|
|
borderRadius: BorderRadius.circular(16),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: const Color(0xFF82C9BD).withOpacity(0.3),
|
|
blurRadius: 15,
|
|
offset: const Offset(0, 8),
|
|
),
|
|
],
|
|
),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () => context.go('/teacher/upload'),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(20),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(7),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withOpacity(0.2),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: const Icon(
|
|
Icons.upload_file,
|
|
color: Colors.white,
|
|
size: 24,
|
|
),
|
|
),
|
|
const Spacer(),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 10,
|
|
vertical: 4,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFFF68D2D),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: const Text(
|
|
'NOVO',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Upload Conteúdo',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
Text(
|
|
'PDFs, textos, imagens',
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 12,
|
|
height: 1.2,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
.animate()
|
|
.scale(
|
|
duration: const Duration(milliseconds: 600),
|
|
curve: Curves.elasticOut,
|
|
)
|
|
.then(delay: const Duration(milliseconds: 100));
|
|
}
|
|
|
|
Widget _buildCreateQuizCard(BuildContext context) {
|
|
return Container(
|
|
height: 150,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(color: const Color(0xFFE2E8F0), width: 1),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.05),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () => context.go('/teacher/quiz/create'),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(14),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFFF68D2D).withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: const Icon(
|
|
Icons.quiz,
|
|
color: Color(0xFFF68D2D),
|
|
size: 24,
|
|
),
|
|
),
|
|
const Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Criar Quiz',
|
|
style: TextStyle(
|
|
color: Color(0xFF2D3748),
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
SizedBox(height: 4),
|
|
Text(
|
|
'Avaliações',
|
|
maxLines: 2,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
color: Color(0xFF718096),
|
|
fontSize: 12,
|
|
height: 1.2,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
.animate()
|
|
.scale(
|
|
duration: const Duration(milliseconds: 600),
|
|
curve: Curves.elasticOut,
|
|
)
|
|
.then(delay: const Duration(milliseconds: 200));
|
|
}
|
|
|
|
Widget _buildManageStudentsCard(BuildContext context) {
|
|
return Container(
|
|
height: 120,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(color: const Color(0xFFE2E8F0), width: 1),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.05),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () => context.go('/teacher/students'),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(8),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFF82C9BD).withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: const Icon(
|
|
Icons.people,
|
|
color: Color(0xFF82C9BD),
|
|
size: 20,
|
|
),
|
|
),
|
|
const Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Gerir Alunos',
|
|
style: TextStyle(
|
|
color: Color(0xFF2D3748),
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
Text(
|
|
'Acesso e permissões',
|
|
style: TextStyle(
|
|
color: Color(0xFF718096),
|
|
fontSize: 11,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
.animate()
|
|
.scale(
|
|
duration: const Duration(milliseconds: 600),
|
|
curve: Curves.elasticOut,
|
|
)
|
|
.then(delay: const Duration(milliseconds: 300));
|
|
}
|
|
|
|
Widget _buildViewAnalyticsCard(BuildContext context) {
|
|
return Container(
|
|
height: 120,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(color: const Color(0xFFE2E8F0), width: 1),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.05),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () => context.go('/teacher/analytics'),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(8),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFF6BA8A0).withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: const Icon(
|
|
Icons.analytics,
|
|
color: Color(0xFF6BA8A0),
|
|
size: 20,
|
|
),
|
|
),
|
|
const Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Analytics',
|
|
style: TextStyle(
|
|
color: Color(0xFF2D3748),
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
Text(
|
|
'Desempenho da turma',
|
|
style: TextStyle(
|
|
color: Color(0xFF718096),
|
|
fontSize: 11,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
.animate()
|
|
.scale(
|
|
duration: const Duration(milliseconds: 600),
|
|
curve: Curves.elasticOut,
|
|
)
|
|
.then(delay: const Duration(milliseconds: 400));
|
|
}
|
|
}
|