feat: enhance global search and map experience
All checks were successful
Deploy TravelMate (Full Mobile) / deploy-android (push) Successful in 2m10s
Deploy TravelMate (Full Mobile) / deploy-ios (push) Successful in 4m19s

- Global Activity Search:
  - Allow searching activities globally (not just in destination).
  - Add distance warning for activities > 50km away.
- Create Trip UI:
  - Fix destination suggestion list overflow.
  - Prevent suggestion list from reappearing after selection.
- Map:
  - Add generic text search support (e.g., "Restaurants") on 'Enter'.
  - Display multiple results for generic searches.
  - Resize markers (User 60.0, Places 50.0).
  - Standardize place markers to red pin.
This commit is contained in:
Van Leemput Dayron
2026-01-13 16:59:04 +01:00
parent 4fc7abc5b4
commit c0e53cd3f6
63 changed files with 273 additions and 6764 deletions

View File

@@ -135,7 +135,11 @@ class _CreateTripContentState extends State<CreateTripContent> {
}
}
bool _isProgrammaticUpdate = false;
void _onLocationChanged() {
if (_isProgrammaticUpdate) return;
final query = _locationController.text.trim();
if (query.length < 2) {
@@ -215,15 +219,18 @@ class _CreateTripContentState extends State<CreateTripContent> {
if (_placeSuggestions.isEmpty) return;
final overlay = Overlay.of(context);
// Calculer la largeur correcte en fonction du padding parent (16 margin + 24 padding = 40 de chaque côté)
final width = MediaQuery.of(context).size.width - 80;
_suggestionsOverlay = OverlayEntry(
builder: (context) => Positioned(
width:
MediaQuery.of(context).size.width -
32, // Largeur du champ avec padding
width: width,
child: CompositedTransformFollower(
link: _layerLink,
showWhenUnlinked: false,
offset: const Offset(0, 60), // Position sous le champ
targetAnchor: Alignment.bottomLeft,
child: Material(
elevation: 4,
borderRadius: BorderRadius.circular(8),
@@ -236,6 +243,7 @@ class _CreateTripContentState extends State<CreateTripContent> {
),
child: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
itemCount: _placeSuggestions.length,
itemBuilder: (context, index) {
final suggestion = _placeSuggestions[index];
@@ -256,7 +264,7 @@ class _CreateTripContentState extends State<CreateTripContent> {
),
);
Overlay.of(context).insert(_suggestionsOverlay!);
overlay.insert(_suggestionsOverlay!);
}
void _hideSuggestions() {
@@ -265,7 +273,10 @@ class _CreateTripContentState extends State<CreateTripContent> {
}
void _selectSuggestion(PlaceSuggestion suggestion) {
_isProgrammaticUpdate = true;
_locationController.text = suggestion.description;
_isProgrammaticUpdate = false;
_hideSuggestions();
setState(() {
_placeSuggestions = [];