import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:weather_icons/weather_icons.dart'; import 'package:wetter/models/daily_weather_model.dart'; class CompactWeatherData extends StatefulWidget { final DailyWeatherModel dwm; const CompactWeatherData(this.dwm, {Key? key}) : super(key: key); @override State createState() => _CompactWeatherDataState(); } class _CompactWeatherDataState extends State { @override Widget build(BuildContext context) { return Card( child: Padding( padding: const EdgeInsets.all(20), child: Column( children: [ Text( "${DateFormat('EEEE').format(DateTime.now().toLocal())}, ${DateTime.now().toLocal().day}.${DateTime.now().toLocal().month}.", style: Theme.of(context).textTheme.headline4, ), const SizedBox(height: 20), Row(mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon(WeatherIcons.thermometer), Text( "${widget.dwm.dailyMaxTemp()} °C", style: Theme.of(context).textTheme.bodyLarge, ) ]), const SizedBox(height: 20), Row(mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon(WeatherIcons.thermometer_exterior), Text( "${widget.dwm.dailyMinTemp()} °C", style: Theme.of(context).textTheme.bodyLarge, ) ]), ], ))); } }