open_weather_map_client 0.0.6
open_weather_map_client: ^0.0.6 copied to clipboard
Package that communicates with Open Weather Map to obtain climate data in a model.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:open_weather_map_client/open_weather_map_client.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final Weather weather = OpenWeatherMap.byCity(
apiKey: '856822fd8e22db5e1ba48c0e7d69844a',
).currentWeather;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(),
body: Container(
child: Center(
child: Text(
'${weather.temperature}',
),
),
),
),
);
}
}