diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/app_mode.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/app_mode.dart')
| -rw-r--r-- | lib/app_mode.dart | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/app_mode.dart b/lib/app_mode.dart new file mode 100644 index 0000000..4c4aa8a --- /dev/null +++ b/lib/app_mode.dart @@ -0,0 +1,52 @@ +enum AppMode { + initialization, + main, + pickCollectionFiltersExternal, + pickSingleMediaExternal, + pickMultipleMediaExternal, + pickFilteredMediaInternal, + pickUnfilteredMediaInternal, + pickFilterInternal, + previewMap, + screenSaver, + setWallpaper, + slideshow, + view, + edit, +} + +extension ExtraAppMode on AppMode { + bool get canNavigate => { + AppMode.main, + AppMode.pickCollectionFiltersExternal, + AppMode.pickSingleMediaExternal, + AppMode.pickMultipleMediaExternal, + }.contains(this); + + bool get canEditEntry => { + AppMode.main, + AppMode.view, + }.contains(this); + + bool get canSelectMedia => { + AppMode.main, + AppMode.pickMultipleMediaExternal, + }.contains(this); + + bool get canSelectFilter => { + AppMode.main, + AppMode.pickCollectionFiltersExternal, + }.contains(this); + + bool get canCreateFilter => { + AppMode.main, + AppMode.pickFilterInternal, + }.contains(this); + + bool get isPickingMedia => { + AppMode.pickSingleMediaExternal, + AppMode.pickMultipleMediaExternal, + AppMode.pickFilteredMediaInternal, + AppMode.pickUnfilteredMediaInternal, + }.contains(this); +} |
