1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00
immich/mobile/lib/models/map/map_marker.model.dart
Alex f057fe045e
refactor(mobile): entities and models (#9182)
* refactor(mobile): entities

* store entity

* refactor: models

* remove domain

* save all

* bad refactor
2024-04-30 21:36:40 -05:00

39 lines
929 B
Dart

import 'package:maplibre_gl/maplibre_gl.dart';
import 'package:openapi/api.dart';
class MapMarker {
final LatLng latLng;
final String assetRemoteId;
MapMarker({
required this.latLng,
required this.assetRemoteId,
});
MapMarker copyWith({
LatLng? latLng,
String? assetRemoteId,
}) {
return MapMarker(
latLng: latLng ?? this.latLng,
assetRemoteId: assetRemoteId ?? this.assetRemoteId,
);
}
MapMarker.fromDto(MapMarkerResponseDto dto)
: latLng = LatLng(dto.lat, dto.lon),
assetRemoteId = dto.id;
@override
String toString() =>
'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
@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;
}