{"id":30382025,"url":"https://github.com/vnapnic/flutter_clean_architecture","last_synced_at":"2025-08-20T22:51:27.008Z","repository":{"id":42937402,"uuid":"300499241","full_name":"VNAPNIC/Flutter_Clean_Architecture","owner":"VNAPNIC","description":"Flutter clean architecture","archived":false,"fork":false,"pushed_at":"2023-04-21T21:04:29.000Z","size":3145,"stargazers_count":137,"open_issues_count":2,"forks_count":62,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T20:32:23.977Z","etag":null,"topics":["architecture","bloc","ci-cd","clean-architecture","cubit","dart","flutter","flutter-architecture","indentation","intellij","lefthook","mvvm","runner"],"latest_commit_sha":null,"homepage":"","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/VNAPNIC.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-02T04:22:43.000Z","updated_at":"2025-03-13T17:42:49.000Z","dependencies_parsed_at":"2024-01-14T15:26:40.264Z","dependency_job_id":"c7a230b0-0af5-4470-bf49-f42cfde67c7d","html_url":"https://github.com/VNAPNIC/Flutter_Clean_Architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VNAPNIC/Flutter_Clean_Architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VNAPNIC%2FFlutter_Clean_Architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VNAPNIC%2FFlutter_Clean_Architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VNAPNIC%2FFlutter_Clean_Architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VNAPNIC%2FFlutter_Clean_Architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VNAPNIC","download_url":"https://codeload.github.com/VNAPNIC/Flutter_Clean_Architecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VNAPNIC%2FFlutter_Clean_Architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271399986,"owners_count":24752822,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["architecture","bloc","ci-cd","clean-architecture","cubit","dart","flutter","flutter-architecture","indentation","intellij","lefthook","mvvm","runner"],"created_at":"2025-08-20T22:50:58.453Z","updated_at":"2025-08-20T22:51:27.003Z","avatar_url":"https://github.com/VNAPNIC.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Supported Null safety\n\n### Project architecture (Clean Architecture Approach)\n##### 1. Why:\n    * We want to determine what types of database that we use for storage (might want to change it later on)\n    * We want to adhere to SOLID principles since we are using OOP for this project.\n    * We want to ensure that UI layers do not care what is going on at the data layer at all.\n    * We might want to separate each layer into different packages.\n##### 2. Presentation - Domain - Data - models.\n##### 3. Presentation layer consist of\n    * Widgets\n    * Cubit\n    * Cubit only manages UI state based on business logic\n\n##### 4. Domain layer (Business logic layer)\n    * Entities (or models that UI needs)\n    * Usecases (user stories)\n    * Repositories interface\n    * Typically one function, but can be more if functions are related.\n    * Remember, one class has one responsibility only.\n\n##### 5. Data layer (Data access layer)\n    * source\n        * remotes (API)\n        * locals (Database)\n    * Repositories (Implementation from Domain layer)\n\n##### 6. Models (The `data model` common for domain layer and data layer)\n    * models\n    * request\n    * response\n\nWe build this class working separately and not following logics of `Domain layer`. However, `Repositories` will still implement from `Domain layer`, but the `Domain layer` will follow each function, and the `Data layer` will follow the cluster of data defined on the server.\nFor example: `Domain layer` has defined 2 layers of Login and Register features, but these two features are related to the API User cluster on the server, so in the `Data layer`, there will only be one Repo which is user and that Repo will implement 2 layers Login and Register of the `Domain layer`.\n\n##### 6. More insight of layers\n![image](https://miro.medium.com/max/772/0*sfCDEb571WD-7EfP.jpg)\n\n### DI pattern\n`Dependency Injection` is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the application more flexible, easy to expand scales and maintain.\nIn the project we use Plugin `get_it` and `injectable` to implement DI and we have also defined classes so you can easily implement `DI` in the `DI layer`.\n\n### Routes\nThe project has predefined Named routes RouteDefine + manifest\n##### 1. RouteDefine\n     * All routes must extend this class.\n     * When extending, you will have to override func \"initRoute\", here you will define your routes.\n     * A feature may have multiple routes with different input arguments.\n     * Make sure that the ID of each route in your project is unique.\n##### 2. manifest - `lib/manifest.dart`\n     *  To add a route to the project you just need to declare in the func \"generateRoute\". Each route will be provided with a func \"build\", you must call it in the func \"generateRoute\" of \"manifest\" to register.\n### Network.\n     * Project can use retrofit to work with the alternative network for http.\n     * Retrofit is pre-installed in the \"ApiModule.dart\". You can customize it here\n     * All interceptors are defined in the /configuration/lib/network/interceptor/* class\n     * To work with Certificate, please refer to the \"/configuration/lib/network/http_overrides.dart\" class, with the default the project accept badCertificate\n\n### Development environment settings.\n     * All flavor environments are installed in the \"/configuration/lib/environment/buid_config.dart\" class.\n     * Basically we are defining 4 development environments: development, staging, preprod and release.\n     * Run App\n\nYou can run the app using the commands\n\n```\n## development: flutter run -t lib/main.dart --debug --flavor beta\n\n## staging: flutter run -t lib/main.dart --debug --flavor prod\n```\n\n##### Build App\nYou can build the app using the commands\n\nfor Android\n\n```\n## development: flutter build apk -t lib/main.dart --flavor beta\n\n## staging: flutter build apk -t lib/main.dart --flavor prod\n```\n\nfor IOS\n\n```\n## development flutter build ios -t lib/main.dart --flavor beta\n\n## staging: flutter build ios -t lib/main.dart --flavor prod\n```\n\n### resources\n      * All resources (images, fonts, videos, ...) must be placed in the assets class\n      * Before using them, please declare the path in utility class and the suffix of the class to be type_provide (image_provide.dart)\n\n### Getting started\nGet dependencies and generate necessary files.\n```\nnpm run init\n```\nWe'll handle the generation of required files for 🚀 your onboarding!\n\n### Json parsing / serialization\nThis project is implementing [json_serializable](https://pub.dev/packages/json_serializable).\nIt use build_runner to generate files. If you make a change to these files, you need to re-run the generator using build_runner:\n```\nflutter pub run build_runner build\n```\ngenerator using build_runner and remove conflict file :\n```\nnpm run generate\n```\n\n## Indentation.\n- Auto indentation handled with git hook using [Lefthook](https://github.com/Arkweid/lefthook).\n- For mac users, run `npm run setup` and you should be done. More details below.\n- This project use npm for [Lefthook](https://github.com/Arkweid/lefthook) installation, to ease others getting it up running fast - run `npm install`\n- After installation, run `npx lefthook install` to finish up installation.\n- More info [here](https://github.com/Arkweid/lefthook/blob/master/docs/node.md).\n\n### Localization\nUsing this library to handle multi-languages. Follow this guide to understand and config languages files\n\n#### Setup Step :\n\n* VSC, AS, IJ users need to install the plugins from the market.\n* vs-code: https://marketplace.visualstudio.com/items?itemName=localizely.flutter-intl\n* intelliJ / android studio: https://plugins.jetbrains.com/plugin/13666-flutter-intl\n\n* others/CLI:\n```\nflutter pub global activate intl_utils\n\nflutter pub global run intl_utils:generate\n```\n\n### Initialize plugins (IntelliJ reference)\n1. Open Flutter intl in `Action`\n2. Click on `arb File`\n\n![image](screenshots/intl_prompt.png)\n\n3. To add / remove Locale, choose `Add Locale` / `Remove Locale`\n4. Then it will promp which locale\n\n![image](./screenshots/intl_add_locale.png)\n\n**Current available locale is en, en**\n\n\nLink library : https://pub.dev/packages/intl_utils\n\n## Visitors Count\n\u003cimg height=\"30px\" src = \"https://profile-counter.glitch.me/vnapnic/count.svg\" alt =\"Loading\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnapnic%2Fflutter_clean_architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvnapnic%2Fflutter_clean_architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnapnic%2Fflutter_clean_architecture/lists"}