Skip to content

Update flutter flavor instructions#13037

Open
lazarohcm wants to merge 7 commits intoflutter:mainfrom
lazarohcm:update-flutter-flavor-instructions
Open

Update flutter flavor instructions#13037
lazarohcm wants to merge 7 commits intoflutter:mainfrom
lazarohcm:update-flutter-flavor-instructions

Conversation

@lazarohcm
Copy link

Description of what this PR is changing or adding, and why:

Adds a new section to the Android and iOS flavors documentation explaining how to
reference the active flavor within Dart code.
While the existing guide covers platform-side configuration, developers
frequently need to access the flavor name at runtime to configure environment-
specific logic, such as API endpoints or feature flags.
This addition introduces the appFlavor constant from the flutter/services
library as the recommended way to retrieve this information.

Issues fixed by this PR (if any):

None.

PRs or commits this PR depends on (if any):

None.

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@lazarohcm lazarohcm requested review from a team and sfshaza2 as code owners February 5, 2026 12:33
@google-cla
Copy link

google-cla bot commented Feb 5, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lazarohcm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the Flutter flavor documentation by addressing a common developer need: accessing the active flavor programmatically within Dart code. By introducing the appFlavor constant and providing clear usage instructions, it empowers developers to implement dynamic, environment-specific configurations directly in their application logic, enhancing the flexibility and maintainability of Flutter projects using flavors.

Highlights

  • Documentation Enhancement: A new section has been added to the Android and iOS flavors documentation to guide developers on how to reference the active flavor within Dart code.
  • Runtime Flavor Access: The documentation now explains the use of the appFlavor constant from the flutter/services library as the recommended way to retrieve the flavor name at runtime for environment-specific logic.
  • Code Examples: Practical code examples are provided, demonstrating how to import the services library and use appFlavor within the main() function to configure API endpoints or other settings based on the detected flavor (e.g., 'production', 'staging').

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/content/deployment/flavors-ios.md
    • Added a new section titled 'Access the current flavor' under the iOS flavor documentation.
    • Included instructions on importing package:flutter/services.dart to access the appFlavor constant.
    • Provided a Dart code example demonstrating how to use appFlavor in main() for conditional logic based on the flavor.
    • Added a note clarifying that appFlavor matches the product flavor name and returns null if no flavor is specified.
  • src/content/deployment/flavors.md
    • Introduced a new top-level section 'Use flavors in Flutter code' to the general flavors documentation.
    • Explained the role of the appFlavor constant in retrieving the current flavor name as a String.
    • Added a sub-section 'Access the current flavor' with steps to import package:flutter/services.dart.
    • Included a Dart code example illustrating how to use appFlavor for environment-specific configurations in main().
    • Added a note explaining the behavior of appFlavor regarding flavor names and null values.
Activity
  • The author, lazarohcm, has completed the presubmit checklist, indicating adherence to documentation style guidelines and semantic line breaks.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds helpful documentation on accessing flavors within Dart code. My review includes a few suggestions to improve accuracy and correctness. Specifically, the iOS documentation incorrectly references Android's build.gradle.kts file, which should be corrected to refer to Xcode schemes. Additionally, the code examples in both documents use invalid syntax for URL strings, for which I've provided corrections.

lazarohcm and others added 5 commits February 5, 2026 16:37
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant