Understanding the code structure of your Flutter project is essential for maintaining and scaling the application efficiently.
This document provides a concise, developer-friendly overview of the project’s architecture, folder hierarchy, and responsibilities — prepared for CodeCanyon submission.
This project follows a clean architecture pattern, ensuring clear separation between UI, state management, data handling, and utilities.
lib/
├── configs/
├── core/
│ ├── common_widgets/
│ ├── constants/
│ ├── models/
│ ├── providers/
│ ├── services/
│ ├── utils/
│ └── widgets/
├── data/
│ ├── local/
│ ├── repositories/
│ └── service/
├── page/
│ ├── splash/
│ ├── auth/
│ ├── home/
│ ├── attendance/
│ ├── attendance_report/
│ ├── leave_request/
│ ├── employee_directory/
│ ├── notification/
│ ├── content_pages/
│ ├── profile/
│ ├── settings_screen/
│ └── welcome/
└── assets/
lib/configs/api_configs.dart: Base URL, endpoints, and request configuration.lib/main.dart: App entry, localization, theme, routing, provider registration.lib/core/providers/**/*.dart: Feature state and actions (auth, home, leave, notifications, etc.).lib/data/repositories/**/*.dart: External API access; each feature has its repository.lib/core/models/**/*.dart: Strongly typed request/response models per feature.lib/core/services/auth_error_handler.dart: Central handler to intercept auth failures and redirect via navigatorKey.lib/core/utils/validators.dart: Form and input validators used across the app.lib/page/**: Feature-first UI structure. Each feature has view/ screens and widget/ components.assets/translations/ (en, ar, es, hi, zh). Initialized in main.dart via EasyLocalization.lib/core/constants/ to ensure consistent colors, typography, and spacing.lib/page/.../view/*.dart triggers an action (e.g., check-in).Provider (e.g., check_in_check_out provider) coordinates the call.Repository to call the backend via Dio.lib/core/models/** and update provider state.common_widgets/.