{"id":32290622,"url":"https://github.com/csongorkeller/flutter_open_weather_package","last_synced_at":"2025-10-23T02:54:14.465Z","repository":{"id":48408234,"uuid":"326653318","full_name":"csongorkeller/flutter_open_weather_package","owner":"csongorkeller","description":"Flutter package for Open Weather API integration","archived":false,"fork":false,"pushed_at":"2025-01-24T09:14:27.000Z","size":2085,"stargazers_count":12,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T02:54:03.031Z","etag":null,"topics":["flutter","flutterpackage","openweathermap","openweathermap-api"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/open_weather_client","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csongorkeller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-04T10:52:12.000Z","updated_at":"2025-10-01T21:13:28.000Z","dependencies_parsed_at":"2023-02-12T02:45:22.972Z","dependency_job_id":null,"html_url":"https://github.com/csongorkeller/flutter_open_weather_package","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/csongorkeller/flutter_open_weather_package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csongorkeller%2Fflutter_open_weather_package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csongorkeller%2Fflutter_open_weather_package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csongorkeller%2Fflutter_open_weather_package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csongorkeller%2Fflutter_open_weather_package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csongorkeller","download_url":"https://codeload.github.com/csongorkeller/flutter_open_weather_package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csongorkeller%2Fflutter_open_weather_package/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280551637,"owners_count":26349597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","flutterpackage","openweathermap","openweathermap-api"],"created_at":"2025-10-23T02:54:13.533Z","updated_at":"2025-10-23T02:54:14.458Z","avatar_url":"https://github.com/csongorkeller.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open_weather_client\n\nUnofficial Dart package in order to make use of [OpenWeatherMAP API](https://openweathermap.org/) easily.\nThe plugin can currently be used to fetch weather data by city name or geolocation(latitude, longitude) and by ZIP Code (zipCode and countryCode).\nThe plugin also supports 5 days weather forecast by city name, geolocation and by ZIP code\n\nThe plugin also supports multiple unit types:  \nTo receive all data in Fahrenheit, use `WeatherUnits.STANDARD`\\\nFor Celsius, use `WeatherUnits.METRIC`\\\nFor Kelvin use `WeatherUnits.IMPERIAL`\n\nThe plugin also supports different languages:  \nTo receive all data in GERMAN, use  `Languages.GERMAN`\n\nThe default language is `Languages.ENGLISH`\n\n## Demo\n\n![Example at work](demo.gif)\n\n## Install package\n\nTo install the dependency, add `open_weather_client` to your `pubspec.yaml`.\n\n## Usage\n\n### Prebuilt functions for current weather\n\nBefore you can use the plugin, you need an API key from [OpenWeatherMAP](https://openweathermap.org/). The plugin only uses those endpoints that can be acquired for free.\n\nOnce you have the API key, do the following:\n\n```dart\nimport 'package:open_weather_client/open_weather.dart';\n\n...\n\nOpenWeather openWeather =  OpenWeather(apiKey: 'YOUR_API_KEY');\n```\n\nThe current weather is fetched through the city name or geolocation.\n\n```dart\n  final String _key = 'YOUR_API_KEY';\n  final String _cityName = 'Florida';\n  final double _latitude = 52.3545828;\n  final double _longitude = 4.7638781;\n  final int _zipCode = 3512;\n  final String _countryCode = 'NL';\n  final Languages _language = Languages.ENGLISH;\n```\n\nFor fetching through city name, you can do the following:\n\n```dart\n  WeatherData weatherData = await openWeather\n        .currentWeatherByCityName(\n            cityName: _cityName, weatherUnits: WeatherUnits.METRIC)\n        .catchError((err) =\u003e print(err));\n```\n\nFor fetching through geolocation, you can do the following:\n\n```dart\n  WeatherData weatherData = await openWeather\n        .currentWeatherByLocation(\n            latitude: _latitude,\n            longitude: _longitude,\n            weatherUnits: WeatherUnits.METRIC)\n        .catchError((err) =\u003e print(err));\n```\n\nFor fetching through ZIP Code, you can do the following:\n\n```dart\n  WeatherData weatherData = await openWeather\n        .currentWeatherByZipCode(\n            zipCode: _zipCode,\n            countryCode: _countryCode,\n            weatherUnits: WeatherUnits.METRIC)\n        .catchError((err) =\u003e print(err));\n```\n#### Accessing values\n\nIn order to access the fetched weather values, you can go through each classes holding the specific values.\\\n\nThe `Coordinates` class holds the following info:\n\n- lat (City geo location, latitude, retrieved from the API)\n- lon (City geo location, longitude, retrieved from the API)\n\nThe `Details` class holds the following info:\\\n`Important! Details class retrieves a List, so you have to loop through it to access it's values.`\n\n- id (Weather condition id coming from the API)\n- weatherShortDescription (Group of weather parameters (Rain, Snow, Extreme etc.) coming from the API)\n- weatherLongDescription (Weather condition within the group coming from the API)\n- icon (holds the icon id used by [OpenWeatherMAP API](https://openweathermap.org/weather-conditions))\n\nThe `Temperature` class holds the following info:\n\n- currentTemperature (Temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. coming from the API)\n- feelsLike (Temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. coming from the API)\n- tempMin (Minimum temperature at the moment. This is minimal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. coming from the API)\n- tempMax (Maximum temperature at the moment. This is maximal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. coming from the API)\n- pressure (Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa, coming from the API)\n- humidity (Humidity, %, coming from the API)\n\nThe `Wind` class holds the following info:\n\n- speed (Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour. coming from the API)\n- deg (Wind direction, degrees (meteorological). coming from the API)\n- gust (Wind gust. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour. coming from the API)\n\nTo access them you can do the following:\n\n```dart\nWeatherData weatherData = await openWeather\n        .currentWeatherByCityName(\n            cityName: _cityName, weatherUnits: WeatherUnits.METRIC)\n        .catchError((err) =\u003e print(err))\n        .then((data) {\n      print(data.details.first.weatherShortDescription);\n      print(data.name.toString());\n      print(data.temperature.currentTemperature);\n      print(data.wind.speed);\n    });\n```\n\n### Prebuilt widgets for current weather\n\nAlternativel you can use the built in widgets to populate your app with some nice UI showing weather insights:\n\nFor fetching through city name, you can do the following:\n\n```dart\n OpenWeatherByCity(\n                apiKey: _key,\n                cityName: _cityName,\n                weatherUnits: WeatherUnits.METRIC,\n                color: Colors.white,\n                language: Languages.ENGLISH\n              )\n```\n\nFor fetching through geolocation, you can do the following:\n\n```dart\nOpenWeatherByLocation(\n                apiKey: _key,\n                latitude: _latitude,\n                longitude: _longitude,\n                weatherUnits: WeatherUnits.METRIC,\n                color: Colors.white,\n                language: Languages.ENGLISH\n              )\n\n```\n\nFor fetching through ZIP Code, you can do the following:\n\n```dart\nOpenWeatherByZipCode(\n                apiKey: _key,\n                zipCode: _zipCode,\n                countryCode: _countryCode,\n                weatherUnits: WeatherUnits.METRIC,\n                color: Colors.white,\n                language: Languages.ENGLISH\n              )\n\n```\n\n### Prebuilt functions for 5 days weather forecast\n`Important! Forecast retrieves a List, so you have to loop through it to access it's values.`\n\nFor fetching through city name, you can do the following:\n\n```dart\n  WeatherForecastData weatherData = await openWeather\n        .fiveDaysWeatherForecastByCityName(\n            cityName: _cityName,\n            weatherUnits: WeatherUnits.METRIC,\n            language: Languages.ENGLISH)\n        .catchError((err) =\u003e print(err));\n```\n\nFor fetching through geolocation, you can do the following:\n\n```dart\n  WeatherForecastData weatherData = await openWeather\n        .fiveDaysWeatherForecastByLocation(\n            latitude: _latitude,\n            longitude: _longitude,\n            weatherUnits: WeatherUnits.METRIC,\n            language: Languages.ENGLISH)\n        .catchError((err) =\u003e print(err));\n```\n\nFor fetching through ZIP Code, you can do the following:\n\n```dart\n  WeatherForecastData weatherData = await openWeather\n        .fiveDaysWeatherForecastByZipCode(\n            zipCode: _zipCode,\n            countryCode: _countryCode,\n            weatherUnits: WeatherUnits.METRIC,\n            language: Languages.ENGLISH)\n        .catchError((err) =\u003e print(err));\n```\n\nFor more info and demo implementation check the `example` folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsongorkeller%2Fflutter_open_weather_package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsongorkeller%2Fflutter_open_weather_package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsongorkeller%2Fflutter_open_weather_package/lists"}