# zerabyte88/phantek-gallery architecture

> Architecture diagram of the GitHub repository zerabyte88/phantek-gallery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zerabyte88/phantek-gallery
- Repository: https://github.com/zerabyte88/phantek-gallery

## Overview

Phantek Gallery is an offline Android photo and video gallery built with Flutter, with native Android support for media operations. Its user-facing capabilities span browsing and organizing media, viewing and playing it, managing favorites and trash, adjusting settings, and checking for updates. The README documents these capabilities, but the supplied source excerpts cover only part of the native activity; most Flutter call relationships and the update implementation cannot be verified here, so those connections are omitted or marked unverified.

Main entry points: [`lib/features/gallery/presentation/gallery_screen.dart`](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/gallery_screen.dart) (Gallery timeline), [`lib/features/player/presentation/video_player_screen.dart`](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/video_player_screen.dart) (Video player), [`lib/features/trash/presentation/trash_screen.dart`](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/trash/presentation/trash_screen.dart) (Trash viewer), [`lib/features/settings/presentation/settings_screen.dart`](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/settings/presentation/settings_screen.dart) (Settings screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Media browsing"]
  node_gallery["Gallery timeline"]
  node_album["Album detail"]
  node_filter["Filter and sort"]
  node_media["Media index"]
  node_scanner["Media scanner"]
  node_models["Media models<br/>[media_item.dart]"]
end

subgraph group_view["Media viewing"]
  node_image["Image viewer"]
  node_video["Video player"]
  node_info["Media details"]
  node_thumbnails["Thumbnail service"]
end

subgraph group_manage["Media management"]
  node_trashscreen["Trash viewer<br/>[trash_screen.dart]"]
  node_trash["Trash operations<br/>[trash_service.dart]"]
  node_trashstate["Trash state"]
end

subgraph group_app["App experience"]
  node_router["App navigation<br/>[router.dart]"]
  node_settings["Settings screen"]
  node_settingsstate["Settings state"]
  node_settingsservice[("Settings storage")]
  node_theme["Themes and language<br/>[theme.dart]"]
  node_updates["Release updater"]
  node_updatedialog["Update dialog<br/>[update_dialog.dart]"]
end

subgraph group_platform["Platform services"]
  node_native["Android bridge<br/>[MainActivity.kt]"]
  node_android["Android media APIs"]
  node_mpv["MPV playback"]
end

node_user(("Gallery user"))

node_user -.->|"opens app"| node_router
node_router -.->|"navigates to"| node_gallery
node_gallery -->|"opens albums"| node_album
node_gallery -->|"filters and sorts"| node_filter
node_gallery -.->|"browses media"| node_media
node_scanner -.->|"indexes media"| node_media
node_gallery -.->|"shows media"| node_models
node_user -->|"opens photos"| node_image
node_user -->|"plays videos"| node_video
node_image -->|"opens details"| node_info
node_video -->|"shows inspection"| node_info
node_gallery -.->|"shows thumbnails"| node_thumbnails
node_user -->|"opens trash"| node_trashscreen
node_trashscreen -->|"restores or deletes"| node_trash
node_trashscreen -.->|"updates trash"| node_trashstate
node_user -.->|"configures app"| node_settings
node_settings -.->|"edits settings"| node_settingsstate
node_settingsstate -.->|"persists settings"| node_settingsservice
node_settings -->|"chooses themes"| node_theme
node_user -->|"checks updates"| node_updatedialog
node_updatedialog -.->|"requests update"| node_updates
node_updates -.->|"dispatches install"| node_native
node_native -->|"extracts thumbnails"| node_android
node_video -->|"plays through"| node_mpv

click node_router "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/app/router.dart"
click node_gallery "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/gallery_screen.dart"
click node_album "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/album_detail_screen.dart"
click node_filter "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/widgets/filter_sort_bar.dart"
click node_media "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/media_provider.dart"
click node_scanner "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/media_scanner_service.dart"
click node_models "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/models/media_item.dart"
click node_image "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/image_viewer_screen.dart"
click node_video "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/video_player_screen.dart"
click node_info "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/widgets/media_info_sheet.dart"
click node_thumbnails "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/thumbnail_service.dart"
click node_trashscreen "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/trash/presentation/trash_screen.dart"
click node_trash "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/trash_service.dart"
click node_trashstate "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/trash_provider.dart"
click node_settings "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/settings/presentation/settings_screen.dart"
click node_settingsstate "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/settings_provider.dart"
click node_settingsservice "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/settings_service.dart"
click node_theme "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/app/theme.dart"
click node_updates "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/update/data/update_service.dart"
click node_updatedialog "https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/update/presentation/update_dialog.dart"
click node_native "https://github.com/zerabyte88/phantek-gallery/blob/master/android/app/src/main/kotlin/com/phantek/virgo/spica/MainActivity.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gallery,node_album,node_filter,node_media,node_scanner,node_models,node_user toneBlue
class node_image,node_video,node_info,node_thumbnails toneAmber
class node_trashscreen,node_trash,node_trashstate toneMint
class node_router,node_settings,node_settingsstate,node_settingsservice,node_theme,node_updates,node_updatedialog toneRose
class node_native,node_android,node_mpv toneIndigo
```

## Components

### Media browsing

- [Gallery timeline](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/gallery_screen.dart): `lib/features/gallery/presentation/gallery_screen.dart`
- [Album detail](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/album_detail_screen.dart): `lib/features/gallery/presentation/album_detail_screen.dart`
- [Filter and sort](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/gallery/presentation/widgets/filter_sort_bar.dart): `lib/features/gallery/presentation/widgets/filter_sort_bar.dart`
- [Media index](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/media_provider.dart): `lib/core/providers/media_provider.dart`
- [Media scanner](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/media_scanner_service.dart): `lib/core/services/media_scanner_service.dart`
- [Media models](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/models/media_item.dart): `lib/core/models/media_item.dart`

### Media viewing

- [Image viewer](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/image_viewer_screen.dart): `lib/features/player/presentation/image_viewer_screen.dart`
- [Video player](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/video_player_screen.dart): `lib/features/player/presentation/video_player_screen.dart`
- [Media details](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/player/presentation/widgets/media_info_sheet.dart): `lib/features/player/presentation/widgets/media_info_sheet.dart`
- [Thumbnail service](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/thumbnail_service.dart): `lib/core/services/thumbnail_service.dart`

### Media management

- [Trash viewer](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/trash/presentation/trash_screen.dart): `lib/features/trash/presentation/trash_screen.dart`
- [Trash operations](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/trash_service.dart): `lib/core/services/trash_service.dart`
- [Trash state](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/trash_provider.dart): `lib/core/providers/trash_provider.dart`

### App experience

- [App navigation](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/app/router.dart): `lib/app/router.dart`
- [Settings screen](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/settings/presentation/settings_screen.dart): `lib/features/settings/presentation/settings_screen.dart`
- [Settings state](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/providers/settings_provider.dart): `lib/core/providers/settings_provider.dart`
- [Settings storage](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/core/services/settings_service.dart): `lib/core/services/settings_service.dart`
- [Themes and language](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/app/theme.dart): `lib/app/theme.dart`
- [Release updater](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/update/data/update_service.dart): `lib/features/update/data/update_service.dart`
- [Update dialog](https://github.com/zerabyte88/phantek-gallery/blob/master/lib/features/update/presentation/update_dialog.dart): `lib/features/update/presentation/update_dialog.dart`

### Platform services

- [Android bridge](https://github.com/zerabyte88/phantek-gallery/blob/master/android/app/src/main/kotlin/com/phantek/virgo/spica/MainActivity.kt): `android/app/src/main/kotlin/com/phantek/virgo/spica/MainActivity.kt`
- **Android media APIs**
- **MPV playback**

### Other components

- **Gallery user**

## Connections

- Gallery user → App navigation: opens app
- App navigation → Gallery timeline: navigates to
- Gallery timeline → Album detail: opens albums (evidence: `README.md`)
- Gallery timeline → Filter and sort: filters and sorts (evidence: `README.md`)
- Gallery timeline → Media index: browses media
- Media scanner → Media index: indexes media
- Gallery timeline → Media models: shows media
- Gallery user → Image viewer: opens photos (evidence: `README.md`)
- Gallery user → Video player: plays videos (evidence: `README.md`)
- Image viewer → Media details: opens details (evidence: `README.md`)
- Video player → Media details: shows inspection (evidence: `README.md`)
- Gallery timeline → Thumbnail service: shows thumbnails
- Gallery user → Trash viewer: opens trash (evidence: `README.md`)
- Trash viewer → Trash operations: restores or deletes (evidence: `README.md`)
- Trash viewer → Trash state: updates trash
- Gallery user → Settings screen: configures app
- Settings screen → Settings state: edits settings
- Settings state → Settings storage: persists settings
- Settings screen → Themes and language: chooses themes (evidence: `README.md`)
- Gallery user → Update dialog: checks updates (evidence: `README.md`)
- Update dialog → Release updater: requests update
- Release updater → Android bridge: dispatches install (evidence: `README.md`)
- Android bridge → Android media APIs: extracts thumbnails (evidence: `android/app/src/main/kotlin/com/phantek/virgo/spica/MainActivity.kt`)
- Video player → MPV playback: plays through (evidence: `README.md`)
