This repository contains both an iOS app written in Swift and a Flutter app that display Pokémon data. The project includes networking, data storage, and user interfaces with list and detail screens. This README provides a brief overview of the folder structure and key components.
The main Xcode project is stored under AnotherPokemonAssignment.
Important subfolders include:
- AppDelegate.swift and SceneDelegate.swift – standard iOS entry points for application lifecycle management and UI setup.
- List – implementation of the Pokémon list screen with view model and table view controller.
- Detail – components for displaying Pokémon details.
- Favorite – view model and view for managing favorite Pokémon.
- Networking –
APIClient,Request, andResponseclasses for making HTTP requests. - Service – wrappers around the networking layer to fetch data from the PokeAPI.
- UseCase – business logic that combines services and storage to supply data to view models.
- Store –
UserDefaultsStorefor persisting favorite Pokémon locally. - Extension – small helper utilities used throughout the project.
- Tests – unit tests for services, use cases, and view models.
The Flutter client lives in flutter_another_pokemon_assignment/ and now implements a comprehensive Pokémon list with complete favorite functionality and navigation.
- Complete Features: Implements the Pokémon list experience with pull-to-refresh, infinite scroll (30 items per page), error surfacing, per-row favorite toggles, and a dedicated favorites list page with navigation.
- Enhanced State Management: Uses
flutter_blocwithPokemonListBloc, globalFavoriteBloc, andFavoritesListBlocto manage all states centrally, keeping UI concerns isolated from data fetching and persistence. - Navigation Architecture: Features
MainNavigationPagewith bottom navigation between Pokemon list and favorites list, usingIndexedStackfor state preservation. - Supabase Quiz Experience: Adds a "Who's That Pokémon" silhouette quiz tab backed by Supabase edge functions, countdown reveal flow, and cached option sampling via
QuizBloc. - Data layer:
ListRepositoryconsolidates pagination, JSON decoding, and mapping into thePokemondomain model, whileFavoritePokemonRepositorypersists favorite selections throughLocalPokemonService(now backed by SQLite viasqflite). - Networking:
APIClientandRequestBuilderwraphttpto provide typed errors and shared request assembly that matches the iOS stack. - Tooling: Introduces
freezed,json_serializable,equatable,mockito, andbloc_testfor model generation and testability. - Enhanced Data Model:
LocalPokemonmodel includesid,name,imageURL,isFavorite,created, andupdatedAttimestamps for comprehensive favorite management and deterministic ordering. - Documentation: See the dedicated walkthroughs in
flutter_another_pokemon_assignment/README_POKEMON_LIST.mdandflutter_another_pokemon_assignment/README_POKEMON_FAVORITE.mdfor deeper dives into the features.
This project includes comprehensive Cursor Rules for consistent development practices:
- Project Structure: Overall architecture and file organization guidelines
- Flutter BLoC Pattern: State management and BLoC implementation best practices
- iOS MVVM Pattern: Swift MVVM architecture and coding standards
- Testing Guidelines: Unit testing strategies for both platforms
- Networking & API: HTTP client patterns and error handling
- Error Handling: User experience and error recovery strategies
- Flutter Dependencies: Package management and code generation
These rules are automatically applied by Cursor to assist with:
- Code generation and refactoring
- Architecture pattern enforcement
- Testing strategy guidance
- Error handling implementation
- Dependency management
- Open
AnotherPokemonAssignment.xcodeprojin Xcode. - Build and run the app to explore the list and detail screens.
- Review the use cases and services to understand how network responses are decoded and passed to the UI.
- Run the unit tests to verify core functionality.
- Navigate to
flutter_another_pokemon_assignment/directory. - Run
flutter pub getto install dependencies. - Run
flutter runto start the app. The list screen dispatchesPokemonListLoadRequestedon launch and supports pull-to-refresh and load-more interactions. - Execute
flutter testto run the bloc, repository, and service specifications that cover pagination, favorite toggling, and error handling paths.
This project is licensed under the MIT License. See LICENSE for details.