This PR introduces the Feature First structure to the Flutter Riverpod 2.0 template, enhancing the modularity and maintainability of the codebase. The Feature First approach organizes code into self-contained features, each with its own set of responsibilities and dependencies, leading to a more intuitive and scalable project structure.
Changes:
Restructured the lib directory to follow the Feature First approach.
Moved feature-specific code from lib to dedicated feature directories under lib/features.
Created common, config, constants, data, di, exceptions, localization, routing, and utils directories within lib to hold shared resources and utilities.
Benefits:
Modularity: Each feature is now self-contained, making it easier to understand, develop, and test.
Scalability: The structure supports the addition of new features without introducing unnecessary complexity.
Maintainability: Shared resources are centralized, reducing duplication and making it easier to update dependencies across features.
Example of Feature Directory Structure:
Hey i have a flutter riverpod 2.0 template in github write me a short pr content that introduces feature first structure
‣ lib
‣ common
‣ config
‣ constants
‣ data
‣ di
‣ exceptions
‣ features
‣ home
‣ info
‣ ...
‣ localization
‣ routing
‣ utils
**Next Steps:**
- Ensure that existing features are refactored to align with the new structure.
- Update documentation to reflect the new organization.
- Review the current CI/CD pipeline to ensure it accommodates the new structure.
**Testing:**
- Manual testing of the application has been performed to confirm that all features function as expected.
This PR introduces the Feature First structure to the Flutter Riverpod 2.0 template, enhancing the modularity and maintainability of the codebase. The Feature First approach organizes code into self-contained features, each with its own set of responsibilities and dependencies, leading to a more intuitive and scalable project structure.
Changes:
lib
directory to follow the Feature First approach.lib
to dedicated feature directories underlib/features
.common
,config
,constants
,data
,di
,exceptions
,localization
,routing
, andutils
directories withinlib
to hold shared resources and utilities.Benefits:
Example of Feature Directory Structure:
‣ lib ‣ common ‣ config ‣ constants ‣ data ‣ di ‣ exceptions ‣ features ‣ home ‣ info ‣ ... ‣ localization ‣ routing ‣ utils