Browse Source

优化天气预报

weicu
liwei1dao 1 year ago
parent
commit
43bbfb416e
  1. 86
      lib/modules/agent/views/message_bubble.dart

86
lib/modules/agent/views/message_bubble.dart

@ -217,7 +217,7 @@ class MessageBubble extends GetView<AgentController> {
final rawList = mate!['card_weather']['dayweather'] as List;
final daylist =
rawList.map((e) => Map<String, dynamic>.from(e)).toList();
final now = daylist[0];
final now = mate!['card_weather']['day'] as Map<String, dynamic>;
//天气
return _buildWeatherContent(
context,
@ -677,7 +677,7 @@ class MessageBubble extends GetView<AgentController> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'当前天气情况:',
'查询天气情况:',
style: TextStyle(
color: Colors.black87,
fontSize: 14,
@ -714,7 +714,7 @@ class MessageBubble extends GetView<AgentController> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
city,
"${city} ${now["date"]}",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -846,46 +846,46 @@ class MessageBubble extends GetView<AgentController> {
],
),
),
const SizedBox(height: 10),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: OutlinedButton.icon(
onPressed: () {},
icon: Icon(Icons.location_on, size: 16),
label: Text('更多地区'),
style: OutlinedButton.styleFrom(
foregroundColor: Theme.of(context).primaryColor,
side: BorderSide(
color: Theme.of(context).primaryColor.withOpacity(0.5)),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
textStyle: TextStyle(fontSize: 12),
),
),
),
SizedBox(width: 8),
Expanded(
child: OutlinedButton.icon(
onPressed: () {},
icon: Icon(Icons.calendar_today, size: 16),
label: Text('15天预报'),
style: OutlinedButton.styleFrom(
foregroundColor: Colors.grey[700],
side: BorderSide(color: Colors.grey[400]!),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
textStyle: TextStyle(fontSize: 12),
),
),
),
],
),
// const SizedBox(height: 10),
// Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// Expanded(
// child: OutlinedButton.icon(
// onPressed: () {},
// icon: Icon(Icons.location_on, size: 16),
// label: Text('更多地区'),
// style: OutlinedButton.styleFrom(
// foregroundColor: Theme.of(context).primaryColor,
// side: BorderSide(
// color: Theme.of(context).primaryColor.withOpacity(0.5)),
// padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(16),
// ),
// textStyle: TextStyle(fontSize: 12),
// ),
// ),
// ),
// SizedBox(width: 8),
// Expanded(
// child: OutlinedButton.icon(
// onPressed: () {},
// icon: Icon(Icons.calendar_today, size: 16),
// label: Text('15天预报'),
// style: OutlinedButton.styleFrom(
// foregroundColor: Colors.grey[700],
// side: BorderSide(color: Colors.grey[400]!),
// padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(16),
// ),
// textStyle: TextStyle(fontSize: 12),
// ),
// ),
// ),
// ],
// ),
],
);
}

Loading…
Cancel
Save