kxs1119 / Detection-System

An IoT project using motion sensors and geofencing to detect deer near highways, sending real-time GPS alerts to drivers. Built with Flask (Python) and Raspberry Pi, focusing on IoT, cloud integration, and sensor data processing.
1 stars 0 forks source link

Connect Flask Backend to Flutter Application #62

Open kxs1119 opened 1 week ago

kxs1119 commented 1 week ago

Description:

Acceptance Criteria:


Steps to Implement:

  1. Set Up the Service Layer:

    • Create a service file (DeerService.dart) responsible for making HTTP requests to the Flask backend.
    • Use Flutter’s built-in http package to handle these requests.
  2. Fetching Data:

    • Retrieve deer location data from the Flask API endpoint using a GET request.
    • Parse the response and pass the data to the UI.
  3. Replace Mock Data:

    • Ensure that the current mock data in DeerListScreen.dart is replaced by the real API data fetched from Flask.
    • Ensure the list updates dynamically when the API provides new data.
  4. Error Handling:

    • Add error handling to display an appropriate message if the API call fails.
    • Handle edge cases, such as network issues or invalid responses.
  5. Testing:

    • Test the Flask API connection to confirm data is fetched successfully.
    • Ensure that hot reload remains functional during development.