feat: (broken) implement route map and address autocomplete widgets with associated infrastructure testing scripts
This commit is contained in:
@@ -17,7 +17,15 @@ class RouteMapWidget extends StatelessWidget {
|
||||
});
|
||||
|
||||
List<LatLng> _decode(String encoded) {
|
||||
return safeDecodePolyline(encoded);
|
||||
final pts = safeDecodePolyline(encoded);
|
||||
// DEBUG: afficher dans la console du navigateur
|
||||
// ignore: avoid_print
|
||||
print('[MAP DEBUG] encoded length=${encoded.length}, decoded ${pts.length} points');
|
||||
if (pts.isNotEmpty) {
|
||||
// ignore: avoid_print
|
||||
print('[MAP DEBUG] first=${pts.first.latitude},${pts.first.longitude} last=${pts.last.latitude},${pts.last.longitude}');
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
LatLngBounds? _computeBounds(List<List<LatLng>> allPoints) {
|
||||
|
||||
@@ -92,15 +92,9 @@ class _AddressAutocompleteFieldState extends State<AddressAutocompleteField> {
|
||||
separatorBuilder: (_, __) =>
|
||||
const Divider(height: 1, indent: 16),
|
||||
itemBuilder: (ctx, i) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.location_on_outlined, size: 18),
|
||||
title: Text(
|
||||
_suggestions[i],
|
||||
style: const TextStyle(fontSize: 13),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPanDown: (_) {
|
||||
widget.controller.text = _suggestions[i];
|
||||
widget.controller.selection = TextSelection.fromPosition(
|
||||
TextPosition(offset: _suggestions[i].length),
|
||||
@@ -109,6 +103,15 @@ class _AddressAutocompleteFieldState extends State<AddressAutocompleteField> {
|
||||
_removeOverlay();
|
||||
_focusNode.unfocus();
|
||||
},
|
||||
child: ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.location_on_outlined, size: 18),
|
||||
title: Text(
|
||||
_suggestions[i],
|
||||
style: const TextStyle(fontSize: 13),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user