ajustes para a troca de estudante

This commit is contained in:
Reginaldo
2023-08-22 16:54:47 -03:00
parent 94a181e767
commit 822e7f7b7c
15 changed files with 313 additions and 115 deletions

View File

@@ -14,10 +14,12 @@ import '../utils/cores.dart';
import '../utils/dimensoes.dart';
class TelaHistorico extends StatefulWidget {
EstudanteModelo estudanteModelo;
List <EstudanteModelo> alunos;
int indiceAluno;
TelaHistorico({
required this.estudanteModelo
required this.alunos,
required this.indiceAluno
});
@override
@@ -32,14 +34,14 @@ class _TelaHistoricoState extends State<TelaHistorico> {
@override
void initState() {
super.initState();
MainControllers().salvarLog(widget.estudanteModelo, 'HISTORICO');
print(widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO']);
MainControllers().salvarLog(widget.alunos[widget.indiceAluno], 'HISTORICO');
print(widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_ALUNO']);
getMatriculas();
}
getMatriculas()async{
String cd = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
final url = '${widget.estudanteModelo.URL}/matriculas_aluno?CD_ALUNO=$cd&CIDADE=${widget.estudanteModelo.cidade}';
String cd = widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_ALUNO'];
final url = '${widget.alunos[widget.indiceAluno].URL}/matriculas_aluno?CD_ALUNO=$cd&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -55,7 +57,7 @@ class _TelaHistoricoState extends State<TelaHistorico> {
onTap: ()=> Navigator.push(context,
MaterialPageRoute(builder: (context)=>
TelaBoletim(
estudanteModelo: widget.estudanteModelo,
estudanteModelo: widget.alunos[widget.indiceAluno],
ano: '${list[i]['ANO_FREQ']}',
turma: '${list[i]['DESC_SERIE']} ${list[i]['TURMA']}',
matricula: list[i]['CD_MATRICULA'].toString(),
@@ -76,7 +78,7 @@ class _TelaHistoricoState extends State<TelaHistorico> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarCustom().appbar(context, 'HISTÓRICO ESCOLAR'),
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
drawer: DrawerCustom(alunos:widget.alunos,indiceFilhos: widget.indiceAluno),
body: carregando?Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,