🌦️ Weather SDK for Dart

A lightweight Dart SDK to fetch current weather data using the OpenWeatherMap API. Simple to use, ideal for Flutter and Dart apps.


✨ Features

  • 🌐 Fetch current weather by city name
  • 📦 Clean and minimal API client
  • 📊 Returns typed WeatherData object
  • 🚨 Handles API errors gracefully

🚀 Installation

Add this to your pubspec.yaml:

dependencies:
  weather_sdk: ^0.0.1

Usage

import 'package:weather_sdk/weather_sdk.dart';

void main() async {
  final client = WeatherClient(apiKey: 'YOUR_API_KEY');

  try {
    final weather = await client.getCurrentWeather('London');
    print(weather); // Example: London: 15.0°C, light rain
  } catch (e) {
    print('Failed to fetch weather: \$e');
  }
}

Sample output

London: 18.3°C, clear sky

Libraries

weather_sdk