Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesbrel/flutter_clean_and_modular_arch_with_flutter_bloc
Clean, modular architecture is a particularly interesting concept... for a project that is structured, maintainable and scalable without a hitch...
https://github.com/jamesbrel/flutter_clean_and_modular_arch_with_flutter_bloc
bloc clean-architecture dart flutter flutter-bloc mobile modularization
Last synced: about 2 months ago
JSON representation
Clean, modular architecture is a particularly interesting concept... for a project that is structured, maintainable and scalable without a hitch...
- Host: GitHub
- URL: https://github.com/jamesbrel/flutter_clean_and_modular_arch_with_flutter_bloc
- Owner: JamesBrel
- License: mit
- Created: 2024-02-03T01:47:17.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-16T10:31:14.000Z (6 months ago)
- Last Synced: 2024-07-16T13:08:29.624Z (6 months ago)
- Topics: bloc, clean-architecture, dart, flutter, flutter-bloc, mobile, modularization
- Language: Dart
- Homepage:
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Flutter Mobile : Clean and Modular Architecture
### Author : James Brel
### Alias : The Coder
### Contact : [email protected]
------
## Architecture
the architecture of each feature is based on the clean architecture of Uncle Bob which is constituted mainly of 3 layers :
- Data
- Domain
- States Holder```
π¦features
β πfetch_hello_world
β β£ πstates_holder
β β£ πdata
β β πdomain
```## General Folder Structure Tree
```
π¦project
β£ π.env
β β£ πdev.json
β β£ πprod.json
β β πstaging.json
β£ π.vscode
β β πlaunch.json
β£ πandroid
β β£ πapp
β β β£ πsrc
β β β β πAndroidManifest.xml
β β β£ πbuild.gradle
β β β πproguard-rules.pro
β β£ πkey.properties
β β πreadme.md
β£ πassets
β β£ πfonts
β β β π.gitkeep
β β£ πimages
β β β£ πjpg
β β β β π.gitkeep
β β β£ πpng
β β β β π.gitkeep
β β β πsvg
β β β β π.gitkeep
β β£ πlanguages
β β β£ πen.json
β β β πfr.json
β β πreadme.md
β£ πintegration_test
β β πviews
β β β£ πscreens
β β β β π.gitkeep
β β β πwidgets
β β β β π.gitkeep
β£ πlib
β β£ πsrc
β β β£ πcore
β β β β£ πconfigs
β β β β β£ πassets_config
β β β β β β π.gitkeep
β β β β β£ πinjectors_config
β β β β β β£ πinjector.config.dart
β β β β β β πinjector.dart
β β β β β£ πlanguage_config
β β β β β β£ πtranslations_delegate.dart
β β β β β β πtranslator.dart
β β β β β πwindows_config
β β β β β β πwindow_config.dart
β β β β£ πrouter
β β β β β£ πauto_routes.dart
β β β β β πauto_routes.gr.dart
β β β β£ πthemes
β β β β β£ πdark_theme.dart
β β β β β πlight_theme.dart
β β β β πinit.dart
β β β£ πmodules
β β β β πhello_world_mod
β β β β β£ πfeatures
β β β β β β πfetch_hello_world
β β β β β β β£ πdata
β β β β β β β β£ πlocal_source
β β β β β β β β β£ πabsts
β β β β β β β β β β πsay_the_hello_world_abst.dart
β β β β β β β β β£ πimpls
β β β β β β β β β β πsay_the_hello_world_impl.dart
β β β β β β β β β πmodels
β β β β β β β β β β π.gitkeep
β β β β β β β β£ πremote_source
β β β β β β β β β£ πabsts
β β β β β β β β β β π.gitkeep
β β β β β β β β β£ πimpls
β β β β β β β β β β π.gitkeep
β β β β β β β β β πmodels
β β β β β β β β β β π.gitkeep
β β β β β β β β πreposit_impls
β β β β β β β β β πthe_system_say_hello_world_reposit_impl.dart
β β β β β β β£ πdomain
β β β β β β β β£ πentities
β β β β β β β β β π.gitkeep
β β β β β β β β£ πreposit_absts
β β β β β β β β β πthe_system_say_hello_world_reposit_abst.dart
β β β β β β β β πusecases
β β β β β β β β β πsystem_say_hello_world_usecase.dart
β β β β β β β πstates_holder
β β β β β β β β πhello_world_bloc
β β β β β β β β β£ πhello_world_bloc.dart
β β β β β β β β β£ πhello_world_event.dart
β β β β β β β β β πhello_world_state.dart
β β β β β πui
β β β β β β£ πscreens
β β β β β β β πwelcome_screen.dart
β β β β β β πwidgets
β β β β β β β π.gitkeep
β β β πshared
β β β β£ πconstants
β β β β β£ πcolors_const.dart
β β β β β£ πdouble_const.dart
β β β β β£ πenvs_const.dart
β β β β β£ πint_const.dart
β β β β β£ πlang_const.dart
β β β β β£ πroutes_const.dart
β β β β β πstring_const.dart
β β β β£ πextensions
β β β β β π.gitkeep
β β β β£ πglobal
β β β β β πstring_variable.dart
β β β β£ πhelpers
β β β β β π.gitkeep
β β β β£ πservices
β β β β β£ πcache
β β β β β β£ πconfigs
β β β β β β β πcache_instance.dart
β β β β β β£ πenums
β β β β β β β πshared_preference_enum.dart
β β β β β β πrequests
β β β β β β β£ πshared_preference_requests
β β β β β β β β£ πshared_delete_request.dart
β β β β β β β β£ πshared_get_request.dart
β β β β β β β β πshared_put_request.dart
β β β β β β β£ πshared_preference_streaming_requests
β β β β β β β β£ πstream_delete_request.dart
β β β β β β β β£ πstream_get_request.dart
β β β β β β β β πstream_put_request.dart
β β β β β β β πstorage_requests
β β β β β β β β£ πstorage_delete_request.dart
β β β β β β β β£ πstorage_get_request.dart
β β β β β β β β πstorage_put_request.dart
β β β β β£ πconnection
β β β β β β£ πconfigs
β β β β β β β πconnection_instance.dart
β β β β β β πrequests
β β β β β β β πconnection_checker_request.dart
β β β β β£ πfirebase
β β β β β β£ πconfigs
β β β β β β β£ πfirebase_config.dart
β β β β β β β πfirebase_instance.dart
β β β β β β£ πdatabase
β β β β β β β πuser_model.dart
β β β β β β£ πoptions
β β β β β β β£ πdev
β β β β β β β β πfirebase_emulators_dev.dart
β β β β β β β πstaging
β β β β β β£ πrequests
β β β β β β β£ πanalytics_requests
β β β β β β β β£ πanalytic_get_event_request.dart
β β β β β β β β πanalytic_observer_request.dart
β β β β β β β£ πauth_requests
β β β β β β β β πphone_auth_request.dart
β β β β β β β£ πfirebase_storage_requests
β β β β β β β β£ πfirebase_storage_get_request.dart
β β β β β β β β πfirebase_storage_post_request.dart
β β β β β β β£ πfirestore_requests
β β β β β β β β£ πfirestore_delete_request.dart
β β β β β β β β£ πfirestore_get_request.dart
β β β β β β β β£ πfirestore_post_request.dart
β β β β β β β β πfirestore_update_request.dart
β β β β β β β πfirestore_stream_requests
β β β β β β β β πfirestore_stream_get_request.dart
β β β β β β πutils
β β β β β β β£ πconvert_util.dart
β β β β β β β£ πroot_util.dart
β β β β β β β£ πstatus_util.dart
β β β β β β β πstring_util.dart
β β β β β£ πhttp
β β β β β β£ πapis
β β β β β β β πaccount_api.dart
β β β β β β£ πconfigs
β β β β β β β£ πdio_instance.dart
β β β β β β β πhttp_overrides_helper.dart
β β β β β β£ πrequests
β β β β β β β£ πhttp_delete_request.dart
β β β β β β β£ πhttp_get_request.dart
β β β β β β β£ πhttp_post_request.dart
β β β β β β β πhttp_update_request.dart
β β β β β β πapi_version.dart
β β β β β£ πimage
β β β β β β£ πconfigs
β β β β β β β πimage_instance.dart
β β β β β β£ πmessages
β β β β β β β πnote_message.dart
β β β β β β πrequests
β β β β β β β£ πimage_camera_request.dart
β β β β β β β£ πimage_compress_request.dart
β β β β β β β£ πimage_copper_request.dart
β β β β β β β πimage_gallery_request.dart
β β β β β£ πisar
β β β β β β£ πconfigs
β β β β β β β£ πisar_config.dart
β β β β β β β πisar_instance.dart
β β β β β β£ πdatabase
β β β β β β β πuser_models
β β β β β β β β π.gitkeep
β β β β β β£ πrequests
β β β β β β β£ πisar_requests
β β β β β β β β£ πisar_delete_request.dart
β β β β β β β β£ πisar_get_request.dart
β β β β β β β β£ πisar_post_request.dart
β β β β β β β β πisar_update_request.dart
β β β β β β β πisar_stream_requests
β β β β β β β β πisar_get_stream_request.dart
β β β β β β πutils
β β β β β β β πstatuts_util.dart
β β β β β£ πjwt
β β β β β β πrequests
β β β β β β β πjwt_decode_request.dart
β β β β β πsecurity
β β β β β β πrequests
β β β β β β β£ πdecrypt_request.dart
β β β β β β β πencrypt_request.dart
β β β β πui
β β β β β£ πscreens
β β β β β β π.gitkeep
β β β β β πwidgets
β β β β β β π.gitkeep
β β πmain.dart
β£ πtest
β β π.gitkeep
β£ π.gitignore
β£ πanalysis_options.yaml
β πflutter_native_splash.yaml
```
## Lib Folder Structure Tree
```
π¦lib
β£ πsrc
β β£ πcore
β β β£ πconfigs
β β β β£ πassets_config
β β β β β π.gitkeep
β β β β£ πinjectors_config
β β β β β£ πinjector.config.dart
β β β β β πinjector.dart
β β β β£ πlanguage_config
β β β β β£ πtranslations_delegate.dart
β β β β β πtranslator.dart
β β β β πwindows_config
β β β β β πwindow_config.dart
β β β£ πrouter
β β β β£ πauto_routes.dart
β β β β πauto_routes.gr.dart
β β β£ πthemes
β β β β£ πdark_theme.dart
β β β β πlight_theme.dart
β β β πinit.dart
β β£ πmodules
β β β πhello_world_mod
β β β β£ πfeatures
β β β β β πfetch_hello_world
β β β β β β£ πdata
β β β β β β β£ πlocal_source
β β β β β β β β£ πabsts
β β β β β β β β β πsay_the_hello_world_abst.dart
β β β β β β β β£ πimpls
β β β β β β β β β πsay_the_hello_world_impl.dart
β β β β β β β β πmodels
β β β β β β β β β π.gitkeep
β β β β β β β£ πremote_source
β β β β β β β β£ πabsts
β β β β β β β β β π.gitkeep
β β β β β β β β£ πimpls
β β β β β β β β β π.gitkeep
β β β β β β β β πmodels
β β β β β β β β β π.gitkeep
β β β β β β β πreposit_impls
β β β β β β β β πthe_system_say_hello_world_reposit_impl.dart
β β β β β β£ πdomain
β β β β β β β£ πentities
β β β β β β β β π.gitkeep
β β β β β β β£ πreposit_absts
β β β β β β β β πthe_system_say_hello_world_reposit_abst.dart
β β β β β β β πusecases
β β β β β β β β πsystem_say_hello_world_usecase.dart
β β β β β β πstates_holder
β β β β β β β πhello_world_bloc
β β β β β β β β£ πhello_world_bloc.dart
β β β β β β β β£ πhello_world_event.dart
β β β β β β β β πhello_world_state.dart
β β β β πui
β β β β β£ πscreens
β β β β β β πwelcome_screen.dart
β β β β β πwidgets
β β β β β β π.gitkeep
β β πshared
β β β£ πconstants
β β β β£ πcolors_const.dart
β β β β£ πdouble_const.dart
β β β β£ πenvs_const.dart
β β β β£ πint_const.dart
β β β β£ πlang_const.dart
β β β β£ πroutes_const.dart
β β β β πstring_const.dart
β β β£ πextensions
β β β β π.gitkeep
β β β£ πglobal
β β β β πstring_variable.dart
β β β£ πhelpers
β β β β π.gitkeep
β β β£ πservices
β β β β£ πcache
β β β β β£ πconfigs
β β β β β β πcache_instance.dart
β β β β β£ πenums
β β β β β β πshared_preference_enum.dart
β β β β β πrequests
β β β β β β£ πshared_preference_requests
β β β β β β β£ πshared_delete_request.dart
β β β β β β β£ πshared_get_request.dart
β β β β β β β πshared_put_request.dart
β β β β β β£ πshared_preference_streaming_requests
β β β β β β β£ πstream_delete_request.dart
β β β β β β β£ πstream_get_request.dart
β β β β β β β πstream_put_request.dart
β β β β β β πstorage_requests
β β β β β β β£ πstorage_delete_request.dart
β β β β β β β£ πstorage_get_request.dart
β β β β β β β πstorage_put_request.dart
β β β β£ πconnection
β β β β β£ πconfigs
β β β β β β πconnection_instance.dart
β β β β β πrequests
β β β β β β πconnection_checker_request.dart
β β β β£ πfirebase
β β β β β£ πconfigs
β β β β β β£ πfirebase_config.dart
β β β β β β πfirebase_instance.dart
β β β β β£ πdatabase
β β β β β β πuser_model.dart
β β β β β£ πoptions
β β β β β β£ πdev
β β β β β β β πfirebase_emulators_dev.dart
β β β β β β πstaging
β β β β β£ πrequests
β β β β β β£ πanalytics_requests
β β β β β β β£ πanalytic_get_event_request.dart
β β β β β β β πanalytic_observer_request.dart
β β β β β β£ πauth_requests
β β β β β β β πphone_auth_request.dart
β β β β β β£ πfirebase_storage_requests
β β β β β β β£ πfirebase_storage_get_request.dart
β β β β β β β πfirebase_storage_post_request.dart
β β β β β β£ πfirestore_requests
β β β β β β β£ πfirestore_delete_request.dart
β β β β β β β£ πfirestore_get_request.dart
β β β β β β β£ πfirestore_post_request.dart
β β β β β β β πfirestore_update_request.dart
β β β β β β πfirestore_stream_requests
β β β β β β β πfirestore_stream_get_request.dart
β β β β β πutils
β β β β β β£ πconvert_util.dart
β β β β β β£ πroot_util.dart
β β β β β β£ πstatus_util.dart
β β β β β β πstring_util.dart
β β β β£ πhttp
β β β β β£ πapis
β β β β β β πaccount_api.dart
β β β β β£ πconfigs
β β β β β β£ πdio_instance.dart
β β β β β β πhttp_overrides_helper.dart
β β β β β£ πrequests
β β β β β β£ πhttp_delete_request.dart
β β β β β β£ πhttp_get_request.dart
β β β β β β£ πhttp_post_request.dart
β β β β β β πhttp_update_request.dart
β β β β β πapi_version.dart
β β β β£ πimage
β β β β β£ πconfigs
β β β β β β πimage_instance.dart
β β β β β£ πmessages
β β β β β β πnote_message.dart
β β β β β πrequests
β β β β β β£ πimage_camera_request.dart
β β β β β β£ πimage_compress_request.dart
β β β β β β£ πimage_copper_request.dart
β β β β β β πimage_gallery_request.dart
β β β β£ πisar
β β β β β£ πconfigs
β β β β β β£ πisar_config.dart
β β β β β β πisar_instance.dart
β β β β β£ πdatabase
β β β β β β πuser_models
β β β β β β β π.gitkeep
β β β β β£ πrequests
β β β β β β£ πisar_requests
β β β β β β β£ πisar_delete_request.dart
β β β β β β β£ πisar_get_request.dart
β β β β β β β£ πisar_post_request.dart
β β β β β β β πisar_update_request.dart
β β β β β β πisar_stream_requests
β β β β β β β πisar_get_stream_request.dart
β β β β β πutils
β β β β β β πstatuts_util.dart
β β β β£ πjwt
β β β β β πrequests
β β β β β β πjwt_decode_request.dart
β β β β πsecurity
β β β β β πrequests
β β β β β β£ πdecrypt_request.dart
β β β β β β πencrypt_request.dart
β β β πui
β β β β£ πscreens
β β β β β π.gitkeep
β β β β πwidgets
β β β β β π.gitkeep
β πmain.dart
```## Usage and Configuration
Once you have created your application or flutter project, you clone the architecture from Github, to start on a good basis
Note:
the predefined files, such as welcome.dart in the front end and other folders, as well as example_test file, are only files that will allow you to be on the right track and to get a good understanding of the architecture.- step_1: Installation of pre_packages for pre-launch
Inside the pubspec.yaml file, you must integrate firstly the following dependencies :```yaml
-----------StartUp Dependencies------------
flutter_localizations:
sdk: flutter
intl: ^last version
flutter_native_splash: ^last version
auto_route: ^last version
equatable: ^last version
get_it: ^last version
injectable: ^last version
flutter_bloc: ^last version
bloc: ^last version
multiple_result: ^last version
fluttertoast: ^last version
----------------------------
```
- step_1: Installation of dev_dependencies
Inside the pubspec.yaml file, you must integrate firstly the following packages :```yaml
auto_route_generator: ^last version
injectable_generator: ^last version
build_runner: ^last version
```
these packages will allow you to easily activate the various files imported into the architecture.
then, you just have to follow, the readme.md in the folder **assets**- step_2: Integration of the architecture
once in the Clean and Modular Architecture folder, you copy all its content to paste it in your project.- Bonus: The dependencies you need for the various services and config
- ### Cache
```yaml
flutter_secure_storage: ^last version
shared_preferences: ^last version
streaming_shared_preferences: ^last version
```
- ### Connexion
```yaml
internet_connection_checker_plus: ^last version
```
- ### Firebase
```yaml
firebase_core: ^last version
firebase_app_check: ^last version
firebase_auth: ^last version
cloud_firestore: ^last version
firebase_storage: ^last version
firebase_messaging: ^last version
firebase_crashlytics: ^last version
firebase_analytics: ^last version
cloud_functions: ^last version
```
- ### Http
```yaml
dio: ^last version
```
- ### Image
```yaml
image_picker: ^last version
flutter_native_image: ^last version
image_cropper: ^last version
```
- ### Isar
```yaml
isar: ^last version
isar_flutter_libs: ^last version
isar_generator: ^last version
```
- ### Jwt
```yaml
jwt_decoder: ^last version
```
- ### assets_gen
```yaml
flutter_svg: ^last version
flutter_gen: ^last version
flutter_gen_runner: ^last version
```
add this following line in
pubspec.yaml
```yaml
flutter_gen:
# Optional
output: lib/src/core/configs/assets_config
# Optional
line_length: 80
# Optional
parse_metadata: false# Optional
integrations:
flutter_svg: true
flare_flutter: true
rive: true
lottie: falseassets:
# Optional
enabled: true
# Optional
outputs:
# Optional
# Set to true if you want this package to be a package dependency
# See: https://flutter.dev/docs/development/ui/assets-and-images#from-packages
package_parameter_enabled: true
# Optional
# Available values:
# - camel-case
# - snake-case
# - dot-delimiter
style: dot-delimiter
class_name: Assets
exclude: []fonts:
# Optional
enabled: true
# Optional
outputs:
class_name: FontFamily
```
after you read the doc : https://pub.dev/packages/flutter_gen- ### test
add in dev_dependencies
```yaml
bloc_test: ^last version
mocktail: ^last version
integration_test:
sdk: flutter
```---
Copyright Β© 2024 James Brel All Rights Reserved