mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
* fix(mobile): handle transient loading states for map timelines * fix(mobile): handle transient loading states for map timelines * Add support for new method * Rewrote map options notifier to be more Riverpody
19 lines
668 B
Dart
19 lines
668 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:immich_mobile/utils/option.dart';
|
|
|
|
part 'time_range.model.freezed.dart';
|
|
|
|
// copyWith is hand-written so that fields can be cleared via optionals
|
|
@Freezed(copyWith: false, fromJson: false, toJson: false)
|
|
abstract class TimeRange with _$TimeRange {
|
|
const TimeRange._();
|
|
|
|
const factory TimeRange({DateTime? from, DateTime? to}) = _TimeRange;
|
|
|
|
TimeRange copyWith({Option<DateTime>? from, Option<DateTime>? to}) {
|
|
return TimeRange(from: from.patch(this.from), to: to.patch(this.to));
|
|
}
|
|
|
|
TimeRange clearFrom() => TimeRange(to: to);
|
|
TimeRange clearTo() => TimeRange(from: from);
|
|
}
|