Atomic C(ontroller) S(ervice) R(epository) Feature
A template for busy developers to fastly deploy a new feature under the Feature Based Skeleton (of course you can use this brick without the skeleton brick) This brick is using atomic design & Controller Service Repository pattern.
NOTE:
- We are using riverpod as a state management solution in this example. But, since this is a CSR patterned feature, you can change the state management in the example and bring your own state management solution.
- The theme file & the domain-model file might have exceptions because they depend on firestore & google fonts dependencies. If you want them to work out of the box, add these dependencies.
Fun coding!
How to use: ๐งพ
cd into the features folder of the project and execute:
mason add atomic_csr_feature && mason make atomic_csr_feature
after the brick has been layed, execute for freezed code generation:
flutter pub run build_runner watch --delete-conflicting-outputs
Variables: โ๏ธ
Variable | Description | Default | Type |
---|---|---|---|
feature_folder_name | Feature Folder Name | auth_flow | string |
feature | Feature Name | auth | string |
project_name | Project Name | skyChat | string |
Output: ๐
features/
โโ feature_folder_name/
โ โโ feature_state/
โ โ โโ feature_state.dart
โ โ โโ feature_state.freezed.dart
โ โโ domain/
โ โ โโ feature_model/
โ โ โ โโ feature_model.dart
โ โ โ โโ feature_model.freezed.dart
โ โ โ โโ feature_model.g.dart
โ โโ widgets/
โ โ โโ atoms
โ โ โโ molecules
โ โ โโ organisms
โ โ โโ pages
โ โโ feature_controller.dart
โ โโ feature_repository.dart
โ โโ feature_service.dart
...