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

Loading…
Cancel
Save