mirror of
https://github.com/immich-app/immich.git
synced 2024-12-24 10:37:28 +02:00
cb391342d7
* feat(mobile): map page - add map view * map: add map-markers * feat(map): add relative date filter * fix: do not let users scroll past map bounds * fix: fetch relative date from store to state on init * feat(mobile):re-fetch markers only on filter change * feat(mobile) - asset bottom sheet in map page * feat(mobile): display markers based on bottom sheet scroll * fix: exif-bottom-sheet - rebase conflict * feat(mobile): map-view - strongly typed map page events * feat(map): zoom to asset * chore: dart analyzer fixes * map-page move attribution to top-right * feat(mobile): map view - asset selection handling * feat(mobile): map-view display map in places row * fix: make asset marker icon responsive * optimise map page rebuilds * refactor(mobile): map page * feat(mobile): map-view: Go to location * map-view(mobile): minor refactor * fix(mobile): Handle invalid coords gracefully * small styling --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
46 lines
1.1 KiB
Dart
46 lines
1.1 KiB
Dart
class MapState {
|
|
final bool isDarkTheme;
|
|
final bool showFavoriteOnly;
|
|
final int relativeTime;
|
|
|
|
MapState({
|
|
this.isDarkTheme = false,
|
|
this.showFavoriteOnly = false,
|
|
this.relativeTime = 0,
|
|
});
|
|
|
|
MapState copyWith({
|
|
bool? isDarkTheme,
|
|
bool? showFavoriteOnly,
|
|
int? relativeTime,
|
|
}) {
|
|
return MapState(
|
|
isDarkTheme: isDarkTheme ?? this.isDarkTheme,
|
|
showFavoriteOnly: showFavoriteOnly ?? this.showFavoriteOnly,
|
|
relativeTime: relativeTime ?? this.relativeTime,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'MapSettingsState(isDarkTheme: $isDarkTheme, showFavoriteOnly: $showFavoriteOnly, relativeTime: $relativeTime)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other is MapState &&
|
|
other.isDarkTheme == isDarkTheme &&
|
|
other.showFavoriteOnly == showFavoriteOnly &&
|
|
other.relativeTime == relativeTime;
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return isDarkTheme.hashCode ^
|
|
showFavoriteOnly.hashCode ^
|
|
relativeTime.hashCode;
|
|
}
|
|
}
|