我正在尝试在此功能中显示我的经纬度信息。但我收到一个错误。在此之前,让我向您展示我的代码:
void _getLocation() {
print("getlocation");
_getLocationData().then((value) {
print("get Location recall");
print(value); // * LocationData<lat: 22.5422476, long: 113.9476589>
print("value");
LocationData? location = value;
print(location);
_getAddress(location?.latitude, location?.longitude).then((value) {
print("in get Address");
setState(() {
currentLocation = location;
address = value;
print(address);
print(currentLocation);
});
});
});
}