ZiadSafwat / weather_open_meteo_client

weather_flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weather_open_meteo_client

This package uses the OpenMeteo API to get the current weather status as well as weather forecasts.

The weather can currently be fetched by providing a geolocation or a city name.

Install (Flutter)

Add weather_open_meteo_client as a dependency in pubspec.yaml. For help on adding as a dependency, view the pubspec documenation.

Usage

By CityName:

import 'package:weather_open_meteo_client/weather_open_meteo_client.dart';

...
async{
OpenMeteoApi _weather=OpenMeteoApi();
Weather tempWether= await _weather.getWeatherByCityName('London');
print(tempWether.current_weather!.temperature);
}

By coordinate:

import 'package:weather_open_meteo_client/weather_open_meteo_client.dart';

...
async{
OpenMeteoApi _weather=OpenMeteoApi();
Weather tempWether= await _weather.getWeatherByCoordinate(latitude: 51.5072, longitude: -0.1275,current_weather: true);
print(tempWether.current_weather!.temperature);
}

Current Weather

For specific documentation on the current weather API, see the API Documentation.

About

weather_flutter

License:MIT License


Languages

Language:Dart 47.2%Language:C++ 25.0%Language:CMake 22.3%Language:HTML 2.2%Language:C 1.7%Language:Swift 1.4%Language:Kotlin 0.1%Language:Objective-C 0.0%