How vprezende/ilpf works
Project type and purpose
• This is a cross-platform mobile/desktop application built with Flutter (Dart).
File structure
• Top-level platform folders: android/, ios/, windows/. These contain the native shell and embedding code.
• lib/: holds the Flutter application code.
• lib/main.dart: application entry point.
• lib/controllers/area_controller.dart: core domain logic for area drawing and data fetch.
• lib/widgets/: UI components (snackbars, buttons, map canvas).
• pubspec.yaml: declares dependencies (dart_jts, geodesy, http, Flutter SDK).
• test/: widget_test.dart for basic unit/widget tests.
• android/, ios/, windows/: native project wrappers generated by Flutter.
README for additional insights
• Technologies: Flutter (UI), Dart (language), dart_jts (geometry), geodesy (centroid), http (API client), SoilGrids API.
Components
a. Main components
• Presentation layer (Flutter UI widgets)
• Controller layer (AreaController)
• Geometry library modules (dart_jts, geodesy)
• HTTP Client module (http package)
• External service (ISRIC SoilGrids API)
• Native platform shells (Android, iOS, Windows embedding)
b. Relationships and interactions
• User taps/gestures in UI → UI Widgets forward events to AreaController.
• AreaController uses dart_jts/geodesy for sort/close/centroid computations.
• AreaController uses HTTP Client to send requests to SoilGrids API.
• API responses flow back to AreaController → UI updates (snackbars, map overlays).
• Native shells host the Flutter engine and render the UI.
c. Architectural patterns and design principles
• Separation of concerns: UI vs. domain/controller vs. external services.
• In-memory state management (AreaController holds currentArea, areas, originalArea).
• Retry logic for HTTP (handling 429 status).
d. Key technologies/frameworks
• Flutter framework (single codebase for all platforms).
• dart_jts & geodesy for computational geometry.
• http package for REST calls.
• Platform embedding code (Kotlin for Android, Swift for iOS, C++/CMake for Windows).
Elements
• Clear labels: “UI Widgets”, “AreaController”, “Geometry Library”, “HTTP Client”, “ISRIC SoilGrids API”, “Android Shell”, etc.
• Blue rectangles: internal app components (UI, controller).
• Orange rectangles: libraries/modules.
• Annotations for stateful lists (areas, currentArea) and retry logic for HTTP.
Guidelines:
• Native shells at the bottom or top to show hosting.
• Geometry operations into one “Geometry Module” with sub-labels for dart_jts and geodesy.
• HTTP client as part of a “Data Service” component.