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

@@ -15,10 +15,12 @@ import 'package:http/http.dart' as http;
import '../controllers/main_controllers.dart';
class TelaAgenda extends StatefulWidget {
EstudanteModelo estudanteModelo;
List <EstudanteModelo> alunos;
int indiceAluno;
TelaAgenda({
required this.estudanteModelo
required this.alunos,
required this.indiceAluno
});
@override
@@ -69,11 +71,11 @@ class _TelaAgendaState extends State<TelaAgenda> {
carregandoEventos = true;
setState(() {});
final url = '${widget.estudanteModelo.URL}/calendario?'
final url = '${widget.alunos[widget.indiceAluno].URL}/calendario?'
'MES=${dataAtual.year}-${dataAtual.month}-01&'
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
'COD_ESCOLA=${widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_CAD_DIVERSO']}&'
'QUANTIDADE=31&'
'CIDADE=${widget.estudanteModelo.cidade}';
'CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -117,7 +119,7 @@ class _TelaAgendaState extends State<TelaAgenda> {
void initState() {
super.initState();
buscarEventos();
MainControllers().salvarLog(widget.estudanteModelo, 'AGENDA');
MainControllers().salvarLog(widget.alunos[widget.indiceAluno], 'AGENDA');
}
@override
@@ -149,7 +151,7 @@ class _TelaAgendaState extends State<TelaAgenda> {
return Scaffold(
appBar: AppBarCustom().appbar(context, 'AGENDA ESCOLAR'),
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
drawer: DrawerCustom(alunos: widget.alunos,indiceFilhos: widget.indiceAluno),
body: carregandoEventos?Center(
child: Container(
padding: EdgeInsets.all(80),