2024-01-15 15:26:13 +00:00
|
|
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
|
|
|
|
import 'package:openapi/api.dart';
|
|
|
|
|
|
|
|
|
|
class MapMarker {
|
|
|
|
|
final LatLng latLng;
|
|
|
|
|
final String assetRemoteId;
|
2025-07-29 00:34:03 +05:30
|
|
|
const MapMarker({required this.latLng, required this.assetRemoteId});
|
2024-01-15 15:26:13 +00:00
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
MapMarker copyWith({LatLng? latLng, String? assetRemoteId}) {
|
|
|
|
|
return MapMarker(latLng: latLng ?? this.latLng, assetRemoteId: assetRemoteId ?? this.assetRemoteId);
|
2024-01-15 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
MapMarker.fromDto(MapMarkerResponseDto dto) : latLng = LatLng(dto.lat, dto.lon), assetRemoteId = dto.id;
|
2024-01-15 15:26:13 +00:00
|
|
|
|
|
|
|
|
@override
|
2025-07-25 08:07:22 +05:30
|
|
|
String toString() => 'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
|
2024-01-15 15:26:13 +00:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(covariant MapMarker other) {
|
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
|
|
|
|
|
return other.latLng == latLng && other.assetRemoteId == assetRemoteId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => latLng.hashCode ^ assetRemoteId.hashCode;
|
|
|
|
|
}
|