import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class WeatherDayCard extends StatelessWidget { final Map? data; final bool isDarkMode; const WeatherDayCard(this.data, this.isDarkMode, {super.key}); @override Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( data?['city'], style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 10.sp, ), ), Text( '${data?['temperature']}°', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 30.sp, ), ), ], ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.sunny, color: isDarkMode ? Colors.white : Colors.amber[600]!, size: 18.w, ), Text( '${data?['weatherCondition']},${data?['windDirection']}风', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 14.sp, ), ), Row( children: [ Text( '湿\n度', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 10.sp, height: 1, ), ), 5.horizontalSpace, Text( '${data?['humidity']}', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 20.sp, ), ), 10.horizontalSpace, Text( '风\n力', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 10.sp, height: 1, ), ), 5.horizontalSpace, Text( '${data?['windForce']}', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 20.sp, ), ), ], ), ], ), ], ); } }