How entitycuber/wallhavenerandroid works
Project type & purpose (from file tree + README)
This is a Flutter mobile application (“Wallpaper App”) with:
• A Flutter/Dart UI in lib/ (pages, widgets)
• A small service layer in lib/services/ (likely networking / thumbnail retrieval)
• An Android host shell in android/ (Gradle build, MainActivity.kt, Android manifests/resources)
There is no backend service in this repo; the app most likely talks directly to an external wallpaper API/provider (commonly wallhaven, given the name), fetches images/thumbnails, and displays them.
Use the directory boundaries as the first partitioning, then refine into subcomponents:
Application / Domain services (Flutter)
• lib/services/thumbs.dart
Indicates a service responsible for retrieving/generating/handling thumbnail data.
In a typical Flutter app, this means:
• HTTP requests to an API endpoint
• mapping JSON → model objects (models aren’t explicitly present in tree; may be inside the service or omitted)
• possibly pagination/filters
Subcomponents: “Thumbs Service (API client)”, optionally “Models / DTOs” (even if inlined, represent it conceptually)
Assets
Flows: UI reads assets locally (no network).
Platform host (Android)
• android/app/src/main/kotlin/.../MainActivity.kt
Flutter Android embedding entry point.
• android/app/src/main/AndroidManifest.xml (+ debug/profile manifests)
• android/app/src/main/res/...
• Gradle build files: android/build.gradle, android/app/build.gradle, wrapper, etc.
Subcomponents: “MainActivity”, “Android OS APIs”, “Build/Packaging (Gradle)”
Even if the app is “Flutter-only”, include the Android host because it’s part of runtime packaging and (potentially) platform permissions (storage, internet, wallpaper setting).
User → Flutter UI
• User navigates Home/Drawer/Wallpaper View
Flutter UI → Thumbs Service
• UI triggers “load thumbnails”, “search”, “load next page”, “load wallpaper details”
Thumbs Service → External Wallpaper API
• HTTPS requests (REST/JSON)
External API → Thumbs Service
• JSON response (metadata, image URLs)
Thumbs Service → Flutter UI
• Parsed results used to render grids/lists
Flutter UI → Image CDN/Host (direct image fetch)
• either “UI fetches images from Image Host/CDN”
• or “Service returns URLs; Image Loader fetches binary”
Image Loader ↔ Cache/Storage (optional but recommended to include)
• Even if not explicit in code tree, real Flutter image loading often involves:
• in-memory cache
• disk cache (if using packages)
Platform integration flows (Android)
• Flutter Engine → Android OS
• Permissions (Internet, storage), wallpaper setting action (if implemented)
• “Platform Channels / Plugins”
Goal: Show what the app is and what it depends on.
Include:
• “User”
• “Wallhavener Flutter App”
• “External Wallpaper API” (and optionally “Image CDN/Host” if separate)
• (Optional) “Device Storage / Cache”
• User interacts with App
• App calls External API (HTTPS)
• App downloads images from Image Host
• App reads/writes cache locally
Containers inside the app package:
• Flutter UI Layer (lib/pages/*, lib/widgets/*)
• Service Layer (lib/services/thumbs.dart)
• Image Loading & Caching (conceptual container; annotate “Flutter ImageProvider + caching” or package-based caching if used)
• Android Host Container (android/…, MainActivity.kt, manifests/resources)
External containers:
• Wallpaper API (REST/JSON)
• Image Host/CDN (binary image content)
Inside “Flutter UI Layer”, show:
• main.dart (App bootstrap / route setup)
• home.dart (Wallpaper feed/list)
• wallview.dart (Detail/fullscreen view)
• side_drawer.dart (Filters/nav/settings UI)
Inside “Service Layer”, show:
• thumbs.dart (thumbnail retrieval, pagination/filtering, JSON parsing)
• “HomePage → ThumbsService: fetchThumbs(query, page)”
• “WallView → (Image Host): GET imageUrl”
Use the file tree as your source of truth for names
• “Home Page (lib/pages/home.dart)”
• “Wallpaper View (lib/pages/wallview.dart)”
• “Thumbs Service (lib/services/thumbs.dart)”
• “Android MainActivity (android/.../MainActivity.kt)”
This avoids hand-wavy components that aren’t evidenced in the repo.
Likely-but-not-proven elements explicitly as “conceptual”
Example: caching, models, platform channels.
Them as:
• “(Conceptual) Image Cache”
• “(Implicit) JSON Models (in ThumbsService)”
• “(Optional) Platform Channel to Android WallpaperManager”
Labels:
• UI ↔ Service: “Dart objects (thumb metadata)”
• Service ↔ API: “HTTPS REST (JSON)”
• UI/Image Loader ↔ Image Host: “HTTPS (JPEG/PNG binary)”
• App ↔ Storage: “cached files/thumbnails”
Runtime boundaries
• “Mobile Device”
• Flutter runtime
• Android OS
• “Internet”
• External API
• Image host
Suggested “final architecture” inventory (don’t overthink—split into many components)
Inside Mobile Device
• Flutter App
• main.dart (bootstrap/router)
• HomePage (home.dart)
• WallViewPage (wallview.dart)
• SideDrawer (side_drawer.dart)
• ThumbsService (thumbs.dart)
• (Conceptual) Image Loader/Cache
• Android Container
• MainActivity.kt
• Android Manifest/Resources
• (Optional) Android Wallpaper Manager / Permissions
Outside Device
• Wallpaper API (metadata/search)
• Image CDN/Host (actual image files)
Practical next step
Before finalizing, quickly open pubspec.yaml and confirm:
• which HTTP library is used (http, dio, etc.)
• whether any image caching package exists (cached_network_image, etc.)
• whether wallpaper-setting plugins exist