ajustes ip para api

This commit is contained in:
Reginaldo
2023-08-04 17:43:44 -03:00
parent 615680c947
commit f352b947d5
6 changed files with 28 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ import 'package:educa_controle_acesso/widgets/text_custom.dart';
import 'package:flutter/material.dart';
import '../models/aluno_model.dart';
import '../models/login_model.dart';
import '../utils/fixos.dart';
import '../widgets/buttom_custom.dart';
import '../widgets/dados_alunos_container.dart';
import 'package:http/http.dart' as http;
@@ -41,7 +42,7 @@ class _HomeScreenState extends State<HomeScreen> {
alunos.clear();
String q = inputPesquisa.text.replaceAll(' ', '%20').toUpperCase();
// print(q);
final url = 'http://192.168.18.2:8000/aluno?NOME=$q&CIDADE=${widget.dados[0]}';
final url = 'http://${Fixos.IP_API_PORTA}/aluno?NOME=$q&CIDADE=${widget.dados[0]}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -93,7 +94,7 @@ class _HomeScreenState extends State<HomeScreen> {
setState(() {
buscandoDados = true;
});
final url = 'http://192.168.18.2:8000/acesso_maria?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
final url = 'http://${Fixos.IP_API_PORTA}/acesso_maria?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -125,7 +126,7 @@ class _HomeScreenState extends State<HomeScreen> {
setState(() {
buscandoDados = true;
});
final url = 'http://192.168.18.2:8000/acesso_base?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
final url = 'http://${Fixos.IP_API_PORTA}/acesso_base?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -146,7 +147,7 @@ class _HomeScreenState extends State<HomeScreen> {
}
inserirAcessos(int index)async{
final url = 'http://192.168.18.2:8000/inserir_acesso';
final url = 'http://${Fixos.IP_API_PORTA}/inserir_acesso';
final response = await http.post(
Uri.parse(url),
body:{