From 36aefb1a13fb2a3be8c9fb00209db9df591ee9b4 Mon Sep 17 00:00:00 2001 From: Reginaldo Date: Wed, 23 Aug 2023 16:52:18 -0300 Subject: [PATCH] cadastro dos pais direto pelo app --- lib/modelos/cidade_model.dart | 9 + lib/telas/tela_cadastro.dart | 160 ++++++++++++- lib/telas/tela_login.dart | 2 +- lib/telas/tela_passe.dart | 432 ++++++++++++++++++---------------- lib/utils/fixos.dart | 8 + pubspec.lock | 8 + pubspec.yaml | 1 + 7 files changed, 398 insertions(+), 222 deletions(-) create mode 100644 lib/modelos/cidade_model.dart diff --git a/lib/modelos/cidade_model.dart b/lib/modelos/cidade_model.dart new file mode 100644 index 0000000..7047f3d --- /dev/null +++ b/lib/modelos/cidade_model.dart @@ -0,0 +1,9 @@ +class CidadeModel{ + String cidade; + String cidadeQuery; + + CidadeModel({ + required this.cidade, + required this.cidadeQuery + }); +} \ No newline at end of file diff --git a/lib/telas/tela_cadastro.dart b/lib/telas/tela_cadastro.dart index b9d3230..3fd6dde 100644 --- a/lib/telas/tela_cadastro.dart +++ b/lib/telas/tela_cadastro.dart @@ -1,15 +1,25 @@ +import 'dart:convert'; + import 'package:brasil_fields/brasil_fields.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; - +import 'package:get/get_utils/src/get_utils/get_utils.dart'; +import 'package:intl/intl.dart'; +import 'package:rkm_educa_app/componentes/text_custom.dart'; +import 'package:rkm_educa_app/telas/tela_login.dart'; import '../componentes/appbar_custom.dart'; import '../componentes/buttom_custom.dart'; import '../componentes/input_text.dart'; +import '../componentes/snackBars.dart'; import '../utils/cores.dart'; import '../utils/dimensoes.dart'; +import '../utils/fixos.dart'; +import 'package:http/http.dart' as http; class TelaCadastro extends StatefulWidget { - const TelaCadastro({Key? key}) : super(key: key); + String api; + + TelaCadastro({required this.api}); @override State createState() => _TelaCadastroState(); @@ -20,10 +30,112 @@ class _TelaCadastroState extends State { final inputCPF = TextEditingController(); final inputSenha = TextEditingController(); final inputRepita = TextEditingController(); - final inputCodigo = TextEditingController(); + String? cidade; + String cidadeQuery = ''; + bool carregando = false; + + verificacao(){ + if(inputCPF.text.isNotEmpty){ + if(inputSenha.text.isNotEmpty){ + if(inputRepita.text.isNotEmpty){ + if(inputSenha.text == inputRepita.text){ + if(GetUtils.isCpf(inputCPF.text)){ + if(cidadeQuery!=''){ + carregando = true; + setState(() {}); + // buscarCPF(); + buscarCadastro(); + }else{ + showSnackBar(context, 'Selecione sua cidade', Colors.red); + } + }else{ + showSnackBar(context, 'CPF Inválido', Colors.red); + } + }else{ + showSnackBar(context, 'Senhas não são idênticas', Colors.red); + } + }else{ + showSnackBar(context, 'Repita sua senha', Colors.red); + } + }else{ + showSnackBar(context, 'Preencha sua senha', Colors.red); + } + }else{ + showSnackBar(context, 'Preencha seu CPF', Colors.red); + } + } + + buscarCadastro()async{ + final url = '${widget.api}/buscarcadastrocpf?CPF=${inputCPF.text}'; + print(url); + final response = await http.get(Uri.parse(url)); + if(response.body == 'false'){ + buscarCPF(); + }else{ + carregando = false; + setState(() {}); + showSnackBar(context, 'CPF já está cadastrado!', Colors.red); + } + } + + buscarCPF()async{ + final url = '${widget.api}/buscarcpf?CPF=${inputCPF.text.replaceAll('.','').replaceAll('-', '')}&CIDADE=${cidadeQuery.toUpperCase()}'; + print(url); + final response = await http.get(Uri.parse(url)); + if(response.body == 'false'){ + showSnackBar(context, 'CPF não encontrado entre em contato com a escola!', Colors.red); + carregando = false; + setState(() {}); + }else{ + Map map = json.decode(response.body); + print(map); + print(map['CD_ALUNO']); + inserirDB(map); + } + } + + inserirDB(Map map)async{ + final url = '${widget.api}/inserirpais'; + + final response = await http.post( + Uri.parse(url), + body:{ + 'CD_ALUNO' : map['CD_ALUNO'], + 'ALUNO': map['NO_ALUNO'], + 'CPF': inputCPF.text, + 'NOME' : map['NO_PAI'], + 'SENHA' : inputSenha.text, + 'PARENTESCO' : 'PAI', + 'DATA_CADASTRO' : DateFormat('dd/MM/yyyy HH:mm').format(DateTime.now()), + 'CONDICAO' : 'NOVO', + 'CIDADE' : cidadeQuery.toUpperCase() + } + ); + if(response.body == 'cadastrado com sucesso' || response.body == 'editado com sucesso'){ + showSnackBar(context, 'Cadastro realizado com sucesso!', Colors.green); + + inputCPF.clear(); + inputSenha.clear(); + inputRepita.clear(); + carregando = false; + cidade =null; + setState((){}); + Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaLogin())); + + }else{ + carregando = false; + setState((){}); + showSnackBar(context, 'Erro ao fazer o registro, entre em contato com a escola', Colors.red); + } + } @override Widget build(BuildContext context) { + List cidades= []; + for(int i=0;Fixos().listCidades.length>i;i++){ + cidades.add(Fixos().listCidades[i].cidade); + } + return Scaffold( appBar: AppBarCustom().appbar(context, 'CADASTRO'), body: Container( @@ -31,7 +143,16 @@ class _TelaCadastroState extends State { width: Dimensoes.width, height: Dimensoes.height, alignment: Alignment.center, - child: ListView( + child: carregando?Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextCustom(text: 'VALIDANDO DADOS ...\n AGUARDE ALGUNS SEGUNDOS !',maxLines: 2,textAlign: TextAlign.center,), + SizedBox(height: 30,), + CircularProgressIndicator(color: PaletaCores.corPrimaria,) + ], + ), + ):ListView( children: [ Container( child: Image.asset("assets/images/logoEduca.png",width:Dimensoes.width * 0.4,height: Dimensoes.height * 0.12) @@ -73,13 +194,28 @@ class _TelaCadastroState extends State { ), ), Container( - width: Dimensoes.width>900? Dimensoes.width * 0.18:Dimensoes.width*0.7, - child: InputText( - inputFormatters: [], - controller: inputCodigo, - title: 'Código Cidade', - width: Dimensoes.width>900? Dimensoes.width * 0.18:Dimensoes.width*0.7, - colorBorder: PaletaCores.branco, + width: Dimensoes.width*0.6, + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: TextCustom(text: 'Cidade'), + value: cidade, + items: Fixos().listCidades.map((value) => DropdownMenuItem( + value: value.cidade, + child: TextCustom( + text: value.cidade, + color: Colors.black54, + ), + ) + ).toList(), + onChanged: (value){ + setState(() { + cidade = value!; + print(cidades.indexOf(cidade!)); + cidadeQuery = Fixos().listCidades[cidades.indexOf(cidade!)].cidadeQuery; + print(cidadeQuery); + }); + }, + ), ), ), SizedBox(height: 20,), @@ -91,7 +227,7 @@ class _TelaCadastroState extends State { colorText: PaletaCores.branco, colorButton: PaletaCores.corPrimaria, colorBorder: PaletaCores.corPrimaria, - onPressed: (){}, + onPressed: ()=>verificacao(), ), ], ), diff --git a/lib/telas/tela_login.dart b/lib/telas/tela_login.dart index 46976ba..b6bdd0d 100644 --- a/lib/telas/tela_login.dart +++ b/lib/telas/tela_login.dart @@ -319,7 +319,7 @@ class _TelaLoginState extends State { onPressed: ()=>alterarSenha?salvarSenha():verificacao(), ), carregando?Container():GestureDetector( - onTap: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaCadastro())), + onTap: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaCadastro(api: urlAPI,))), child: Container( alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 15), diff --git a/lib/telas/tela_passe.dart b/lib/telas/tela_passe.dart index 9df7dc9..06a38fb 100644 --- a/lib/telas/tela_passe.dart +++ b/lib/telas/tela_passe.dart @@ -37,28 +37,34 @@ class _TelaPasseState extends State { 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 { 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 { 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 { 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, diff --git a/lib/utils/fixos.dart b/lib/utils/fixos.dart index a2746db..efec633 100644 --- a/lib/utils/fixos.dart +++ b/lib/utils/fixos.dart @@ -1,5 +1,13 @@ +import '../modelos/cidade_model.dart'; + class Fixos{ static const String LINK_API_LOCAL = 'http://192.168.18.2:8000'; static const String LINK_API_CONTAINER = 'http://192.168.0.42:8013'; static const String LINK_API_HOMOL = 'https://homol-controle-educa-api.rkmsistemas.com.br'; + + List listCidades =[ + CidadeModel(cidade: 'Águas de Lindóia', cidadeQuery: 'aguasdelindoia'), + CidadeModel(cidade: 'Corumbataí', cidadeQuery: 'corumbatai'), + CidadeModel(cidade: 'Iracemápolis',cidadeQuery: 'iracemapolis'), + ]; } \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 1dd8ecb..4dd7ec0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -165,6 +165,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.6" + get: + dependency: "direct main" + description: + name: get + sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" + url: "https://pub.dev" + source: hosted + version: "4.6.5" http: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 8c1109f..6d7acd8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,6 +19,7 @@ dependencies: syncfusion_flutter_charts: ^21.2.9 brasil_fields: shared_preferences: ^2.1.2 + get: flutter_localizations: sdk: flutter