|
|
|
@ -138,7 +138,7 @@ class _AddressMapPage extends State<AddressMapPage> {
|
|
|
|
|
aMapFlutterLocation.prepareLoc(androidMap, iosMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Address> poiList; |
|
|
|
|
List<BMFPoiInfo> poiList; |
|
|
|
|
|
|
|
|
|
searchPoi(BMFCoordinate latLng) async { |
|
|
|
|
keyWord = textEditingController.text; |
|
|
|
@ -148,23 +148,7 @@ class _AddressMapPage extends State<AddressMapPage> {
|
|
|
|
|
callback: (BMFPoiSearchResult result, BMFSearchErrorCode errorCode) { |
|
|
|
|
// if ((DateTime.now().millisecondsSinceEpoch - time) > 2000) { |
|
|
|
|
result.poiInfoList.map((e) => print("sssssssssss:${e.toMap()}")); |
|
|
|
|
poiList = result.poiInfoList |
|
|
|
|
.map((e) => Address.fromJson({ |
|
|
|
|
"address": e.address, |
|
|
|
|
"area": e.name, |
|
|
|
|
"city": e.city, |
|
|
|
|
"province": e.province, |
|
|
|
|
"latitude": e.pt.latitude, |
|
|
|
|
"longitude": e.pt.longitude, |
|
|
|
|
"cityInfo": e.name, |
|
|
|
|
"id": "", |
|
|
|
|
"mid": "", |
|
|
|
|
"phone": "", |
|
|
|
|
"tag": "", |
|
|
|
|
"username": "", |
|
|
|
|
"isDefault": true, |
|
|
|
|
})) |
|
|
|
|
.toList(); |
|
|
|
|
poiList = result.poiInfoList; |
|
|
|
|
print("object112221: ${poiList.length}"); |
|
|
|
|
setState(() { |
|
|
|
|
time = DateTime.now().millisecondsSinceEpoch; |
|
|
|
@ -408,7 +392,7 @@ class _AddressMapPage extends State<AddressMapPage> {
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(poiList[position].toJson()); |
|
|
|
|
Navigator.of(context).pop(poiList[position].toMap()); |
|
|
|
|
}, |
|
|
|
|
child: addressItem(poiList[position]), |
|
|
|
|
); |
|
|
|
@ -429,7 +413,7 @@ class _AddressMapPage extends State<AddressMapPage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget addressItem(Address address) { |
|
|
|
|
Widget addressItem(BMFPoiInfo address) { |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), |
|
|
|
|
child: Column( |
|
|
|
@ -437,7 +421,7 @@ class _AddressMapPage extends State<AddressMapPage> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
address.cityInfo ?? "", |
|
|
|
|
address.address ?? "", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|