Browse Source

s上传地铁代码

weicu
liwei1dao 2 years ago
parent
commit
47f7838da5
  1. 7
      lib/modules/chat/views/chat_navigation_card.dart
  2. 3
      lib/modules/chat/views/chat_view.dart

7
lib/modules/chat/views/chat_navigation_card.dart

@ -8,10 +8,12 @@ import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class ChatNavigationCard extends StatefulWidget {
final String content;
final Map? data;
final bool isDarkMode;
const ChatNavigationCard(this.data, this.isDarkMode, {super.key});
const ChatNavigationCard(this.data, this.content, this.isDarkMode,
{super.key});
@override
State<ChatNavigationCard> createState() => _ChatNavigationCardState();
@ -41,7 +43,7 @@ class _ChatNavigationCardState extends State<ChatNavigationCard> {
}
void _getLocation() async {
List endPointList = widget.data?['companyName'].split(',');
List endPointList = widget.data?['destination'].split(',');
endPoint = LatLng(
double.parse(endPointList[0]),
double.parse(endPointList[1]),
@ -193,6 +195,7 @@ class _ChatNavigationCardState extends State<ChatNavigationCard> {
_mapUrl.isNotEmpty
? Image.network(_mapUrl)
: const CircularProgressIndicator(),
Text(widget.content)
],
);
}

3
lib/modules/chat/views/chat_view.dart

@ -363,7 +363,8 @@ class ChatView extends GetView<ChatController> {
box = ChatMusicCard(message.data?['card_spotify'], isDarkMode);
}
if (message.data?['card_navigation'] != null) {
box = ChatNavigationCard(message.data?['card_navigation'], isDarkMode);
box = ChatNavigationCard(
message.data?['card_navigation'], message.content, isDarkMode);
}
}
return box;

Loading…
Cancel
Save