| 12345678910111213141516171819202122 |
- import 'package:flutter_map/flutter_map.dart';
- import 'package:location/data/bean/user_info.dart';
- class Location2MarkerUtil {
- Location2MarkerUtil._();
- static Marker userInfo2Marker(UserInfo e, bool isSelected) {
- return Marker(
- id: e.id,
- markerName: e.remark ?? e.phoneNumber,
- longitude: e.lastLocation.value?.longitude,
- latitude: e.lastLocation.value?.latitude,
- markerType: MarkerType.friend,
- isSelected: isSelected,
- );
- }
- static List<Marker> userInfoList2MarkerList(
- List<UserInfo> list, UserInfo? selectedFriend) {
- return list.map((e) => userInfo2Marker(e, e == selectedFriend)).toList();
- }
- }
|