feat: add indoor floor levels and localized description tags to AED details#36
feat: add indoor floor levels and localized description tags to AED details#36Amadeusz-P wants to merge 2 commits into
Conversation
👷 Deploy request for aedmap pending review.Visit the deploys page to approve it
|
| .where((a) => a.key.startsWith('defibrillator:location')) | ||
| .toList(); | ||
| descriptions.sort((a, b) => b.key.length - a.key.length); | ||
| var lang = Platform.localeName.split('_')[0]; |
There was a problem hiding this comment.
Current state of implementation (single location description) is not ideal solution.
However, doing production-grade refactor I would strongly recommend to include all location descriptions in various languages inside datamodel (aed.dart).
Also I feel this change can potentially break existing functionality of mutating AED details unless correct handling would be implemented inside edit logic.
I would love to see all tags for all languages getting into toXml tags.
| builder: (context, v) { | ||
| String indoorText = v; | ||
| if (state.selected.level != null && state.selected.level!.isNotEmpty) { | ||
| indoorText += ' (${appLocalizations.level.toLowerCase()}: ${state.selected.level})'; |
There was a problem hiding this comment.
Maybe introduce another row for level? App should be extremely readable, even on larger text scales set on phone OS.
| Text('${appLocalizations.insideBuilding}: ', | ||
| style: const TextStyle(fontSize: 16)), | ||
| Text(v, | ||
| Text(indoorText, |
| }), | ||
| if (state.selected.description != null && state.selected.description!.isNotEmpty) ...[ | ||
| const SizedBox(height: 4), | ||
| _ExpandableNote( |
There was a problem hiding this comment.
- This component should be extracted to separate file.
- App codebase convention is to not nose
_prefix for private components.
|
|
||
| List<String> details = []; | ||
| if (locationDescription.isNotEmpty) details.add(locationDescription); | ||
| if (indoor != null && indoor == 'yes') details.add(appLocalizations.insideBuilding); |
| } | ||
|
|
||
| Future<Defibrillator?> getNode(int id) async { | ||
| Future<Defibrillator?> getNode(int id, String lang) async { |
There was a problem hiding this comment.
This method can be probably completely removed.
3155726 to
1788955
Compare
1788955 to
d3bd5d3
Compare
This Pull Request introduces support for indoor tagging properties (level and extended descriptions) parsed from OpenStreetMap data. These details are now properly surfaced across the application's data models, map markers, and user interface panels, making it significantly easier for users to locate AEDs hidden inside complex buildings, shopping malls, or multi-story public structures.
Key Changes & Features
Data Model Upgrades (AED Model)
Floor Level Support: Added an optional level property (String/int parsing) to map the standard OpenStreetMap level=* tag. This captures whether a device is on the ground floor (0), upstairs (1, 2), or in a basement (-1).
Detailed Descriptions: Integrated description strings (description / description:pl / description:en fallback mapping) to store granular placement notes provided by mapping communities (e.g., "Next to the main reception desk" or "Inside the security guard booth").
Data Sync & API Adjustments
Updated the parsing logic responsible for converting raw OSM JSON/Overpass elements into the internal application state.
Ensured null safety and fallback mechanisms so that older or incomplete external map entries without indoor data do not trigger rendering crashes.
UI Enhancements (Details Panel & Cards)
Level Badge/Label: Added a dedicated visual indicator in the AED detail bottom sheet displaying the floor number when available.
Location Description Section: Created a text block that surfaces the exact description tag below the main title, ensuring that crucial visual identifiers are legible during emergencies.
Type of Change
Testing & Quality Assurance