A Flutter app that explores the world of Rick and Morty by fetching character details using the Rick and Morty API. This project demonstrates clean architecture, efficient state management, API integration, and polished UI/UX.
Native Splash | App Splash | Home Page |
---|---|---|
Favorites | No Favorites | No Internet |
---|---|---|
- Character List:
- Display character avatars, names, species, and statuses.
- Infinite scrolling to fetch more characters as you scroll.
- Search and Filter:
- Search for characters by name.
- Filter characters by status (Alive, Dead, Unknown) and species (e.g., Human, Alien).
- Favorite Characters:
- Mark characters as favorites.
- View favorites in a separate tab.
- Character Details:
- View detailed information about a character, including:
- Name, status, species, type, gender.
- Origin and current location.
- Episodes they appear in.
- View detailed information about a character, including:
- Offline Mode:
- Detect and handle no internet connectivity.
- Error Handling:
- Display appropriate error messages for issues like network errors or no search results.
Category | Package | Purpose |
---|---|---|
Networking | dio |
For making API requests. |
State Management | flutter_bloc |
For managing app state efficiently. |
Persistence | shared_preferences |
To save favorite characters locally. |
UI/UX | flutter_screenutil , flutter_svg |
For responsive UI and SVG handling. |
Offline Mode | connectivity_plus , flutter_offline |
To handle offline scenarios and connectivity status. |
Utilities | infinite_scroll_pagination , fluttertoast |
For pagination and user notifications. |
Other | get_it , flutter_native_splash |
Dependency injection and custom splash screen. |
The app follows Clean Architecture principles, separating responsibilities across layers for better scalability, testability, and maintainability.
Contains shared functionality used across the app.
- Constants: App-wide constant values.
- Helpers: Utility functions and extensions.
- Local Storage: Local persistence using
shared_preferences
. - Models: Core data models.
- Network: API client setup with
dio
. - Routes: App navigation routes.
- Utils: Common utilities.
- Widgets: Reusable UI components.
Each feature is implemented in a modular folder structure.
- Data Layer:
- Remote Data Source: Handles API calls via
dio
. - Repository Implementation: Implements repository interfaces.
- Remote Data Source: Handles API calls via
- Domain Layer:
- Repository Interface: Defines contracts for the data layer.
- Use Case: Encapsulates application-specific business logic.
- Presentation Layer:
- UI screens and state management using
flutter_bloc
.
- UI screens and state management using
While building this app, I emphasized the following software development principles and best practices:
- Performance Bottlenecks: Ensured smooth scrolling, fast data loading, and efficient API calls.
- Maintainability Concerns: Structured the project for long-term maintainability with clean architecture.
- Readability Challenges: Used clear naming conventions and concise code for better readability.
- Object-Oriented Programming (OOP): Followed OOP principles to create modular, reusable components.
- Data Structures & Algorithms (DSA): Applied efficient data structures and algorithms for features like searching and filtering.
- SOLID Principles: Ensured the app adheres to SOLID principles for robust and flexible design.
- Design Patterns: Utilized design patterns like Singleton (e.g.,
GetIt
for dependency injection). - Clean Code: Wrote well-documented, readable, and maintainable code.
- Code Smells: Regularly refactored code to eliminate code smells and improve quality.
lib/
├── core/
│ ├── constants/
│ ├── helpers/
│ ├── local_storage/
│ ├── models/
│ ├── network/
│ ├── routes/
│ ├── utils/
│ └── widgets/
├── features/
│ ├── feature_name/
│ │ ├── data/
│ │ │ ├── remote_data_source.dart
│ │ │ ├── repository_implementation.dart
│ │ └── domain/
│ │ ├── repository.dart
│ │ ├── use_cases/
│ │ └── presentation/
│ │ ├── bloc/
│ │ ├── screens/
│ │ └── widgets/
│ └── ...
├── main.dart