Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Fix Flutter transaction anomaly detection request handling

Đang mở Phù hợp với người mới
#4,164 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, flutter
Lĩnh vực
mobile

Hướng nghiên cứu

Kiểm tra tệp pubspec.yaml của ứng dụng Flutter để đảm bảo gói http được liệt kê. Tìm tệp có câu lệnh import 'import "http" as http;' và đổi thành 'import "package:http/http.dart" as http;'. Sau đó, xác định hàm gửi yêu cầu phát hiện bất thường giao dịch và thêm xử lý lỗi cho phản hồi không phải 2xx, lỗi mạng và phân tích cú pháp JSON. Đảm bảo URL cơ sở của API có thể cấu hình, có thể thông qua biến môi trường hoặc tệp cấu hình. Kiểm tra bằng cách chạy ứng dụng và mô phỏng lỗi API.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
157
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/app

Tất cả issue của github/app

Issue tương tự

Thêm issue về Mobile Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.