Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Fix Flutter transaction anomaly detection request handling

Aberta Para iniciantes
#4,164 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
70/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
dart, flutter
Domínio
mobile

Direção de pesquisa

Verifique o pubspec.yaml do aplicativo Flutter para garantir que o pacote http esteja listado. Encontre o arquivo com a importação 'import "http" as http;' e altere para 'import "package:http/http.dart" as http;'. Em seguida, localize a função de solicitação de detecção de anomalias de transação e adicione tratamento de erros para respostas não 2xx, erros de rede e análise de JSON. Certifique-se de que a URL base da API seja configurável, talvez por meio de uma variável de ambiente ou arquivo de configuração. Teste executando o aplicativo e simulando falhas de API.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

triage
Short summary

Flutter transaction anomaly detection request fails to compile and cannot be reliably exercised because the HTTP client import is invalid and request failures are not handled.

Affected version or release

Not specified in the source report; the affected application is a Flutter app using a development API endpoint.

Installation context

Flutter application using the AI Shield India transaction flow; requests target the development API endpoint at 10.0.2.2:8000.

What happened?

The Flutter application imports the HTTP client as import 'http' as http;, but the code calls http.post. This import does not reference the package library and prevents the app from compiling unless corrected to import 'package:http/http.dart' as http; and the http dependency is declared in pubspec.yaml. After compilation is fixed, the transaction flow should handle non-2xx responses, network and timeout failures, and invalid JSON without crashing. The API base URL should also be configurable for emulator, device, and production environments.

Steps to reproduce
  1. Create or open the Flutter application containing the AI Shield transaction flow.
  2. Ensure the code contains the HTTP import import 'http' as http; and calls http.post.
  3. Run the application or compile the project.
  4. After correcting the import, invoke the Test High-Value Transfer action with the development API unavailable or returning an error.
  5. Observe the compilation failure or unhandled request/JSON failure.
Expected behavior

The app should compile with the HTTP package configured, send the transaction request successfully when the API is available, and show a user-friendly error when the API returns a non-2xx response, times out, cannot be reached, or returns invalid JSON. The API base URL should be configurable per environment.

Additional context

The original implementation uses http://10.0.2.2:8000/api/v1/detect-anomaly, which is emulator-specific and uses cleartext HTTP. Confirm the Android network-security configuration or migrate the endpoint to HTTPS. The request includes user ID, amount, current and previous locations, and screen-sharing state.

Linguagem predominante
Sem dados de linguagem
Estrelas
2.1k
Forks
157
Métricas de merge de PRs
Nenhum PR com merge em 30d

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/app

Todas as issues de github/app

Issues semelhantes

Mais issues de Mobile Dev

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.