This package provides access to the WeatherApi api requests.
Register on the WeatherApi.com Obtain the API key from dashboard
WeatherTile(
apiClient: WeatherApiClient(apiKey: 'your_api_key'),
query: 'London',
date: DateTime.now(),
unit: TemperatureUnits.celsius,
);
WeatherTile.lanLng(
apiClient: WeatherApiClient(apiKey: 'your_api_key'),
lat: 50.43,
lng: 30.52,
date: DateTime.now(),
unit: TemperatureUnits.celsius,
);
You can use Dio interceptors to implement caching to reduce api calls. Like https://pub.dev/packages/dio_cache_interceptor
WeatherTile(
apiClient: WeatherApiClient(
apiKey: 'your_api_key',
httpClient: WeatherHttpClient(
apiKey: 'd8264ed2c7d24da5ab194736231208',
interceptors: [DioCacheInterceptor(options: options)],
),
),
query: 'London',
date: DateTime.now(),
unit: TemperatureUnits.celsius,
);
For more features - run example app included in this repo.