{"id":32293879,"url":"https://github.com/blvckpvblo/flavor_getter","last_synced_at":"2026-02-22T15:31:43.808Z","repository":{"id":176321594,"uuid":"655339534","full_name":"blvckpvblo/flavor_getter","owner":"blvckpvblo","description":"Flutter plugin to retrieve build flavors","archived":false,"fork":false,"pushed_at":"2025-05-15T14:51:10.000Z","size":93,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T15:24:16.130Z","etag":null,"topics":["android","dart","flutter-plugins","ios"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blvckpvblo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-06-18T15:48:08.000Z","updated_at":"2025-05-15T14:49:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"76422a87-258b-4ca3-a297-92bb7260be69","html_url":"https://github.com/blvckpvblo/flavor_getter","commit_stats":null,"previous_names":["blvckpvblo/flavor_getter"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/blvckpvblo/flavor_getter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blvckpvblo%2Fflavor_getter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blvckpvblo%2Fflavor_getter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blvckpvblo%2Fflavor_getter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blvckpvblo%2Fflavor_getter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blvckpvblo","download_url":"https://codeload.github.com/blvckpvblo/flavor_getter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blvckpvblo%2Fflavor_getter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29717250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["android","dart","flutter-plugins","ios"],"created_at":"2025-10-23T03:37:15.295Z","updated_at":"2026-02-22T15:31:43.798Z","avatar_url":"https://github.com/blvckpvblo.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flavor Getter\n\n[![pub package](https://img.shields.io/pub/v/flavor_getter.svg)](https://pub.dev/packages/flavor_getter)\n\nFlavor Getter is a Flutter plugin that helps developers retrieve the current flavor (or variant) their application is running in directly from their Flutter code. This plugin currently supports iOS and Android platforms.\n\n## Installation\n\nTo use the Flavor Getter plugin in your Flutter project, follow these steps:\n\n1. Add the following dependency to your project's `pubspec.yaml` file:\n```yaml\ndependencies:\n  flavor_getter: ^0.0.4\n```\nReplace `^0.0.4` with the desired version of the Flavor Getter plugin.\n\n2. Run the following command to fetch the dependencies:\n```bash\nflutter pub get\n```\n\n3. Import the Flavor Getter package in your Dart code:\n```dart\nimport 'package:flavor_getter/flavor_getter.dart';\n```\n\n## Getting Started\n\nTo use Flavor Getter in your Flutter project, you need to perform some setup steps depending on the platform you are targeting.\n\n## Platform Support\n\n| Platform | Support |\n| -------- | ------- |\n| iOS      | ✅      |\n| Android  | ✅      |\n\n## Disclaimer\n\nPlease note that this readme assumes that you have already set up the flavors (or variants) for your iOS and Android projects. The instructions provided here focus on integrating the Flavor Getter plugin into your existing flavor setup. If you haven't set up flavors yet, please refer to the respective platform documentation to configure flavors for your project.\n\n### iOS Setup\n\n1. Open your Flutter project in Xcode by navigating to `ios/Runner.xcworkspace`.\n2. In Xcode, select your application target (Runner) and go to the **Build Settings** tab.\n3. Under the **User-Defined** section, add a new build setting called `FLAVOR` and set it to the desired flavor value for each scheme.\n4. Open the `Info.plist` file located in the `ios/Runner` directory.\n5. Add a new entry to the Information Property List with the key `FLAVOR` and the value `$(FLAVOR)`. This will ensure that the flavor value is accessible in the Info.plist file.\n6. Save the `Info.plist` file.\n7. Build and run your application using the desired scheme and flavor.\n\n### Android Setup\n\n1. Open your Flutter project in Android Studio.\n2. Locate the `android/app/build.gradle` file.\n3. Inside the `android` block, ensure that the `defaultConfig` section contains the following line:\n```groovy\nandroid {\n    namespace \"com.example.myapp\" // Replace with your namespace\n    // ...\n    defaultConfig {\n        // ...\n        applicationId \"com.example.myapp\" // Replace with your applicationId; make sure it's similar to namespace\n        // ...\n    }\n}\n```\nThe applicationId should match the package name defined in your `AndroidManifest.xml` file.\n\n4. Add the following configuration to enable BuildConfig generation:\n```groovy\nandroid {\n    // ...\n    buildFeatures {\n        buildConfig = true\n    }\n    // ...\n}\n```\n\n5. To add flavors, add the following lines to the android block:\n```groovy\nflavorDimensions \"default\"\n\nproductFlavors {\n    dev {\n        applicationIdSuffix \".dev\"  // com.example.myapp.dev\n    }\n    prod {\n        applicationIdSuffix \".prod\"  // com.example.myapp.prod\n    }\n}\n```\nCustomize the flavor names (dev and prod) and the applicationIdSuffixes (.dev and .prod) to match your desired flavors.\n\n6. When Proguard is enabled, which is the default for Android release builds, the `BuildConfig` Java class is renamed in the minification process and prevents the library from referencing it. To avoid this, add a rule in `android/app/proguard-rules.pro`:\n\n`-keep class com.example.yourPackageName.BuildConfig { *; }`\n\nThe package name should match the `android:label` value in your `app/src/main/AndroidManifest.xml` file.\n\n## Usage\n\nTo retrieve the current flavor in your Flutter code, you can use the `getFlavor()` function.\n\n```dart\nimport 'package:flavor_getter/flavor_getter.dart';\n\nvoid main() async {\n\tString currentFlavor = await FlavorGetter().getFlavor();\n\tprint('Running in flavor: $currentFlavor');\n}\n```\n## Example\n\nFor a complete example of using Flavor Getter, please refer to the example directory of this plugin.\n\n## Issues and Contributions\n\nPlease report any issues or bugs you encounter by opening an issue on the GitHub repository. Contributions are also welcome via pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblvckpvblo%2Fflavor_getter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblvckpvblo%2Fflavor_getter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblvckpvblo%2Fflavor_getter/lists"}