ajustes para a troca de estudante
This commit is contained in:
@@ -9,14 +9,18 @@ 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 'package:syncfusion_flutter_charts/charts.dart';
|
||||
import '../componentes/alert_default.dart';
|
||||
import '../componentes/buttom_custom.dart';
|
||||
import '../componentes/drawer_custom.dart';
|
||||
import '../modelos/evento_modelo.dart';
|
||||
|
||||
class TelaSituacaoEscolar extends StatefulWidget {
|
||||
EstudanteModelo estudanteModelo;
|
||||
List <EstudanteModelo> alunos;
|
||||
int indiceAluno;
|
||||
|
||||
TelaSituacaoEscolar({
|
||||
required this.estudanteModelo
|
||||
required this.alunos,
|
||||
required this.indiceAluno
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -33,10 +37,10 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
||||
bool carregandoOcorrencias = true;
|
||||
|
||||
buscarEventos()async{
|
||||
final url = '${widget.estudanteModelo.URL}/calendario_home?'
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/calendario_home?'
|
||||
'HOJE=${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}&'
|
||||
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
|
||||
'CIDADE=${widget.estudanteModelo.cidade}';
|
||||
'COD_ESCOLA=${widget.alunos[widget.indiceAluno].dados[widget.alunos[widget.indiceAluno].nroAluno]['CD_CAD_DIVERSO']}&'
|
||||
'CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
// print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
@@ -51,9 +55,9 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
||||
}
|
||||
|
||||
buscarOcorrencia()async{
|
||||
final url = '${widget.estudanteModelo.URL}/ocorrencia?'
|
||||
'MATRICULA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_MATRICULA']}&'
|
||||
'CIDADE=${widget.estudanteModelo.cidade}';
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/ocorrencia?'
|
||||
'MATRICULA=${widget.alunos[widget.indiceAluno].dados[widget.alunos[widget.indiceAluno].nroAluno]['CD_MATRICULA']}&'
|
||||
'CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
@@ -68,7 +72,7 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MainControllers().salvarLog(widget.estudanteModelo, 'DASHBOARD');
|
||||
MainControllers().salvarLog(widget.alunos[widget.indiceAluno], 'DASHBOARD');
|
||||
buscarEventos();
|
||||
buscarOcorrencia();
|
||||
// data = [
|
||||
@@ -102,16 +106,77 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
actions: [
|
||||
widget.alunos.length==1?Container():
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
AlertDefault().alert(
|
||||
context,
|
||||
0.35,
|
||||
Container(
|
||||
height: Dimensoes.height*0.25,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
height: widget.alunos.length*80,
|
||||
child: ListView.builder(
|
||||
itemCount: widget.alunos.length,
|
||||
itemBuilder: (context,index){
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
print(index);
|
||||
widget.indiceAluno = index;
|
||||
setState(() {
|
||||
print(widget.indiceAluno);
|
||||
});
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Card(
|
||||
color: PaletaCores.cinzaInput,
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
child: TextCustom(text: widget.alunos[index].NO_ALUNO)
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
TextCustom(text: 'Clique em um dos nomes para exibir os dados do estudante selecionado.',maxLines: 3),
|
||||
ButtonCustom(
|
||||
onPressed: ()=>Navigator.pop(context),
|
||||
text: 'Fechar',
|
||||
widthCustom: 0.2,
|
||||
heightCustom: 0.05,
|
||||
fontsize: 14,
|
||||
colorText: Colors.white,
|
||||
colorBorder: PaletaCores.cinza,
|
||||
colorButton: PaletaCores.cinza,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 20,
|
||||
alignment: Alignment.center,
|
||||
child: TextCustom(
|
||||
text: 'Trocar Estudante',
|
||||
color: PaletaCores.corPrimaria,
|
||||
fontWeight: FontWeight.bold,
|
||||
)
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: IconButton(
|
||||
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaAvisos(estudanteModelo: widget.estudanteModelo,))),
|
||||
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaAvisos(alunos: widget.alunos,indiceAluno: widget.indiceAluno,))),
|
||||
icon: Icon(Icons.notifications_outlined,size: 32),
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
|
||||
drawer: DrawerCustom(alunos: widget.alunos,indiceFilhos: widget.indiceAluno),
|
||||
body: ListView(
|
||||
children: [
|
||||
Center(
|
||||
|
||||
Reference in New Issue
Block a user