{"id":18011356,"url":"https://github.com/mhmzdev/flutter-bloc-implementation","last_synced_at":"2025-04-04T13:42:47.805Z","repository":{"id":109325561,"uuid":"558273471","full_name":"mhmzdev/flutter-bloc-implementation","owner":"mhmzdev","description":"A very close implementation to actual bloc architecture that separates the data layer with business and presentation layer.","archived":false,"fork":false,"pushed_at":"2022-10-27T13:11:17.000Z","size":221,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T23:27:41.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhmzdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-27T08:14:59.000Z","updated_at":"2024-08-13T12:34:01.000Z","dependencies_parsed_at":"2023-04-22T16:01:00.084Z","dependency_job_id":null,"html_url":"https://github.com/mhmzdev/flutter-bloc-implementation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fflutter-bloc-implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fflutter-bloc-implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fflutter-bloc-implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fflutter-bloc-implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmzdev","download_url":"https://codeload.github.com/mhmzdev/flutter-bloc-implementation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247188961,"owners_count":20898611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T03:09:46.673Z","updated_at":"2025-04-04T13:42:47.774Z","avatar_url":"https://github.com/mhmzdev.png","language":"Dart","readme":"## Weather App\n\nIt is very close implementation to actual bloc architecture: https://bloclibrary.dev/#/flutterweathertutorial\n\n*Just includes the fetching of Weather at the moment, not other features*\n\n### Implementation\nIt includes 4 layers:\n\n1. Data layer (data provider)\n2. Repository layer\n3. Business layer (cubit/state)\n3. Presentation layer (front-end/UI)\n\nAnd you start coding them respectively. Overall concept for this architecture will be:\n\n**Your Data Layer must be hidden/abstracted from your business/presentation layer, so the point of interaction will be the respository layer**\n\n### Terminologies\n#### Barrel\n- Just a file that exports other files to clean-up imports\n\n### Extensions\n#### Bloc\n- VS Code extension: https://marketplace.visualstudio.com/items?itemName=FelixAngelov.bloc\n- Dart Data Class Generator: https://marketplace.visualstudio.com/items?itemName=hzgood.dart-data-class-generator\n\n### Project structure\n\n### Business and Presentation layer\n\n```dart\nlib\n    - extensions\n        - ...\n    -  screens/\n        - weather/\n            - cubits (Business layer)\n                - weather_cubit.dart\n                - weather_state.dart\n            - models\n                - models.dart (Barrel)\n            - views (Presentation layer)\n                - weather_view.dart (Entry point of UI)\n                - widgets/\n                    - error.dart\n                    - loading.dart\n                    - success.dart\n                    - widgets.dart (Barrel)\n```\n\n### Data and Repository layers\n\n```dart\npackages\n    - weather_data_provider/ (Data layer - Abstracted/Hidden)\n        - lib/\n            - src/\n                - models/\n                    - models.dart (barrel)\n                    - location.dart\n                    - weather.dart\n            - weather_data_provider.dart (data provider implementation)\n        - weather_data_provider (Barrel)\n\n    - weather_repository (Repository layer)\n        - lib/\n            - src/\n                - models\n                    - models.dart (barrel)\n                    - weather.dart\n            - weather_repository.dart (repository implementation)\n        - weather_repository.dart (barrel)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fflutter-bloc-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmzdev%2Fflutter-bloc-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fflutter-bloc-implementation/lists"}