How umardeen1/anime_app works
1. This repository is a Flutter application called Anime Hub, structured as a single client app that targets Android, iOS, web, Linux, macOS, and Windows from the same Dart codebase. The native platform folders are mostly standard Flutter runners and wrappers around the shared app.
2. The core application lives under lib/ and is organized into four clear layers: bloc for state management, models for API data structures, services for network access, and pages for UI screens. This separation is the main architectural boundary in the repo.
3. lib/main.dart is the entry point and likely wires up the top-level app shell and the BLoC provider(s). From the README, the app uses flutter_bloc, so state is centralized rather than managed inside individual screens.
4. The data source boundary is the Jikan API. The service layer in lib/services/api_service.dart is responsible for HTTP calls to fetch trending, upcoming, searched, and detail data. This is the only part of the app that should know about API endpoints and response retrieval.
5. The domain/data mapping boundary is in lib/models/anime.dart. API responses are parsed into strongly typed anime models before reaching the UI, which keeps screens from depending directly on raw JSON and makes the app’s data shape consistent.
6. The business logic boundary is lib/bloc/anime_bloc.dart. This layer likely coordinates fetching, searching, refreshing, and loading states, turning service results into UI-consumable states. It sits between the API service and the pages, preventing screens from calling the network directly.
7. The presentation layer is split across four pages: home, search, anime_details, and new_release_page. These correspond to the main user flows described in the README: discovery, search, detailed item view, and latest releases.
8. The app’s primary user flow is: user opens a page, the page dispatches a BLoC event, the BLoC calls the API service, the service fetches data from Jikan, the response is converted into models, and the BLoC emits loading/success/error states back to the page for rendering. That’s the key end-to-end data flow to show in an architecture diagram.
9. The UI emphasizes a dark, Netflix-style discovery experience with dynamic home content, a hero header, and Shimmer loading effects. These are presentation concerns only; they do not change the core data architecture but affect how loading and content states are displayed.
10. Trailer support is part of the app’s feature set, but there is no separate backend in this repo. That implies trailer URLs are resolved from Jikan/MAL data and opened externally or embedded from the client side, so trailer handling remains part of the front-end flow.
11. The repository includes GitHub Actions workflows under .github/workflows for Dart/Flutter CI. These are build/test automation boundaries rather than runtime components, but they matter for understanding how the app is validated across the Flutter toolchain.
12. The test/ directory contains a Flutter widget test scaffold, indicating at least baseline UI test coverage. There is no sign of a custom server, database, or authentication subsystem in this repo; the architecture is a client-only app centered on API consumption and local UI state.
Main entry points: main.dart App entry · anime_bloc.dart Anime bloc · api_service.dart API service · home.dart Home
Components 19
Shared app
Cross-platform Flutter application code in lib/
- App entry · Bootstraps the app and wires top-level providers/navigation.
lib/main.dart - Anime bloc · Coordinates fetch/search/loading/error state for the UI.
lib/bloc/anime_bloc.dart - API service · Fetches anime data from the Jikan API endpoints.
lib/services/api_service.dart - Anime model · Parses and normalizes API responses into typed anime objects.
lib/models/anime.dart - Home · Main browsing experience with featured and trending content.
lib/pages/home.dart - Search · Searches anime catalog and renders filtered results.
lib/pages/search.dart - Details · Shows anime metadata, trailers, and item-specific content.
lib/pages/anime_details.dart - New releases · Surfaces upcoming and newly released anime content.
lib/pages/new_release_page.dart - flutter_bloc · External state-management package used across the app.
- Jikan API · External anime data source consumed by the app.
- Shimmer · Skeleton/loading presentation used while content is fetched.
- Trailer flow · Resolves and opens trailer links from anime metadata.
Platform runners
Native wrappers that launch the shared Flutter app
- Android · Android host wrapper for the shared Flutter app.
android/app/src/main/kotlin/com/example/anime_app/MainActivity.kt - iOS · iOS host wrapper for the shared Flutter app.
ios/Runner/AppDelegate.swift - Linux · Linux shell and window bootstrap for the Flutter app.
linux/runner/main.cc - macOS · macOS shell and window bootstrap for the Flutter app.
macos/Runner/AppDelegate.swift - Windows · Windows shell and window bootstrap for the Flutter app.
windows/runner/main.cpp
Automation
CI and test scaffolding
- GitHub Actions · Automated Flutter/Dart validation in .github/workflows.
.github/workflows/flutter-ci.yml - Widget test · Baseline Flutter widget test coverage.
test/widget_test.dart
Connections 22
- App entry → flutter_bloc: uses · App entry wires state management into the app shell.
- App entry → Home: opens · Launches the main browsing experience.
- App entry → Anime bloc: provides · Makes the anime bloc available to screens.
- Home → Anime bloc: dispatches · Home triggers fetch and refresh events.
- Search → Anime bloc: dispatches · Search drives query-based state changes.
- Details → Anime bloc: reads · Detail screen consumes item state and loading status.
- New releases → Anime bloc: dispatches · Release screen requests release-oriented data.
- Anime bloc → API service: calls · Bloc coordinates network access through the service layer.
- API service → Jikan API: fetches · Service performs HTTP requests to Jikan.
- API service → Anime model: parses · Maps API payloads into typed anime models.
- Anime bloc → Anime model: emits · Bloc exposes model-backed states to the UI.
- Home → Shimmer: shows · Home uses skeletons while content loads.
- Search → Shimmer: shows · Search uses loading placeholders during fetches.
- New releases → Shimmer: shows · Release screen uses loading placeholders during fetches.
- Details → Trailer flow: opens · Detail screen launches or embeds trailer playback.
- Android → App entry: hosts · Android embeds the shared Flutter entrypoint.
- iOS → App entry: hosts · iOS embeds the shared Flutter entrypoint.
- Linux → App entry: hosts · Linux embeds the shared Flutter entrypoint.
- macOS → App entry: hosts · macOS embeds the shared Flutter entrypoint.
- Windows → App entry: hosts · Windows embeds the shared Flutter entrypoint.
- GitHub Actions → Widget test: runs · CI validates the app with Flutter/Dart workflows.
- GitHub Actions → App entry: checks · Workflows validate the shared application code.