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 TelaChamada extends StatefulWidget {
EstudanteModelo estudanteModelo;
List <EstudanteModelo> alunos;
int indiceAluno;
TelaChamada({
required this.estudanteModelo
required this.alunos,
required this.indiceAluno
});
@override
@@ -56,11 +58,11 @@ class _TelaChamadaState extends State<TelaChamada> {
);
getChamada(String data)async{
int cd = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_MATRICULA'];
print(widget.estudanteModelo.nroAluno);
int cd = widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_MATRICULA'];
print(widget.alunos[widget.indiceAluno].nroAluno);
setState(()=>carregando=true);
presenca.clear();
final url = '${widget.estudanteModelo.URL}/presenca?CD_MATRICULA=${cd}&DATA=$data&CIDADE=${widget.estudanteModelo.cidade}';
final url = '${widget.alunos[widget.indiceAluno].URL}/presenca?CD_MATRICULA=${cd}&DATA=$data&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -72,7 +74,7 @@ class _TelaChamadaState extends State<TelaChamada> {
@override
void initState() {
super.initState();
MainControllers().salvarLog(widget.estudanteModelo, 'CHAMADA');
MainControllers().salvarLog(widget.alunos[widget.indiceAluno], 'CHAMADA');
}
@override
@@ -116,7 +118,7 @@ class _TelaChamadaState extends State<TelaChamada> {
return Scaffold(
appBar: AppBarCustom().appbar(context, 'CHAMADAS / PRESENÇAS'),
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
drawer: DrawerCustom(alunos: widget.alunos,indiceFilhos: widget.indiceAluno),
body: carregando?Center(
child: Container(
padding: EdgeInsets.all(80),