mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
feat(mobile): custom date range for map (#26205)
* feat(mobile): custom date range for map * refactor: rename timerange & remove isvalid * refactor: rename customtimerange variables * refactor: add back setRelativeTime * refactor: implement suggestions * refactor: suggestions * fix: ifPresent * fix: context.locale * chore: restrict selection * refactor: move options to mapconfig * refactor: move model to domain * chore: locale toLanguageTag * add map codec tests * rebase --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
20ae07e228
commit
792d88961a
13 changed files with 349 additions and 15 deletions
|
|
@ -32,6 +32,17 @@ sealed class Option<T> {
|
|||
None() => onNone(),
|
||||
};
|
||||
|
||||
Option<U> flatMap<U>(Option<U> Function(T value) f) => switch (this) {
|
||||
Some(:final value) => f(value),
|
||||
None() => const Option.none(),
|
||||
};
|
||||
|
||||
void ifPresent(void Function(T value) f) {
|
||||
if (this case Some(:final value)) {
|
||||
f(value);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => switch (this) {
|
||||
Some(:final value) => 'Some($value)',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue