How can I get a user's city location in flutter - flutter

I'm tying to get a user's location( just the user's city location) I am await of the plugin geolocation in flutter and I want to know if there's a way I can get just the user's city location.

You need to geocode the coordinates given by your plugin
To do that, there is another plugin like geolocator which provides both features :
Get the current location of the device
Translate an address to geocoordinates and vice verse
The geocoding part can be find here

Related

how to use offline location in flutter?

I want to add the location of my office in my flutter app when the user downloads my app can show my office location saved at app without using the internet (offline location).
It is possible to do this in flutter? If yes, how can I integrate my office location in my app?
You can statically add location - latitude and longitude and other required parameter.
LatLng? _currentPosition;
_currentPosition = LatLng(
37.0902 //yourLocatiionLatitude,
95.7129 //yourLocatiionLongitude
)
Use this _currentPosition variable in your location default position

get latitude and longitude of my location when internet is disable in flutter

How can I get current location updates when the internet is disabled on mobile in flutter? I have used the geolocator package to get latitude and longitude of the current location.
Geolocator does not need internet enabled on mobile.
You can track position changes listening this stream Geolocator().getPositionStream()
https://pub.dev/documentation/geolocator/latest/geolocator/Geolocator/getPositionStream.html

How to get the location coordinate based on nickname

I am using the uber sdk for iOS. And i see I have to specify the
button.setProductID("abc123-productID")
button.setPickupLocation(latitude: "37.770", longitude: "-122.466", nickname: "California Academy of Sciences")
button.setDropoffLocation(latitude: "37.791", longitude: "-122.405", nickname: "Pier 39")
How can I get the coordinate information based on the location's nickname.
The iOS Uber SDK doesn't provide this functionality. However, Apple's CoreLocation framework has the CLGeocoder class that provides both forward-geocoding and reverse-geocoding. To convert an address into coordinates to pass to the request button, you can use the function geocodeAddressString:completionHandler:.

API for Get venues for nearrby Location in foursquare

1)I want to fetch the venues for the nearby location by passing the latitude and longitude of to the API in foursquare.
I got this url:-thisand i got peroper response.
But for this latitude and longitude:- 32.3456,141.4346
(url)
I did not get any data.
Same for Facebook.I use this :- facebook API
But i want the list of generalized category listing from this API.And this API only gives me data of hotels only.Because i pass q=hotel.
2)How to get oauth_token for foursquare?
Please help me.
The reason you did not get any data for that location is because there are no venues in that area. If you follow this link you will see that location is in a remote area of Australia.
For help with connecting users to Foursquare, you can use these instructions

get city name by parsing in iphone sdk

From this url:
http://ws.geonames.org/findNearbyPostalCodes?lat=19.0176560&lng=72.8561780
I want is city name that is mumbai can somebody help me?
Once you have parsed out the latitude and longitude, you can use the MKReverseGeocoder to translate that location to meta data about that location. In that meta data, you will find the city name that you are after.
Update
Have a look at the Apple CurrentAddress sample app, this has an example of how you use the MKReverseGeocoder.