weather_pack 1.1.0 copy "weather_pack: ^1.1.0" to clipboard
weather_pack: ^1.1.0 copied to clipboard

The project is designed to obtain weather via the OpenWeatherMap API. With geocoding and units measure. :)

example/example.md

How do I get the current weather forecast? #

The easiest way is shown below. You can find a full in example folder.

import 'package:weather_pack/weather_pack.dart';

Future<void> main() async {
  const api = 'YOUR_APIKEY'; // TODO: change to your Openweathermap APIkey
  final wService = WeatherService(api);

  // get the current weather in Amsterdam
  final WeatherCurrent currently = await wService.currentWeatherByLocation(
      latitude: 52.374, longitude: 4.88969);
  
  print(currently);
}

How do I get a city by coordinates? #

Using GeocodingService you can get the city by coordinates:

void main() async {
  const api = 'YOUR_APIKEY'; // TODO: change to your Openweathermap APIkey
  final gService = GeocodingService(api);

  final List<PlaceGeocode> places = await gService.getLocationByCoordinates(
      latitude: 52.374, longitude: 4.88969);

  print(places);
}
12
likes
160
pub points
60%
popularity
screenshot

Publisher

unverified uploader

The project is designed to obtain weather via the OpenWeatherMap API. With geocoding and units measure. :)

Homepage
Repository (GitHub)
View/report issues

Topics

#weather #openweathermap #geocoding #weather-forecast #units-measure

Documentation

API reference

Funding

Consider supporting this project:

t.me

License

MIT (license)

Dependencies

http

More

Packages that depend on weather_pack