Skip to content

Feature First Structure

Latest
Compare
Choose a tag to compare
@Erengun Erengun released this 16 Feb 06:29
· 55 commits to main since this release
e7dafd8

Based on the structure I've provided and the typical Feature First structure, our current setup is on the right track. Here's a brief review of new structure:

  • lib: This is the root directory for your Flutter project's Dart code.
  • common: This directory is good for placing shared utilities, widgets, or other code that is not specific to any feature.
  • config: This directory is appropriate for storing configuration files or settings that might be used across different features.
  • constants: This directory is suitable for storing constant values that might be used throughout the app.
  • data: This directory could be used for data models or interfaces that are used by multiple features.
  • di: For dependency injection, which is a good practice for managing dependencies and services.
  • exceptions: This is a good place to define custom exceptions that might be thrown by your app.
  • features: This directory is central to the Feature First structure. Each feature should have its own subdirectory, and this is where you've placed home, info, etc. This allows each feature to be developed, tested, and maintained independently.
  • localization: This is the right place for localization files, which helps in supporting multiple languages in your app.
  • routing: This directory is suitable for managing your app's routing logic, which is a key part of navigation and user experience.
  • utils: This directory is appropriate for utility functions that might be used across different features.

Overall, our structure is well-organized and follows the Feature First principles. Each feature has its own directory, and shared resources are placed in the appropriate common, config, constants, data, utils directories. This setup allows for better separation of concerns, easier maintenance, and improved scalability as your app grows.

What's Changed

Full Changelog: https://github.com/Erengun/Flutter-Riverpod-2.0-Template/commits/v1.0.1