cadastro dos pais direto pelo app
This commit is contained in:
@@ -37,28 +37,34 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
getPasse()async{
|
||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||
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}';
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/passe?CD_ALUNO=${passe}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
dadosPasse = map;
|
||||
print(dadosPasse);
|
||||
String dataBD = dadosPasse[0]['DT_NASCIMENTO']??'';
|
||||
if(dataBD!=''){
|
||||
dataNasc = '${dataBD.substring(6,8)} / ${dataBD.substring(4,6)} / ${dataBD.substring(0,4)}';
|
||||
}
|
||||
String dataDBEmissao = dadosPasse[0]['VALIDADE_CARTEIRINHA']??'';
|
||||
if(dataDBEmissao!=''){
|
||||
List list = dataDBEmissao.toString().split('-');
|
||||
dataEmissao = '${list[2]} / ${list[1]} / ${list[0]}';
|
||||
}
|
||||
|
||||
if(dadosPasse.length==0){
|
||||
showSnackBar(context, 'Nenhum passe disponível', Colors.red);
|
||||
showSnackBar(context, 'Não há registros de passe', Colors.red);
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
}else{
|
||||
getFrequencia(teste_passe);
|
||||
String dataBD = dadosPasse[0]['DT_NASCIMENTO']??'';
|
||||
if(dataBD!=''){
|
||||
dataNasc = '${dataBD.substring(6,8)} / ${dataBD.substring(4,6)} / ${dataBD.substring(0,4)}';
|
||||
}
|
||||
String dataDBEmissao = dadosPasse[0]['VALIDADE_CARTEIRINHA']??'';
|
||||
if(dataDBEmissao!=''){
|
||||
List list = dataDBEmissao.toString().split('-');
|
||||
dataEmissao = '${list[2]} / ${list[1]} / ${list[0]}';
|
||||
}
|
||||
|
||||
if(dadosPasse.length==0){
|
||||
showSnackBar(context, 'Nenhum passe disponível', Colors.red);
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
}else{
|
||||
getFrequencia(passe);
|
||||
}
|
||||
}
|
||||
}
|
||||
getFrequencia(String CD_ALUNO)async{
|
||||
@@ -70,7 +76,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
dadosFrequncia = map;
|
||||
print(dadosFrequncia);
|
||||
if(dadosPasse.length==0){
|
||||
showSnackBar(context, 'Nenhuma frequência registrada', Colors.red);
|
||||
showSnackBar(context, 'Nenhuma informação do passe escolar disponível', Colors.red);
|
||||
}else{
|
||||
dadosFrequncia = [
|
||||
{'DIA':1,'PRESENTE':0},
|
||||
@@ -117,227 +123,233 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
setState(() {});
|
||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||
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}';
|
||||
final url = '${widget.alunos[widget.indiceAluno].URL}/carteira?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);
|
||||
dadosCarteira = map;
|
||||
print(dadosCarteira);
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
AlertDefault().alert(
|
||||
context, Dimensoes.height*0.8,
|
||||
SafeArea(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.topCenter,
|
||||
width: 378,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
if(map.length==0){
|
||||
showSnackBar(context, 'Nenhuma informação da carteira encontrada', Colors.red);
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
}else{
|
||||
dadosCarteira = map;
|
||||
print(dadosCarteira);
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
AlertDefault().alert(
|
||||
context, Dimensoes.height*0.8,
|
||||
SafeArea(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.topCenter,
|
||||
width: 378,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 124,
|
||||
height: 159,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: '3x4',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Column(
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 235,
|
||||
height: 65,
|
||||
width: 124,
|
||||
height: 159,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 53,
|
||||
height: 49,
|
||||
child: Image.asset('assets/images/logo_carteirinha_${widget.alunos[widget.indiceAluno].cidade.toLowerCase()}.png'),
|
||||
child: TextCustom(text: '3x4',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 235,
|
||||
height: 65,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
TextCustom(text: widget.alunos[widget.indiceAluno].cidade,size: 16.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
],
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 53,
|
||||
height: 49,
|
||||
child: Image.asset('assets/images/logo_carteirinha_${widget.alunos[widget.indiceAluno].cidade.toLowerCase()}.png'),
|
||||
),
|
||||
TextCustom(text: widget.alunos[widget.indiceAluno].cidade,size: 16.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: '1ª Via - Transporte Escolar',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'RA: ${dadosCarteira[0]['NR_RA']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 54,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'Nome: ${dadosCarteira[0]['NO_ALUNO']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 27.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: ' Endereço: ${dadosCarteira[0]['NO_LOGRADOURO']}, ${dadosCarteira[0]['NR_LOGRADOURO']}, ${dadosCarteira[0]['DESC_BAIRRO']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(
|
||||
text: ' Fone: (${dadosCarteira[0]['NR_DDD_TELEFONE']}) ${dadosCarteira[0]['NR_TELEFONE']} Escola: ${dadosCarteira[0]['NO_FANTASIA']}',
|
||||
size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(
|
||||
text: ' Celular: (${dadosCarteira[0]['NR_DDD_CELULAR']}) ${dadosCarteira[0]['NR_CELULAR']} Validade: ${dadosCarteira[0]['VALIDADE_CARTEIRINHA']} CEAC: ${dadosCarteira[0]['CEAC'].toString().trim()=='N'?'NÃO':'SIM'}',
|
||||
size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: ' Tipo Transp.: ${dadosCarteira[0]['FL_TIPO_TRANSPORTE'].toString().trim()=='R'?'TRANSPORTE MUNICIPAL':'TRANSPORTE INTERMUNICIPAL'}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 378,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 4.0)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 212,
|
||||
height: 60,
|
||||
child: TextCustom(
|
||||
text:'Respeite a orientação do condutor do veículo, pois ele é seu amigo. Obrigatória apresentação desta identificação, diariamente.',
|
||||
maxLines: 4,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.justify,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12,),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 20,
|
||||
width: 211,
|
||||
height: 45,
|
||||
child: TextCustom(
|
||||
text:'Casos de insubordinação serão comunicados aos pais e estarão sujeitos a advertência.',
|
||||
maxLines: 3,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.justify,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 70,),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: 211,
|
||||
height: 2,
|
||||
color: Colors.black,
|
||||
),
|
||||
Container(
|
||||
width: 211,
|
||||
height: 45,
|
||||
child: TextCustom(
|
||||
text:'Coordenadoria de Educação',
|
||||
maxLines: 3,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 132,
|
||||
height: 112,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: '1ª Via - Transporte Escolar',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
child: TextCustom(text: 'Ano:', size: 12.0,color: Colors.black,fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 20,
|
||||
width: 132,
|
||||
height: 112,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'RA: ${dadosCarteira[0]['NR_RA']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
height: 54,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'Nome: ${dadosCarteira[0]['NO_ALUNO']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black),
|
||||
),
|
||||
child: TextCustom(text: 'Ano:', size: 12.0,color: Colors.black,fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 27.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: ' Endereço: ${dadosCarteira[0]['NO_LOGRADOURO']}, ${dadosCarteira[0]['NR_LOGRADOURO']}, ${dadosCarteira[0]['DESC_BAIRRO']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(
|
||||
text: ' Fone: (${dadosCarteira[0]['NR_DDD_TELEFONE']}) ${dadosCarteira[0]['NR_TELEFONE']} Escola: ${dadosCarteira[0]['NO_FANTASIA']}',
|
||||
size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(
|
||||
text: ' Celular: (${dadosCarteira[0]['NR_DDD_CELULAR']}) ${dadosCarteira[0]['NR_CELULAR']} Validade: ${dadosCarteira[0]['VALIDADE_CARTEIRINHA']} CEAC: ${dadosCarteira[0]['CEAC'].toString().trim()=='N'?'NÃO':'SIM'}',
|
||||
size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: ' Tipo Transp.: ${dadosCarteira[0]['FL_TIPO_TRANSPORTE'].toString().trim()=='R'?'TRANSPORTE MUNICIPAL':'TRANSPORTE INTERMUNICIPAL'}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
ButtonCustom(
|
||||
text: 'Voltar',
|
||||
fontsize: 14.0,
|
||||
colorBorder: PaletaCores.cinzaClaro,
|
||||
colorButton: PaletaCores.cinzaClaro,
|
||||
colorText: Colors.white,
|
||||
widthCustom: 0.25,
|
||||
heightCustom: 0.05,
|
||||
onPressed: ()=>Navigator.of(context).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 378,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 4.0)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 212,
|
||||
height: 60,
|
||||
child: TextCustom(
|
||||
text:'Respeite a orientação do condutor do veículo, pois ele é seu amigo. Obrigatória apresentação desta identificação, diariamente.',
|
||||
maxLines: 4,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.justify,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12,),
|
||||
Container(
|
||||
width: 211,
|
||||
height: 45,
|
||||
child: TextCustom(
|
||||
text:'Casos de insubordinação serão comunicados aos pais e estarão sujeitos a advertência.',
|
||||
maxLines: 3,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.justify,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 70,),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: 211,
|
||||
height: 2,
|
||||
color: Colors.black,
|
||||
),
|
||||
Container(
|
||||
width: 211,
|
||||
height: 45,
|
||||
child: TextCustom(
|
||||
text:'Coordenadoria de Educação',
|
||||
maxLines: 3,
|
||||
size: 12.0,
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 132,
|
||||
height: 112,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'Ano:', size: 12.0,color: Colors.black,fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(height: 14,),
|
||||
Container(
|
||||
width: 132,
|
||||
height: 112,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
),
|
||||
child: TextCustom(text: 'Ano:', size: 12.0,color: Colors.black,fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
ButtonCustom(
|
||||
text: 'Voltar',
|
||||
fontsize: 14.0,
|
||||
colorBorder: PaletaCores.cinzaClaro,
|
||||
colorButton: PaletaCores.cinzaClaro,
|
||||
colorText: Colors.white,
|
||||
widthCustom: 0.25,
|
||||
heightCustom: 0.05,
|
||||
onPressed: ()=>Navigator.of(context).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -380,7 +392,9 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.all(10),
|
||||
height: Dimensoes.height,
|
||||
child: ListView(
|
||||
child: dadosPasse.length ==0?Container(
|
||||
child: TextCustom(text: 'Nenhuma informação do passe escolar disponível.',maxLines: 3,),
|
||||
):ListView(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.black,
|
||||
|
||||
Reference in New Issue
Block a user