ajustes da pesquisa e conexão com a api
This commit is contained in:
@@ -20,8 +20,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
//MMATOS LOGIN IGUAL A SENHA
|
||||
//AMENEZES LOGIN DIFERENTE DA SENHA
|
||||
//SENHAS CRIPTOGRAFADAS PORQUE FORMA ALTERADAS, SENHAS NOVAS USUÁRIO E SENHA SÃO IGUAIS
|
||||
final inputLogin = TextEditingController(text: 'mmatos');
|
||||
final inputSenha = TextEditingController(text: 'mmatos');
|
||||
// final inputLogin = TextEditingController(text: 'mmatos');
|
||||
final inputLogin = TextEditingController(text: 'admin');
|
||||
final inputSenha = TextEditingController(text: 'rkm12345');
|
||||
// final inputSenha = TextEditingController(text: 'mmatos');
|
||||
bool loading = false;
|
||||
|
||||
verificacao(){
|
||||
@@ -41,10 +43,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
|
||||
conectAPI()async{
|
||||
final url = 'http://localhost:8000/login?NO_USERNAME=${inputLogin.text.toUpperCase()}';
|
||||
print(url);
|
||||
// print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
print(map);
|
||||
// print(map);
|
||||
if(map==false){
|
||||
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta', Colors.red);
|
||||
}else{
|
||||
@@ -59,7 +61,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta', Colors.red);
|
||||
}
|
||||
}else{
|
||||
print(MainControllers().encrypt(inputSenha.text,map['SENHA']));
|
||||
// print(MainControllers().encrypt(inputSenha.text,map['SENHA']));
|
||||
if(MainControllers().encrypt(inputSenha.text,map['SENHA']) == map['SENHA']){
|
||||
showSnackBar(context, 'Acesso validado', Colors.green);
|
||||
Navigator.push(
|
||||
@@ -77,6 +79,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
paisBanco()async{
|
||||
final url = 'http://localhost:8000/pais';
|
||||
// print(url);
|
||||
final response = await http.get(Uri.parse(url));
|
||||
var map = json.decode(response.body);
|
||||
print(map);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
paisBanco();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
|
||||
Reference in New Issue
Block a user