我想撰寫一個自定義標記,它可以加載來自 API 的用戶的個人資料圖片,并且背景應該與自定義的剪輯形狀系結....
單擊此處查看設計
uj5u.com熱心網友回復:
看起來您正在嘗試使用 google maps 包,包中的標記采用 BitmapDescriptor,因此基本上您可以從資產加載影像。我沒有嘗試為標記圖示添加邊距,就我而言,我只是編輯了影像。
final Uint8List markerIcon = await getBytesFromAsset('assets/images/map_pin.png', 600);
BitmapDescriptor customIcon = BitmapDescriptor.fromBytes(markerIcon);
marker.add(Marker(
markerId: MarkerId(currentLocation!.latitude.toString()),
position: currentLocation!,
draggable: true,
icon: customIcon,
onDragEnd: (LatLng latlng) {
currentLocation = latlng;
}));
uj5u.com熱心網友回復:
我想你想要ClipPath https://www.youtube.com/watch?v=oAUebVIb-7s并使用一些自定義路徑。
然后,使用 Stack 小部件定位地圖和標記。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/375593.html
上一篇:什么是顫振地理編碼中的地標
