{"id":19710541,"url":"https://github.com/rootstrap/flutter-base","last_synced_at":"2025-04-29T17:31:21.156Z","repository":{"id":79867883,"uuid":"515689990","full_name":"rootstrap/flutter-base","owner":"rootstrap","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-23T12:46:19.000Z","size":2233,"stargazers_count":5,"open_issues_count":8,"forks_count":0,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-23T13:58:42.730Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootstrap.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,"zenodo":null}},"created_at":"2022-07-19T17:57:21.000Z","updated_at":"2025-04-23T12:46:23.000Z","dependencies_parsed_at":"2024-06-27T19:05:59.075Z","dependency_job_id":"99e06be7-b01c-4131-8d77-fa81b351e92d","html_url":"https://github.com/rootstrap/flutter-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fflutter-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fflutter-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fflutter-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fflutter-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/flutter-base/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251549206,"owners_count":21607368,"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-11-11T22:07:41.090Z","updated_at":"2025-04-29T17:31:21.135Z","avatar_url":"https://github.com/rootstrap.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/rootstrap/ios-base.svg)](https://github.com/rootstrap/flutter-base/blob/master/LICENSE.md)\n\n# Flutter Base Template\n\nFlutter base is a boilerplate project created by Rootstrap for new projects using Flutter. The main\nobjective is helping any new projects jump start into feature development by providing a handful of\nfunctionalities.\n\n# Features\n\nThis template comes with:\n\n- Melos: Manage actions.\n- Dependency injection (GetIt).\n- HttpClient already configured for Rootstrap BE Projects(Dio).\n- Theming setup.\n- Navigation Router and DeepLinks config with go_router\n- Intl.\n- State Management (Blocs/Cubit).\n- Env config and flavors.\n- Chat with Gemini and Vertex AI (Documentation and setup WIP)\n- GitWorkflow config: RS-GPT-Review\n- GitWorkflow config: Sonarqube\n\n## Initial Setup\n\n1. Create a new repo using this template.\n\n   ![template](app/template.png)\n2. Clone your new repo.\n3. Install [Melos](https://melos.invertase.dev/getting-started) globally executing: `dart pub global activate melos`.\n4. test: `melos -v` * note: if your terminal don't recognize melos command, you can add the following line to your .zshrc or .bashrc file:*\n```text\n    export PATH=\"$PATH\":\"$HOME/.pub-cache/bin\"\n``` \n5. Run `melos doctor`. \n6. Run `melos pub:get`. \n7. Setup Android:\n    - Add to the build.properties file (and update when needed):\n```text \n    flutter.versionName=1.0.0\n    flutter.appId=base\n    flutter.versionCode=1\n    flutter.compileSdkVersion=33\n    flutter.minSdkVersion=21\n    flutter.targetSdkVersion=33 \n```\n\n8. Android SignIn\n    - Create your release Key Store:\n\n```text\n   keytool -genkey -v -keystore ~/keystore_name.jks -keyalg RSA -keysize 2048 -validity 10000 -alias your_alias\"\n```\n\n- Create the 'key.properties' file with the keystore information:\n\n```text\n    storePassword=\u003cYourStorePassword\u003e\n    keyPassword=\u003cYourKeyPassword\u003e\n    keyAlias=\u003cYourStoreAlias\u003e\u003e\n    storeFile=\u003cFilePath\u003e\n```\n\n9. Add your env vars, create a config file for each env:\n   ![me](env_config_files.png)\n    - add the env config, i.e:\n\n```text\n    {\n        \"API_URL\": \"https://dummyjson.com\"\n    }\n```\n\n10. Setup iOs App Name and id:\n   - Locate the config file for each flavor and configure the FLUTTER_APP_NAME i.e: Debug.xcconfig\n```text\n     FLUTTER_APP_ID=base.debug\n     FLUTTER_APP_NAME=RS Base Debug\n```\n\n## Set up an editor\n\n- Follow the [Android Studio](https://docs.flutter.dev/get-started/editor?tab=androidstudio)\n  instructions to setup the editor\n\n- Follow the [VS Code](https://docs.flutter.dev/get-started/editor?tab=vscode) instructions to setup\n  the editor\n\n## Running the App\n\n1. Open a Simulator or Emulator\n2. Open your project in your editor of preference\n\n**Note:** Starting with **Flutter 2.8** in order for you to launch the app in **Android** you must\ndefine the `flutter.compileSdkVersion` inside the `local.properties` file.\n\nYou can read more about\nthis [here](https://docs.page/bizz84/complete-flutter-course/faq/android-build-gradle-issues).\n\n### Android Studio\n\n1. Add a **Run Configuration**\n    1. Add new **Flutter** configuration\n    2. Give it a meaningful name **IE:** Dev, QA, Staging, Prod\n    3. Pick the entry point, main.dart file location **IE:** ``.../lib/main/env/main_dev.dart``\n2. Include any additional run arguments to launch the app.\n    1. Create each env files config files in your root **app/**\n       ![me](env_config_files.png)\n    2. Setup your build, add the env file to the build command in AE:\n       ![me](env_config.png)\n3. Setup your env vars, i.e the api_url for each env:\n    ```text\n        {\n            \"API_URL\": \"https://dummyjson.com\"\n        }\n    ```\n4. Select the device to launch the App\n5. Run the App\n\n### VS Code\n\n1. Go to **Run and Debug** section at the **Activity Bar**\n2. At the top of the section expand the list and **Add Configuration**\n3. Insert **Flutter Launch** configuration\n    1. Update the environment name **(dev)**\n    2. Update the launch program path **``/lib/main/env/main_dev.dart``**\n    3. Update the **Flutter Mode** (debug, profile, release)\n    4. Include any additional run argments to launch the app.\n        1. Environment variables\n\n           Add the env vars for each flavor with the property ``toolArgs``\n           ![launch configuration example](app/vs-code-launch-configuration.png)\n\n4. Inside the **Run and Debug** section select the environment you want to excute\n5. Make sure you have the device you want to use already open\n6. Run the App\n\n**Note 1:** Create as much **Launch Configurations** as you need for any specific environment.\n\n**Note 2:** You shouldn't commit the **``.vscode/launch.json``** file.\n\n## Build Production App:\n\n1. Build your android appBundle or apk:\n    - run the following command to build your appBundle\n\n    ```text\n        flutter build appBundle -t lib/main/env/main.dart --dart-define-from-file=env_prod.json\n    ```\n\n   [TODO: add how to setup Xcode for apple signIn]\n2. Configure your iOs app sigIn.\n    - run the following command to build your ipa\n\n    ```text\n        flutter build ipa --release -t lib/main/env/main.dart --dart-define-from-file=env_prod.json\n    ```\n\nFor more information you can check the [docs](https://dartcode.org/docs/launch-configuration/)\n\n## Packages\n\n- [GetIt](https://pub.dev/packages/get_it) For dependency injection.\n- [Dio](https://pub.dev/packages/dio) A http client.\n- [Blocs](https://pub.dev/packages/bloc) and [Cubit](https://pub.dev/packages/flutter_bloc) as State\n  management library.\n\n## Utilities\n\n- [intl](https://pub.dev/packages/intl) and [intl_utils](https://pub.dev/packages/intl_utils) for\n  localization.\n- [flutter_svg](https://pub.dev/packages/flutter_svg) Svg Image loader.\n\n## Code Quality Standards\n\nIn order to meet the required code quality standards, this project is following\nthis [tech guides considerations](https://github.com/rootstrap/tech-guides/blob/master/flutter/README.md)\n.\nIt also runs [flutter analyze](https://dart.dev/tools/dart-analyze) for each build on your CI/CD\ntool.\n\n## Security recommendations\n\n### Obfuscation\n\nTBD\n\n## CI/CD configuration with Bitrise (updated on Dec 12th 2021)\n\nWe are using Bitrise to configure and run\nthe [CI/CD pipelines](https://www.notion.so/rootstrap/Flutter-CI-CD-9a0a5957ee8442908fc00c3ea8f49bf1)\n\n### Github Actions: RS-GPT-Review\n- Configure GPT secrets vars on your repo settings:\n    - OPENAI_KEY\n#### Note: The action will only run if the description or comments mentions @rs-gpt-review\n\n### Github Actions: Sonarqube\n- Go to you sonarqube server and configure a new project.\n- Configure the sonar-project.properties:\n    example:\n    '''\n        sonar.projectKey=your-app-key\n        sonar.projectName=your-project-name\n        sonar.host.url=https://your-sonarqube-server.net\n        sonar.projectVersion=1.0\n        sonar.sourceEncoding=UTF-8\n    '''\n# Main source directories\nsonar.sources=app/lib,modules/domain,modules/data,modules/common\nsonar.dart.exclusions=pubspec.yaml\nsonar.dart.analyzer.report.mode=LEGACY\n- Configure Sonarqube secrets vars on your repo settings:\n  - SONAR_TOKEN (your sonarqube project token)\n  - SONAR_URL (your sonarqube server url)\n\n## License\n\nFlutter-Base is available under the MIT license. See the LICENSE file for more info.\n\n**NOTE:** Remove the free LICENSE file for private projects or replace it with the corresponding\nlicense.\n\n## Credits\n\n**Flutter Base** is maintained by [Rootstrap](http://www.rootstrap.com) with the help of\nour [contributors](https://github.com/rootstrap/flutter-base/contributors).\n\n[\u003cimg src=\"https://s3-us-west-1.amazonaws.com/rootstrap.com/img/rs.png\" width=\"100\"/\u003e](http://www.rootstrap.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fflutter-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Fflutter-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fflutter-base/lists"}