{"id":21059111,"url":"https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate","last_synced_at":"2025-07-30T23:13:20.757Z","repository":{"id":47983497,"uuid":"254600940","full_name":"ganeshrvel/flutter_mobx_dio_boilerplate","owner":"ganeshrvel","description":"Advanced and highly scalable boilerplate for building Flutter apps with MobX, Dio, GetIt, and AutoRoutes. Null safe and compatible with Flutter 2.0.","archived":false,"fork":false,"pushed_at":"2021-08-11T07:48:28.000Z","size":320,"stargazers_count":98,"open_issues_count":1,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T17:40:03.524Z","etag":null,"topics":["android","boilerplate","dart","flutter","ios","macos","mobx"],"latest_commit_sha":null,"homepage":"https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ganeshrvel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-10T09:54:45.000Z","updated_at":"2025-02-06T20:49:26.000Z","dependencies_parsed_at":"2022-08-12T15:51:43.941Z","dependency_job_id":null,"html_url":"https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate","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/ganeshrvel%2Fflutter_mobx_dio_boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fflutter_mobx_dio_boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fflutter_mobx_dio_boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fflutter_mobx_dio_boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganeshrvel","download_url":"https://codeload.github.com/ganeshrvel/flutter_mobx_dio_boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254447824,"owners_count":22072754,"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":["android","boilerplate","dart","flutter","ios","macos","mobx"],"created_at":"2024-11-19T17:09:56.593Z","updated_at":"2025-07-30T23:13:20.737Z","avatar_url":"https://github.com/ganeshrvel.png","language":"Dart","funding_links":["https://paypal.me/ganeshrvel"],"categories":[],"sub_categories":[],"readme":"# Flutter Mobx Dio Boilerplate [null safe]\n\n- Author: [Ganesh Rathinavel](https://www.linkedin.com/in/ganeshrvel \"Ganesh Rathinavel\")\n- License: [MIT](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate/blob/master/LICENSE \"MIT\")\n- Repo URL: [https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate \"https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate\")\n- Contacts: ganeshrvel@outlook.com\n- Requirements: Flutter and Dart\n\n#### Advanced and highly scalable boilerplate for building Flutter App - Mobx, Dio, GetIt and AutoRoutes.\n\n###### Flutter is an excellent framework for building cross-platform native applications. But there are only a handful of frameworks available online to get going and I found most of them lack advanced features.\n\n### Features\n- Null Safe, supports Flutter 2.0!!\n- Mobx for state management (https://pub.dev/packages/mobx)\n- Dio for fetching APIs (https://pub.dev/packages/dio)\n- GetIt/Injectable for Dependecy Injection (DI) (https://pub.dev/packages/get_It and https://pub.dev/packages/injectable)\n- auto_route for routing (https://pub.dev/packages/auto_route)\n- data_channel for exception handling and data routing (https://pub.dev/packages/data_channel)\n- Multi theme support\n- Multilingual support (l10n)\n- Pre-commit hooks\n- Logging using [logger](https://pub.dev/packages/logger \"logger\") (lib/utils/log)\n\n[Find the tutorial links](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate#tutorials \"Find the tutorial links\")\n\n### Installation\n```shell\n$ git clone https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate.git\n\n$ cd flutter_mobx_dio_boilerplate\n```\n\n```shell\n\n$ flutter create .\n$ flutter pub get\n$ flutter pub upgrade\n```\n\nThis boilerplate uses code generation tools to automatically generate code during the hot reload workflow, and while building an Application. \n\n```shell\n# clean conflicting codes\n./scripts/build-runner-clean.sh\n```\n\n```shell\n# keep your code automatically synced\n./scripts/build-runner-watch.sh\n```\n\n### Configuration\nActivate pre-commit hooks\n```shell\n$ git config core.hooksPath .githooks/\n```\n\nTo activate network connection in macOS, add the following lines to your *macos/Runner/DebugProfile.entitlements* and *macos/Runner/Release.entitlements*\n```xml\n    \u003ckey\u003ecom.apple.security.network.server\u003c/key\u003e\n    \u003ctrue/\u003e\n    \u003ckey\u003ecom.apple.security.network.client\u003c/key\u003e\n    \u003ctrue/\u003e\n```\n\nTo activate video player in,\nmacOS: add the following lines to your *macos/Runner/Info.plist*\n```xml\n    \u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n    \u003cdict\u003e\n      \u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n      \u003ctrue/\u003e\n    \u003c/dict\u003e\n```\n\niOS: add the following lines to your *ios/Runner/Info.plist*\n```xml\n    \u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n    \u003cdict\u003e\n      \u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n      \u003ctrue/\u003e\n    \u003c/dict\u003e\n```\n\nAndroid: Ensure the following permission is present in your Android Manifest file, located in *android/app/src/main/AndroidManifest.xml*\n```xml\n\u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\n```\n\nand add the attribute `android:usesCleartextTraffic=\"true\"` to `\u003capplication`\n\n```xml\n# example\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"abc.xyz.pqr\"\u003e\n\t\u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\n\t\n\t\u003capplication\n        android:usesCleartextTraffic=\"true\"\n\t\t....\n\t\t...\n\t\t/\u003e\n```\n\n### APIS\n\nClone the repo https://github.com/ganeshrvel/auth-apis and follow the instructions in the [README.md](https://github.com/ganeshrvel/auth-apis/blob/master/README.md \"README.md\") for the running the API server.\n\n### Directory structure\n```shell\n.\n├── common\n│   ├── api_client\n│   │   ├── api_client.dart\n│   │   ├── api_errors\n│   │   └── interceptors\n│   ├── di\n│   ├── enums\n│   ├── exceptions\n│   ├── helpers\n│   ├── l10n\n│   ├── mixins\n│   ├── models\n│   ├── network\n│   ├── router\n│   └── themes\n├── constants\n├── features\n│   ├── app\n│   │   ├── data\n│   │   │   ├── controllers\n│   │   │   ├── data_sources\n│   │   │   └── repositories\n│   │   └── ui\n│   │       ├── l10n\n│   │       ├── pages\n│   │       └── store\n│   ├── home\n│   │   └── ui\n│   ├── login\n│   │   ├── data\n│   │   │   ├── controllers\n│   │   │   │   └── login_controller.dart\n│   │   │   ├── data_sources\n│   │   │   │   ├── login_local_data_source.dart\n│   │   │   │   └── login_remote_data_source.dart\n│   │   │   ├── mappers\n│   │   │   ├── models\n│   │   │   │   ├── authentication_model.dart\n│   │   │   │   ├── post_login_request_model.dart\n│   │   │   │   ├── post_login_response_model.dart\n│   │   │   │   ├── user_model.dart\n│   │   │   └── repositories\n│   │   │       └── login_repository.dart\n│   │   └── ui\n│   │       ├── l10n\n│   │       │   ├── en.dart\n│   │       │   └── hi.dart\n│   │       ├── pages\n│   │       │   └── login.dart\n│   │       └── store\n│   │           ├── login_store.dart\n│   ├── page_not_found\n│   │   └── ui\n│   ├── profile\n│   │   └── ui\n│   └── splash\n│       └── ui\n├── main.dart\n├── services\n├── utils\n│   ├── alerts\n│   └── log\n├── widget_extends\n└── widgets\n```\n\n**Detailed view**\n```shell\n.\n├── common # all common files are kept here.\n│   ├── api_client\n│   │   ├── api_client.dart # api client (dio) logics\n│   │   ├── api_errors # api client error\n│   │   └── interceptors # dio logics\n│   ├── di # dependency injection (DI); 3rd party classes are included here for DI\n│   ├── enums # common enums\n│   ├── exceptions # common exceptions\n│   ├── helpers # common helpers\n│   ├── l10n # common l10n (localization) files. add a new locale file for a new language addition\n│   ├── mixins # common mixins\n│   ├── models # common models\n│   ├── network # network helpers\n│   ├── router # routing logic\n│   └── themes # theme data files\n├── constants # constants such as strings, errors message names, dimensions etc.\n├── features # contains the logic for all features\n│   ├── app\n│   │   ├── data # contains the models, controllers, data_sources, repositories\n│   │   │   ├── controllers\n│   │   │   ├── data_sources\n│   │   │   └── repositories\n│   │   │   ├── models\n│   │   └── ui # any ui related stuffs are added here\n│   │       ├── l10n # localization files and data are added here for the particular page. Make sure that every new locale file is added in lib/common/l10n/en.dart\n│   │       ├── pages # every screen related stuffs\n│   │       └── store # mobx store for state management\n│   ├── home\n│   │   └── ui\n│   ├── login\n│   │   ├── data\n│   │   │   ├── controllers\n│   │   │   │   └── login_controller.dart\n│   │   │   ├── data_sources\n│   │   │   │   ├── login_local_data_source.dart\n│   │   │   │   └── login_remote_data_source.dart\n│   │   │   ├── mappers\n│   │   │   ├── models\n│   │   │   │   ├── authentication_model.dart\n│   │   │   │   ├── post_login_request_model.dart\n│   │   │   │   ├── post_login_response_model.dart\n│   │   │   │   ├── user_model.dart\n│   │   │   └── repositories\n│   │   │       └── login_repository.dart\n│   │   └── ui\n│   │       ├── l10n\n│   │       │   ├── en.dart\n│   │       │   └── hi.dart\n│   │       ├── pages\n│   │       │   └── login.dart\n│   │       └── store\n│   │           ├── login_store.dart\n│   ├── page_not_found\n│   │   └── ui\n│   ├── profile\n│   │   └── ui\n│   └── splash\n│       └── ui\n├── main.dart # main file\n├── services # common services\n├── utils # utils\n│   ├── alerts\n│   └── log\n├── widget_extends # widget extend files\n└── widgets # common widgets\n```\n\n### Architecture\nThe boilerplate follows a fusion of Clean architecture and MVVM pattern. It is highly customizable and feature-rich.\n\n![architecture diagram](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate/blob/master/blobs/architecture-diagram.png \"architecture diagram\")\n\n### DC (Data Channel)\nIt is not a very ideal solution to handle exceptions using try and catch at every function call, use `data_channel` instead. `data_channel` will take care of routing errors and data out of a method.\n\n**data_channel (DC)** is a simple dart utility for handling exceptions and data routing.\n\nRefer to https://pub.dev/packages/data_channel for more details.\n\n### Rules\nRules - Powerful and feature-rich validation library for both Dart and Flutter.\n\nRefer to https://pub.dev/packages/rules for more details.\n\n### Non-Null safe version\nFind the non-null safe version from here: https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate/tree/9623e9a367cae5380e3a84840b46263262f166af\n\n\n### IDE\n**Hide Generated Files**\n\nIn-order to hide generated files, navigate to `Android Studio` -\u003e `Preferences` -\u003e `Editor` -\u003e `File Types` and paste the below lines under `Ignore files and Folders` section:\n\n```\n*.inject.summary;*.inject.dart;*.g.dart;\n```\n\nIn Visual Studio Code, navigate to `Preferences` -\u003e `Settings` and search for `Files:Exclude`. Add the following patterns:\n```\n**/*.inject.summary\n**/*.inject.dart\n**/*.g.dart\n```\n\n ### Contribute\n- Fork the repo and create your branch from master.\n- Ensure that the changes pass linting.\n- Update the documentation if needed.\n- Make sure your code lints.\n- Issue a pull request!\n\nWhen you submit code changes, your submissions are understood to be under the same [MIT License](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate/blob/master/LICENSE \"MIT License\") that covers the project. Feel free to contact the maintainers if that's a concern.\n\n### Tutorials\n- Flutter MobX –https://www.youtube.com/watch?v=8j7W91ZJuV0\n- Flutter Clean Architecture - https://www.youtube.com/watch?v=KjE2IDphA_U\n- Flutter Dependency Injection - https://www.youtube.com/watch?v=gfLb4rqzio4\n- Flutter Injectable - https://www.youtube.com/watch?v=KNcP8z0hWqs\n- Flutter Auto Route - https://www.youtube.com/watch?v=iVpVBmDhpJY\n\n### Buy me a coffee\nHelp me keep the app FREE and open for all.\nPaypal me: [paypal.me/ganeshrvel](https://paypal.me/ganeshrvel \"paypal.me/ganeshrvel\")\n\n### Contacts\nPlease feel free to contact me at ganeshrvel@outlook.com\n\n### License\nflutter_mobx_dio_boilerplate | Flutter Mobx Dio Boilerplate is released under [MIT License](https://github.com/ganeshrvel/flutter_mobx_dio_boilerplate/blob/master/LICENSE \"MIT License\").\n\nCopyright © 2018-Present Ganesh Rathinavel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Fflutter_mobx_dio_boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganeshrvel%2Fflutter_mobx_dio_boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Fflutter_mobx_dio_boilerplate/lists"}