Create necessary folders ๐
- Create a folder inside the lib/modules which is located in the app_core package. The name of the folder should be your feature name. Let's take an example of a home feature.
- Example: auth, home, profile, etc.
lib
โโโ modules
โโโ home
- Now, Create 4 folders like this:
lib
โโโ modules
โโโ home
โ โโโ bloc
โ โ โโโ home_event.dart
โ โ โโโ home_state.dart
โ โ โโโ home_bloc.dart
โ โโโ model
โ โ โโโ home_model.dart
โ โโโ repository
โ โ โโโ home_repository.dart
โ โโโ screen
โ โ โโโ home_screen.dart
Where;
Folder Name ๐ | Use-case ๐ |
---|---|
Home ๐ | Feature name |
bloc ๐งฑ | Contains BLoC, Event, and States related to the feature |
model ๐ช | Contains Dart model classes used for JSON conversion |
repository ๐ชฃ | Contains functions for API calling |
screen ๐ฒ | Contains UI of the feature |