closest method
Future<List<TrendLocation> >
closest({
- required String lat,
- required String long,
- TransformResponse<
List< transform = defaultTrendLocationsTransform,TrendLocation> >
Returns the locations that Twitter has trending topic information for, closest to a specified location.
lat
: If provided with a long parameter the available trend locations
will be sorted by distance, nearest to furthest, to the co-ordinate pair.
The valid ranges for longitude is -180.0 to +180.0 (West is negative, East
is positive) inclusive.
long
: If provided with a lat parameter the available trend locations
will be sorted by distance, nearest to furthest, to the co-ordinate pair.
The valid ranges for longitude is -180.0 to +180.0 (West is negative, East
is positive) inclusive.
transform
: Can be used to parse the request. By default, the response is
parsed in an isolate.
Implementation
Future<List<TrendLocation>> closest({
required String lat,
required String long,
TransformResponse<List<TrendLocation>> transform =
defaultTrendLocationsTransform,
}) {
final params = <String, String>{}
..addParameter('lat', lat)
..addParameter('long', long);
return client
.get(
Uri.https('api.twitter.com', '/1.1/trends/closest.json', params),
)
.then(transform);
}