Skip to content

Latest commit

Β 

History

History
99 lines (77 loc) Β· 4.1 KB

File metadata and controls

99 lines (77 loc) Β· 4.1 KB

Flutter Base Project (Movie App Demo)

A modern, responsive Flutter application showcasing a Clean Architecture implementation with a robust set of libraries and tools. This project serves as a comprehensive base for building scalable Flutter apps, currently demonstrating a Movie Database integration.

πŸš€ Tech Stack


πŸ— Project Structure

The project strictly follows Clean Architecture principles, dividing the code into discrete, decoupled layers:

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ common/          # Shared elements like AppTheme and ThemeCubit (Light/Dark Mode)
β”‚   β”œβ”€β”€ configs/         # App-wide configurations and constants
β”‚   β”œβ”€β”€ database/        # Local storage solutions (e.g., SharedPreferences)
β”‚   β”œβ”€β”€ failure/         # Error handling and failure models
β”‚   β”œβ”€β”€ network/         # Dio client, API Constants, Retrofit ApiClients
β”‚   └── utils/           # Helper functions and utilities
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ models/          # Data models (Responses, Entities, Enums) bridging JSON and UI
β”‚   └── repositories/    # Concrete implementations for data fetching and caching
β”‚
β”œβ”€β”€ router/              # GoRouter configuration and route definitions
β”‚
β”œβ”€β”€ ui/                  # User Interface layer (pages and shared widgets)
β”‚   β”œβ”€β”€ pages/           # Organized by Feature (e.g., home, detail, onboarding)
β”‚   β”‚   β”œβ”€β”€ detail/      # Movie detail screen, cubit, and navigator
β”‚   β”‚   β”œβ”€β”€ home/        # Home listing screen, cubit, navigator, and local widgets
β”‚   β”‚   └── onboarding/  # First-time user experience and onboarding bloc
β”‚   β”‚
β”‚   └── widgets/         # Reusable, completely stateless UI components
β”‚       β”œβ”€β”€ appbars/     # Custom AppBars
β”‚       β”œβ”€β”€ buttons/     # Reusable buttons
β”‚       β”œβ”€β”€ images/      # Network image wrappers
β”‚       └── scaffold/    # Base scaffold widgets
β”‚
└── main.dart            # Application entry point & root BlocProviders

πŸ›  Setup & Installation

1. Clone the repository and install dependencies

git clone <repository-url>
cd flutter_base_project
flutter pub get

2. Run Code Generation (Crucial for Retrofit / JSON Serializable) Because this project utilizes code generation for API Clients and JSON parsing, you must run build_runner before the project can compile successfully.

# Run one time to build generated files (.g.dart)
dart run build_runner build --delete-conflicting-outputs

# OR run securely in the background checking for file changes
dart run build_runner watch --delete-conflicting-outputs

▢️ Running the App

You can run the app using the standard Flutter CLI commands:

# Run on connected device or simulator
flutter run

# Run in debug mode explicitly
flutter run --debug

# Run unit tests (if any)
flutter test

# Run static analysis to catch syntax or linting errors
flutter analyze

πŸŒ™ Features & Highlights

  • Dynamic Theming: An interactive toggle inside the Home App Bar seamlessly switches between Light and Dark mode using a ThemeCubit.
  • Code-Generated API Routes: Utilizes Retrofit to cleanly declare API routes on an interface, abstracting away complex parsing and boilerplate code.
  • Component Extraction: All generic UI logic (Scaffolds, custom App Bars, Back Buttons, Network Images) are perfectly modularized into lib/core/widgets for instantaneous reuse.