Flutter Project Structure
A scalable and maintainable folder structure for Flutter applications
File Structure
- lib
- main.dart
- screens
- home_screen.dart
- profile_screen.dart
- widgets
- custom_button.dart
- custom_card.dart
- assets
- images
- fonts
- pubspec.yaml
- README.md
Directory Structure Explanation
lib/
The main source directory containing all Dart code for the Flutter application.
lib/main.dart
The entry point of the Flutter application where the app is initialized and run.
lib/screens/
Contains the main screen widgets that represent different pages in the app.
screens/home_screen.dart
The home screen widget, typically the main landing page of the application.
lib/widgets/
Contains reusable custom widgets that can be used across different screens.
widgets/custom_button.dart
A custom button widget with consistent styling and behavior.
assets/
Contains static assets like images, fonts, and other resources used in the app.
pubspec.yaml
The package configuration file that defines dependencies, assets, and metadata.