ajustes na url para recuperar os dados da respectiva base
This commit is contained in:
@@ -35,10 +35,6 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
loading = true;
|
loading = true;
|
||||||
});
|
});
|
||||||
conectAPI();
|
conectAPI();
|
||||||
// Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(builder: (context) => TelaSelecionaFilho()),
|
|
||||||
// );
|
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Preencha sua senha', Colors.red);
|
showSnackBar(context, 'Preencha sua senha', Colors.red);
|
||||||
}
|
}
|
||||||
@@ -49,7 +45,7 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
|
|
||||||
conectAPI()async{
|
conectAPI()async{
|
||||||
final url = 'http://192.168.18.2:8000/loginpais?CPF=${inputLogin.text.toUpperCase()}';
|
final url = 'http://192.168.18.2:8000/loginpais?CPF=${inputLogin.text.toUpperCase()}';
|
||||||
// print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
// print(map);
|
// print(map);
|
||||||
@@ -64,8 +60,7 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
status = 'CARREGANDO ESTUDANTE(S) ...';
|
status = 'CARREGANDO ESTUDANTE(S) ...';
|
||||||
});
|
});
|
||||||
showSnackBar(context, 'Acesso validado', Colors.green);
|
showSnackBar(context, 'Acesso validado', Colors.green);
|
||||||
//print(map['PARENTESCO']);
|
buscaFilhos(map['NOME'],map['PARENTESCO'],map['CIDADE']);
|
||||||
buscaFilhos(map['NOME'],map['PARENTESCO']);
|
|
||||||
}else{
|
}else{
|
||||||
setState(() {
|
setState(() {
|
||||||
loading = false;
|
loading = false;
|
||||||
@@ -75,10 +70,10 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buscaFilhos(String nome,String parentesco)async{
|
buscaFilhos(String nome,String parentesco,String cidade)async{
|
||||||
String q = nome.replaceAll(' ', '%20').toUpperCase();
|
String q = nome.replaceAll(' ', '%20').toUpperCase();
|
||||||
final url = 'http://192.168.18.2:8000/buscafilhos?NOME=$q&PARENTESCO=${parentesco.replaceAll("Ã", 'A').replaceAll('ã', 'a')}';
|
final url = 'http://192.168.18.2:8000/buscafilhos?NOME=$q&PARENTESCO=${parentesco.replaceAll("Ã", 'A').replaceAll('ã', 'a')}&CIDADE=$cidade';
|
||||||
//print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user