weather_kit 0.0.2 weather_kit: ^0.0.2 copied to clipboard
A dart library for interfacing with the Apple WeatherKit API.
Weather Kit #
Usage #
To use this plugin, add weather_kit
as a dependency in your pubspec.yaml file.
Examples #
Here are small examples that show you how to use the API.
Generate JWT
final weatherKit = WeatherKit();
final token = weatherKit.generateJWT(
bundleId: 'com.example',
teamId: 'team id',
keyId: 'key id',
pem: 'example.p8',
expiresIn: const Duration(hours: 1),
);
Obtain current weather
final result = await weatherKit.obtainWeatherData(
jwt: token,
language: 'ja',
latitude: '35.71',
longitude: '139.811',
dataSets: 'currentWeather',
);