ajustes para a troca de estudante
This commit is contained in:
@@ -13,10 +13,12 @@ import '../controllers/main_controllers.dart';
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class TelaPasse extends StatefulWidget {
|
||||
EstudanteModelo estudanteModelo;
|
||||
List <EstudanteModelo> alunos;
|
||||
int indiceAluno;
|
||||
|
||||
TelaPasse({
|
||||
required this.estudanteModelo
|
||||
required this.alunos,
|
||||
required this.indiceAluno
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -34,8 +36,8 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
|
||||
getPasse()async{
|
||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||
String passe = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||
final url = '${widget.estudanteModelo.URL}/passe?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||
String passe = widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_ALUNO'];
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/passe?CD_ALUNO=${teste_passe}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
@@ -61,7 +63,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
}
|
||||
getFrequencia(String CD_ALUNO)async{
|
||||
dadosFrequncia.clear();
|
||||
final url = '${widget.estudanteModelo.URL}/frequencia?CD_ALUNO=${CD_ALUNO}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/frequencia?CD_ALUNO=${CD_ALUNO}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
@@ -114,8 +116,8 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
carregando = true;
|
||||
setState(() {});
|
||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||
String CD_ALUNO = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||
final url = '${widget.estudanteModelo.URL}/carteira?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||
String CD_ALUNO = widget.alunos[widget.indiceAluno].dados[widget.indiceAluno]['CD_ALUNO'];
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/carteira?CD_ALUNO=${teste_passe}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
@@ -165,9 +167,9 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
Container(
|
||||
width: 53,
|
||||
height: 49,
|
||||
child: Image.asset('assets/images/logo_carteirinha_${widget.estudanteModelo.cidade.toLowerCase()}.png'),
|
||||
child: Image.asset('assets/images/logo_carteirinha_${widget.alunos[widget.indiceAluno].cidade.toLowerCase()}.png'),
|
||||
),
|
||||
TextCustom(text: widget.estudanteModelo.cidade,size: 16.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
TextCustom(text: widget.alunos[widget.indiceAluno].cidade,size: 16.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -341,7 +343,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MainControllers().salvarLog(widget.estudanteModelo, 'PASSE');
|
||||
MainControllers().salvarLog(widget.alunos[widget.indiceAluno], 'PASSE');
|
||||
getPasse();
|
||||
}
|
||||
|
||||
@@ -349,7 +351,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBarCustom().appbar(context, 'PASSE ESCOLAR'),
|
||||
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
|
||||
drawer: DrawerCustom(alunos: widget.alunos,indiceFilhos: widget.indiceAluno),
|
||||
bottomSheet: carregando?SizedBox(width: 0,height: 0,): Container(
|
||||
width: Dimensoes.width,
|
||||
height: 70,
|
||||
@@ -382,7 +384,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.black,
|
||||
child: TextCustom(text: widget.estudanteModelo.NO_ALUNO,fontWeight: FontWeight.bold,color: Colors.white,textAlign: TextAlign.center),
|
||||
child: TextCustom(text: widget.alunos[widget.indiceAluno].NO_ALUNO,fontWeight: FontWeight.bold,color: Colors.white,textAlign: TextAlign.center),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
@@ -409,7 +411,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
TextCustom(text: 'LINHA: ${dadosPasse[0]['NR_TRANSPORTE']}',size: 14.0, fontWeight: FontWeight.bold,),
|
||||
TextCustom(text: 'SÉRIE: ${dadosPasse[0]['DESC_SERIE']} - ${dadosPasse[0]['GRAU']}'
|
||||
' TURNO: ${dadosPasse[0]['TURNO'].toString().trim()=='1'?'MANHÃ':dadosPasse[0]['GRAU'].toString().trim()=='2'?'TARDE':''}',size: 14.0, fontWeight: FontWeight.bold,),
|
||||
TextCustom(text: 'ESCOLA: ${widget.estudanteModelo.ESCOLA}',size: 14.0, fontWeight: FontWeight.bold,),
|
||||
TextCustom(text: 'ESCOLA: ${widget.alunos[widget.indiceAluno].ESCOLA}',size: 14.0, fontWeight: FontWeight.bold,),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 20),
|
||||
color: Colors.black,
|
||||
|
||||
Reference in New Issue
Block a user