From fa563f58ae70357f07ce09fd33a108a34f366bda Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Tue, 8 Apr 2025 09:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE=E5=8D=A1?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/modules/chat/views/chat_navigation_card.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/chat/views/chat_navigation_card.dart b/lib/modules/chat/views/chat_navigation_card.dart index 9ea658771..cb04f6c22 100644 --- a/lib/modules/chat/views/chat_navigation_card.dart +++ b/lib/modules/chat/views/chat_navigation_card.dart @@ -20,10 +20,12 @@ class _ChatNavigationCardState extends State { LatLng startPoint = LatLng(116.397428, 39.90923); // 起点坐标 LatLng endPoint = LatLng(116.397026, 39.903303); // 终点坐标 + late Future _mapUrl; + @override void initState() { super.initState(); - _getMapUrl(); + _mapUrl = _getMapUrl(); } Future _getMapUrl() async { @@ -158,7 +160,7 @@ class _ChatNavigationCardState extends State { return Column( children: [ FutureBuilder( - future: _getMapUrl(), + future: _mapUrl, builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData) { return Image.network(snapshot.data);