ajustes do historico escolar e carteirinha
This commit is contained in:
@@ -72,12 +72,12 @@ class DrawerCustom extends StatelessWidget {
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.clipboardList,
|
||||
texto: 'Boletim Escolar',
|
||||
texto: 'Boletim Escolar ${DateTime.now().year}',
|
||||
onPressed: ()=>Navigator.push(context, MaterialPageRoute(
|
||||
builder: (context)=>
|
||||
TelaBoletim(
|
||||
estudanteModelo: alunos[indiceFilhos],
|
||||
ano: '2023',
|
||||
ano: '${DateTime.now().year}',
|
||||
turma: "${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['DESC_SERIE']} ${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['TURMA']}",
|
||||
matricula: alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['CD_MATRICULA'].toString()
|
||||
)
|
||||
@@ -87,8 +87,17 @@ class DrawerCustom extends StatelessWidget {
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.fileContract,
|
||||
texto: 'Histórico Escolar',
|
||||
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaHistorico(alunos: alunos,indiceAluno: indiceFilhos))),
|
||||
texto: 'Boletim Escolar ${DateTime.now().year-1}',
|
||||
onPressed: ()=> Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context)=>
|
||||
TelaBoletim(
|
||||
estudanteModelo: alunos[indiceFilhos],
|
||||
ano: '${DateTime.now().year-1}',
|
||||
turma: "${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['DESC_SERIE']} ${alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['TURMA']}",
|
||||
matricula: alunos[indiceFilhos].dados[alunos[indiceFilhos].nroAluno]['CD_MATRICULA'].toString()
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:rkm_educa_app/telas/tela_splash.dart';
|
||||
|
||||
@@ -12,6 +13,8 @@ class PostHttpOverrides extends HttpOverrides{
|
||||
}
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
HttpOverrides.global = new PostHttpOverrides();
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
@@ -38,6 +38,31 @@ class _TelaBoletimState extends State<TelaBoletim> {
|
||||
List <ItemDisciplina> listDisciplinas3 = [];
|
||||
List <ItemDisciplina> listDisciplinas4 = [];
|
||||
bool carregando = true;
|
||||
String matricula = '';
|
||||
|
||||
getMatriculas()async{
|
||||
String cd = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||
final url = '${widget.estudanteModelo.URL}/matriculas_aluno?CD_ALUNO=$cd&CIDADE=${widget.estudanteModelo.cidade}';
|
||||
print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
List list0 = map;
|
||||
List list = list0.reversed.toList();
|
||||
print(map);
|
||||
if(list.length!=0){
|
||||
for(int i=0; list.length>i;i++){
|
||||
if('${list[i]['ANO_FREQ']}'.toString().trim() == widget.ano){
|
||||
widget.matricula = list[i]['CD_MATRICULA'].toString();
|
||||
widget.turma = '${list[i]['DESC_SERIE']} ${list[i]['TURMA']}';
|
||||
}
|
||||
}
|
||||
buscarNotas();
|
||||
}else{
|
||||
showSnackBar(context, 'Notas não encontradas!', Colors.red);
|
||||
carregando = false;
|
||||
setState((){});
|
||||
}
|
||||
}
|
||||
|
||||
buscarNotas()async{
|
||||
|
||||
@@ -146,14 +171,14 @@ class _TelaBoletimState extends State<TelaBoletim> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
buscarNotas();
|
||||
getMatriculas();
|
||||
MainControllers().salvarLog(widget.estudanteModelo, 'BOLETIM');
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBarCustom().appbar(context, 'BOLETIM ESCOLAR'),
|
||||
appBar: AppBarCustom().appbar(context, 'BOLETIM ESCOLAR ${widget.ano}'),
|
||||
// drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
|
||||
body: carregando?Center(
|
||||
child: Row(
|
||||
|
||||
@@ -107,7 +107,7 @@ class _TelaCadastroState extends State<TelaCadastro> {
|
||||
|
||||
criarNumero(){
|
||||
var random = Random();
|
||||
nroSMS = (random.nextInt(9000) + 1000).toString();
|
||||
nroSMS = (random.nextInt(900000) + 100000).toString();
|
||||
apiSMS();
|
||||
}
|
||||
|
||||
@@ -116,7 +116,8 @@ class _TelaCadastroState extends State<TelaCadastro> {
|
||||
final String authToken = '6nPV7rkTncLaugyoEBHQklHrvD5-GzDVMCeI';
|
||||
final headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization':'Y2FicmV1dmEucmVzdDo0U0lmYktjUTgy',
|
||||
'Authorization':'cmttc2lzdGVtYXMucmVzdDp5Nkc5TnNlNDVV',
|
||||
// 'Authorization':'Y2FicmV1dmEucmVzdDo0U0lmYktjUTgy',
|
||||
'Cache-Control': 'no-cache'
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class _TelaHistoricoState extends State<TelaHistorico> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBarCustom().appbar(context, 'HISTÓRICO ESCOLAR'),
|
||||
appBar: AppBarCustom().appbar(context, 'BOLETIM ESCOLAR ${DateTime.now().year-1}'),
|
||||
drawer: DrawerCustom(alunos:widget.alunos,indiceFilhos: widget.indiceAluno),
|
||||
body: carregando?Center(
|
||||
child: Row(
|
||||
|
||||
@@ -33,11 +33,13 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
bool carregando = true;
|
||||
String dataNasc = '';
|
||||
String dataEmissao = '';
|
||||
double borda = 1.0;
|
||||
|
||||
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=${passe}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
//aqui
|
||||
// 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);
|
||||
@@ -63,7 +65,8 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
carregando = false;
|
||||
setState(() {});
|
||||
}else{
|
||||
getFrequencia(passe);
|
||||
//aqui
|
||||
getFrequencia(teste_passe);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,8 +125,9 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
carregando = true;
|
||||
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=${CD_ALUNO}&CIDADE=${widget.alunos[widget.indiceAluno].cidade}';
|
||||
//aqui
|
||||
// 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);
|
||||
@@ -146,9 +150,9 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
Container(
|
||||
alignment: Alignment.topCenter,
|
||||
width: 378,
|
||||
height: 270,
|
||||
height: 268,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -160,18 +164,18 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
height: 159,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: TextCustom(text: '3x4',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 235,
|
||||
width: 237,
|
||||
height: 65,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -185,26 +189,26 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
width: 237,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: TextCustom(text: '1ª Via - Transporte Escolar',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
width: 237,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: TextCustom(text: 'RA: ${dadosCarteira[0]['NR_RA']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black,),
|
||||
),
|
||||
Container(
|
||||
width: 235,
|
||||
width: 237,
|
||||
height: 54,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: TextCustom(text: 'Nome: ${dadosCarteira[0]['NO_ALUNO']}',size: 12.0,fontWeight: FontWeight.bold,color: Colors.black),
|
||||
),
|
||||
@@ -216,7 +220,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
width: 373,
|
||||
height: 27.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
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,),
|
||||
),
|
||||
@@ -224,7 +228,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
child: TextCustom(
|
||||
text: ' Fone: (${dadosCarteira[0]['NR_DDD_TELEFONE']}) ${dadosCarteira[0]['NR_TELEFONE']} Escola: ${dadosCarteira[0]['NO_FANTASIA']}',
|
||||
@@ -234,7 +238,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
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'}',
|
||||
@@ -244,7 +248,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
width: 373,
|
||||
height: 26.5,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 2.0)
|
||||
border: Border.all(width: borda)
|
||||
),
|
||||
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,),
|
||||
),
|
||||
@@ -255,7 +259,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
||||
width: 378,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 4.0)
|
||||
border: Border.all(width: borda*2)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user