Assistant
AssistantChatSheet.dart (+252), Helpers/assistantSuggestions.dart,
Services/assistantService.dart — même comportement et mêmes suggestions que
visitapp-web, dérivées du contenu réel.
Parcours guidés
guided_path_content_progression_page (+72), guided_path_map_progression_page (+39),
parcours_page : alignés sur les 3 questions de progression qui remplacent les
9 booléens côté manager-app.
Carte
Helpers/mapCenter.dart + les trois vues (flutter_map, google_map, map_box) et
marker_view : centrage et icônes honorés.
Fix du build
guided_step_challenge.dart:83 — typage explicite. Avec le // @dart=2.18 de
manager_api_new côté manager-app, c'est ce qui débloque flutter build apk.
flutter build apk ✅.
Reste ouvert : M3 — meterZoneGPS toujours ignoré, une constante en dur à 100 m
remplace le rayon configuré par section.
38 lines
1.3 KiB
Dart
38 lines
1.3 KiB
Dart
import 'package:manager_api_new/api.dart';
|
|
|
|
/// Centre d'affichage d'une SectionMap.
|
|
///
|
|
/// Priorité : le point « Centrer sur » configuré dans manager-app
|
|
/// (`centerLatitude`/`centerLongitude`, `map_config.dart`) — puis, à défaut, le
|
|
/// point GPS de la section (`latitude`/`longitude`, qui sert au beacon et à la
|
|
/// zone de déclenchement, pas au cadrage) — puis un centre par défaut.
|
|
///
|
|
/// Miroir de `MapSection.tsx` côté visitapp-web.
|
|
class MapCenter {
|
|
static const double defaultLatitude = 50.465503;
|
|
static const double defaultLongitude = 4.865105;
|
|
|
|
final double latitude;
|
|
final double longitude;
|
|
|
|
const MapCenter(this.latitude, this.longitude);
|
|
|
|
static MapCenter of(MapDTO? map) {
|
|
final center = _parse(map?.centerLatitude, map?.centerLongitude);
|
|
if (center != null) return center;
|
|
|
|
final sectionPoint = _parse(map?.latitude, map?.longitude);
|
|
if (sectionPoint != null) return sectionPoint;
|
|
|
|
return const MapCenter(defaultLatitude, defaultLongitude);
|
|
}
|
|
|
|
static MapCenter? _parse(String? latitude, String? longitude) {
|
|
if (latitude == null || longitude == null) return null;
|
|
final lat = double.tryParse(latitude);
|
|
final lng = double.tryParse(longitude);
|
|
if (lat == null || lng == null) return null;
|
|
return MapCenter(lat, lng);
|
|
}
|
|
}
|