import 'package:flutter/material.dart'; import 'package:line_icons/line_icons.dart'; import 'package:rkm_educa_app/Telas/tela_situacao_escolar.dart'; import 'package:rkm_educa_app/modelos/estudante_modelo.dart'; import 'package:rkm_educa_app/telas/tela_agenda.dart'; import 'package:rkm_educa_app/telas/tela_botetim.dart'; import 'package:rkm_educa_app/telas/tela_chamada.dart'; import 'package:rkm_educa_app/telas/tela_contatos.dart'; import 'package:rkm_educa_app/telas/tela_login.dart'; import 'package:rkm_educa_app/telas/tela_passe.dart'; import 'package:rkm_educa_app/telas/tela_perfil.dart'; import 'package:rkm_educa_app/utils/cores.dart'; import 'package:rkm_educa_app/componentes/text_custom.dart'; import 'package:rkm_educa_app/utils/dimensoes.dart'; import '../servicos/shared_preferences/shared.dart'; import 'item_drawer.dart'; class DrawerCustom extends StatelessWidget { List alunos; int indiceFilhos; DrawerCustom({ required this.alunos, required this.indiceFilhos, }); @override Widget build(BuildContext context) { // print(estudanteModelo.dados); return Container( padding: EdgeInsets.symmetric(vertical: 20), width: Dimensoes.width*0.8, color: Colors.white, child: ListView( children: [ // CircleAvatar( // radius: 70, // backgroundColor: Colors.grey[300], // child:estudanteModelo.foto==''?Container(): // ClipRRect( // child: Image.asset(estudanteModelo.foto), // borderRadius:BorderRadius.circular(70), // ) // ), Padding( padding: const EdgeInsets.symmetric(vertical: 8.0,horizontal: 40), child: TextCustom(text: alunos[indiceFilhos].NO_ALUNO.split(" ").first,fontWeight: FontWeight.bold,size: 16.0,textAlign: TextAlign.start), ), Container( height: Dimensoes.height*0.5, child: ListView( children: [ ItemDrawer( icone: LineIcons.home, texto: 'Situação Escolar', onPressed: ()=> Navigator.pushReplacement( context, MaterialPageRoute(builder: (context) => TelaSituacaoEscolar(alunos: alunos,indiceAluno: indiceFilhos)), ), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.userCircle, texto: 'Perfil', onPressed: ()=> Navigator.pushReplacement( context, MaterialPageRoute(builder: (context) => TelaPerfil(alunos: alunos,indiceAluno: indiceFilhos)), ), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.clipboardList, texto: 'Boletim Escolar ${alunos[indiceFilhos].ANO_LETIVO}', onPressed: ()=>Navigator.push(context, MaterialPageRoute( builder: (context)=> TelaBoletim( estudanteModelo: alunos[indiceFilhos], ano: '${alunos[indiceFilhos].ANO_LETIVO}', turma: "${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['DESC_SERIE']} ${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['TURMA']}", matricula: alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['CD_MATRICULA'].toString() ) ) ), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.fileContract, texto: 'Boletim Escolar ${alunos[indiceFilhos].ANO_LETIVO-1}', onPressed: ()=> Navigator.push(context, MaterialPageRoute(builder: (context)=> TelaBoletim( estudanteModelo: alunos[indiceFilhos], ano: '${alunos[indiceFilhos].ANO_LETIVO-1}', turma: "${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['DESC_SERIE']} ${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['TURMA']}", matricula: alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['CD_MATRICULA'].toString() ) ) ), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.checkSquareAlt, texto: 'Chamadas / Presenças', onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaChamada(alunos: alunos,indiceAluno: indiceFilhos))), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.calendarAlt, texto: 'Agenda Escolar', onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaAgenda(alunos: alunos,indiceAluno: indiceFilhos))), ), // Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), // ItemDrawer( // icone: LineIcons.calendarTimes, // texto: 'Eventos Escolares', // onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaEventos(estudanteModelo: estudanteModelo))), // ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.mobilePhone, texto: 'Contatos', onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaContatos(alunos: alunos,indiceAluno: indiceFilhos,))), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ItemDrawer( icone: LineIcons.bus, texto: 'Passe', onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaPasse(alunos: alunos,indiceAluno: indiceFilhos))), ), Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),), ], ), ), SizedBox(height: Dimensoes.height*0.15,), SafeArea( child: Container( alignment: Alignment.bottomRight, child: IconButton( icon: Icon(LineIcons.alternateSignOut,size: 30), onPressed: (){ final PrefService _prefService = PrefService(); _prefService.removeCacheLogin().then((value){ Navigator.pushAndRemoveUntil( context, MaterialPageRoute( builder: (context) => TelaLogin() ), (Route route) => false ); }); }, ), ), ) ], ), ); } }