From 7656651fa20541de9fab5607253fda3c6e557bd3 Mon Sep 17 00:00:00 2001 From: "Shams Zakhour (ignore Sfshaza)" Date: Mon, 17 Aug 2026 15:52:46 -0700 Subject: [PATCH 1/4] Adding info about flavors for Linux and Windows --- .../src/content/deployment/flavors-ios.md | 4 + .../deployment/flavors-windows-linux.md | 429 ++++++++++++++++++ sites/docs/src/content/deployment/flavors.md | 4 + .../platform-integration/linux/setup.md | 3 + .../platform-integration/windows/setup.md | 3 + sites/docs/src/content/tools/pubspec.md | 7 +- sites/docs/src/data/sidenav/default.yml | 2 + 7 files changed, 450 insertions(+), 2 deletions(-) create mode 100644 sites/docs/src/content/deployment/flavors-windows-linux.md diff --git a/sites/docs/src/content/deployment/flavors-ios.md b/sites/docs/src/content/deployment/flavors-ios.md index f12dc08fb71..d6ed962e0c3 100644 --- a/sites/docs/src/content/deployment/flavors-ios.md +++ b/sites/docs/src/content/deployment/flavors-ios.md @@ -557,10 +557,14 @@ To learn about them, see For more information on creating and using flavors, check out the following resources: +* [Set up Flutter flavors for Android][] +* [Set up Flutter flavors for Windows and Linux][] * [How to set up Flutter & Firebase with Multiple Flavors using the FlutterFire CLI][flutterfire-cli] * [Build flavors in Flutter (Android and iOS) with different Firebase projects per flavor Flutter Ready to Go][flavors-firebase] +[Set up Flutter flavors for Android]: /deployment/flavors +[Set up Flutter flavors for Windows and Linux]: /deployment/flavors-windows-linux [flutterfire-cli]: https://codewithandrea.com/articles/flutter-firebase-multiple-flavors-flutterfire-cli/ [flavors-firebase]: https://medium.com/@animeshjain/build-flavors-in-flutter-android-and-ios-with-different-firebase-projects-per-flavor-27c5c5dac10b diff --git a/sites/docs/src/content/deployment/flavors-windows-linux.md b/sites/docs/src/content/deployment/flavors-windows-linux.md new file mode 100644 index 00000000000..0b07af393cb --- /dev/null +++ b/sites/docs/src/content/deployment/flavors-windows-linux.md @@ -0,0 +1,429 @@ +--- +title: Set up Flutter flavors for Windows and Linux +shortTitle: Flavors (Windows and Linux) +description: > + How to create Flutter flavors for Windows and Linux desktop apps. +--- + +This guide shows you how to create Flutter flavors for +Windows and Linux desktop apps. + +:::note +To create flavors for Android apps, +see [Set up Flutter flavors for Android][]. +To create flavors for iOS and macOS apps, +see [Set up Flutter flavors for iOS and macOS][]. +::: + +## Overview {: #overview } + +A Flutter flavor represents a collection of settings that define +how a specific version of your app builds and runs. +For example, a flavor can determine which window title, binary name, +application ID, API endpoint, asset set, and logging configuration +applies to a build. + +On Windows and Linux, Flutter uses [CMake][] to configure and build +the native desktop runner. +When you run `flutter run` or `flutter build` with the `--flavor` flag, +Flutter provides the flavor name to CMake as the `FLUTTER_APP_FLAVOR` +variable and isolates the build outputs in a flavor-specific directory. + +The following table illustrates the build directories that Flutter creates +when a project defines two flavors (`staging`, `production`) +and two build modes (`debug`, `release`): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlatformFlavorBuild modeOutput directory
Windowsstagingreleasebuild/windows/<arch>/staging/runner/Release/
productionreleasebuild/windows/<arch>/production/runner/Release/
Linuxstagingreleasebuild/linux/<arch>/staging/release/bundle/
productionreleasebuild/linux/<arch>/production/release/bundle/
+ +[CMake]: https://cmake.org/ +[Set up Flutter flavors for Android]: /deployment/flavors +[Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios + +## Configure CMake for flavors {: #configure-cmake } + +Complete the following steps to configure two flavors called +`staging` and `production` for a new or existing Flutter project. + +1. Create a new Flutter project called `flavors_example`: + + ```console title="console" + $ flutter create flavors_example + $ cd flavors_example + ``` + +1. Configure the CMake build files for your target platform: + + + + +Open `windows/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` line. +Update the configuration to append the flavor name to the binary name +when a flavor is specified: + +```cmake title="windows/CMakeLists.txt" +# The name of the executable created for the application. +set(BINARY_NAME "flavors_example") +if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") +endif() +``` + + + +Open `linux/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` and +`set(APPLICATION_ID ...)` lines. +Update the configuration to append the flavor name to the binary name +and application ID when a flavor is specified: + +```cmake title="linux/CMakeLists.txt" +# The name of the executable created for the application. +set(BINARY_NAME "flavors_example") +# The unique GTK application identifier for this application. +set(APPLICATION_ID "com.example.flavors_example") + +if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") + set(APPLICATION_ID "${APPLICATION_ID}.${FLUTTER_APP_FLAVOR}") +endif() +``` + + + + +1. Verify that your flavors run correctly: + + + + +Run the `staging` flavor: + +```console title="console" +$ flutter run -d windows --flavor staging +``` + +Run the `production` flavor: + +```console title="console" +$ flutter run -d windows --flavor production +``` + + + +Run the `staging` flavor: + +```console title="console" +$ flutter run -d linux --flavor staging +``` + +Run the `production` flavor: + +```console title="console" +$ flutter run -d linux --flavor production +``` + + + +## Launch a flavor {: #launch-a-flavor } + +After you configure flavors for your Windows or Linux app, +launch or build a specific flavor using the `--flavor` flag +with the Flutter CLI. + +### Run a flavor in debug mode {: #run-a-flavor } + +To run a specific flavor during development, +pass the `--flavor` option to `flutter run`: + + + + +```console title="console" +$ flutter run -d windows --flavor +``` + + + +```console title="console" +$ flutter run -d linux --flavor +``` + +Replace `` with the name of your flavor +(for example, `staging` or `production`). + + + + +### Build a release binary {: #build-a-flavor } + +To build a release executable for a specific flavor, +pass the `--flavor` option to `flutter build`: + + + + +```console title="console" +$ flutter build windows --flavor +``` + +Flutter outputs the compiled executable to +`build/windows///runner/Release/`. + + + + +```console title="console" +$ flutter build linux --flavor +``` + +Flutter outputs the compiled bundle to +`build/linux///release/bundle/`. + + + + +## Use flavors in Flutter code {: #use-flavors-in-code } + +After you configure your flavors, +you can adjust app behavior—such as selecting API endpoints, +toggling features, or setting analytics keys—based on the active flavor. + +The Flutter framework provides the `appFlavor` constant in the `services` +library, which retrieves the flavor name passed to the `--flavor` flag +during `flutter run` or `flutter build`. + +1. **Import the services library:** + + Add the following import to your Dart file: + + ```dart + import 'package:flutter/services.dart'; + ``` + +1. **Read the flavor value:** + + Use the `appFlavor` constant in your application logic + (often in `main()`) to handle flavor-specific configuration: + + ```dart + void main() { + if (appFlavor == 'production') { + Config.apiUrl = 'https://api.example.com'; + } else if (appFlavor == 'staging') { + Config.apiUrl = 'https://staging.api.example.com'; + } + + runApp(const MyApp()); + } + ``` + + :::note + The value of `appFlavor` matches the string passed to the `--flavor` flag. + If you run or build without specifying a flavor, + `appFlavor` returns `null`. + ::: + +## Customize configurations {: #customize-configurations } + +After adding flavors, +you can customize native settings and assets for each configuration. + +### Create distinct window titles {: #create-distinct-window-titles } + +To help distinguish between different flavors at runtime, +you can customize the native window title for each flavor. + + + + +1. Open `windows/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` + as a preprocessor definition: + +```cmake title="windows/runner/CMakeLists.txt" +if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") +endif() +``` + +1. Open `windows/runner/main.cpp` and update the window title + to include the flavor name when defined: + +```cpp title="windows/runner/main.cpp" +#if defined(FLUTTER_APP_FLAVOR) + std::wstring title = L"flavors_example (" + std::wstring(L"" FLUTTER_APP_FLAVOR) + L")"; + if (!window.Create(title.c_str(), origin, size)) { + return EXIT_FAILURE; + } + #else + if (!window.Create(L"flavors_example", origin, size)) { + return EXIT_FAILURE; + } + #endif +``` + + + + +1. Open `linux/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` + as a preprocessor definition: + +```cmake title="linux/runner/CMakeLists.txt" +if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") +endif() +``` + +1. Open `linux/runner/my_application.cc` and update the window title + in the `my_application_activate` function: + +```c title="linux/runner/my_application.cc" +#if defined(FLUTTER_APP_FLAVOR) + const char* title = "flavors_example (" FLUTTER_APP_FLAVOR ")"; +#else + const char* title = "flavors_example"; +#endif + +if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, title); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); +} else { + gtk_window_set_title(window, title); +} +``` + + + + +### Create distinct app icons {: #create-distinct-app-icons } + +You can provide unique icons for each flavor. + + + + +1. Prepare your icon files in `.ico` format + (for example, `app_icon_staging.ico` and `app_icon_production.ico`) + and place them in `windows/runner/resources/`. + +1. In `windows/CMakeLists.txt`, select the appropriate icon file + based on `FLUTTER_APP_FLAVOR`: + +```cmake title="windows/CMakeLists.txt" +if(FLUTTER_APP_FLAVOR STREQUAL "staging") + set(APP_ICON_NAME "app_icon_staging.ico") +elseif(FLUTTER_APP_FLAVOR STREQUAL "production") + set(APP_ICON_NAME "app_icon_production.ico") +else() + set(APP_ICON_NAME "app_icon.ico") +endif() +``` + +1. Configure `windows/runner/Runner.rc` or your CMake target + to use `APP_ICON_NAME` for the application icon resource. + + + + +1. Prepare PNG icons for each flavor + (for example, `app_icon_staging.png` and `app_icon_production.png`). + +1. Create corresponding `.desktop` files for each flavor + (for example, `flavors_example_staging.desktop` and + `flavors_example_production.desktop`) + that reference the respective icon and executable binary name. + +1. Update `linux/CMakeLists.txt` to install the correct `.desktop` file + and icon based on `FLUTTER_APP_FLAVOR`. + + + + +### Bundle assets by flavor {: #bundle-assets } + +If you have assets that only apply to a specific flavor, +configure Flutter to only bundle those assets when building that flavor. +This prevents unused assets from increasing your application bundle size. + +To bundle assets conditionally, +add the `flavors` list to an asset entry in `pubspec.yaml`: + +```yaml title="pubspec.yaml" +flutter: + assets: + - assets/common/ + - path: assets/staging/ + flavors: + - staging + - path: assets/production/ + flavors: + - production +``` + +To learn more, see the [`assets` field][] in [Flutter pubspec options][]. + +[`assets` field]: /tools/pubspec#assets +[Flutter pubspec options]: /tools/pubspec + +### Set a default flavor {: #set-default-flavor } + +To specify a flavor to use when running or building +without the `--flavor` flag, +add the `default-flavor` property to `pubspec.yaml`: + +```yaml title="pubspec.yaml" +flutter: + default-flavor: staging +``` + +To learn more, see the [`default-flavor` field][] in +[Flutter pubspec options][]. + +[`default-flavor` field]: /tools/pubspec#default-flavor-field + +## More information {: #more-information } + +For more information on flavors and desktop deployment, +consult the following resources: + +* [Set up Flutter flavors for Android][] +* [Set up Flutter flavors for iOS and macOS][] +* [Build and release a Windows desktop app][] +* [Build and release a Linux app to the Snap Store][] + +[Build and release a Windows desktop app]: /deployment/windows +[Build and release a Linux app to the Snap Store]: /deployment/linux diff --git a/sites/docs/src/content/deployment/flavors.md b/sites/docs/src/content/deployment/flavors.md index 7f67d66efca..dfaa9f3c1b6 100644 --- a/sites/docs/src/content/deployment/flavors.md +++ b/sites/docs/src/content/deployment/flavors.md @@ -399,8 +399,12 @@ When setting `abiFilters` in product flavors, pass For more information on creating and using flavors, check out the following resources: +* [Set up Flutter flavors for iOS and macOS][] +* [Set up Flutter flavors for Windows and Linux][] * [Build flavors in Flutter (Android and iOS) with Firebase][] * [How to Setup Flutter & Firebase with Multiple Flavors using the FlutterFire CLI][flutterfireCLI] +[Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios +[Set up Flutter flavors for Windows and Linux]: /deployment/flavors-windows-linux [Build flavors in Flutter (Android and iOS) with Firebase]: https://medium.com/@animeshjain/build-flavors-in-flutter-android-and-ios-with-different-firebase-projects-per-flavor-27c5c5dac10b [flutterfireCLI]: https://codewithandrea.com/articles/flutter-firebase-multiple-flavors-flutterfire-cli/ diff --git a/sites/docs/src/content/platform-integration/linux/setup.md b/sites/docs/src/content/platform-integration/linux/setup.md index ac462e89e9a..b67a084fe9f 100644 --- a/sites/docs/src/content/platform-integration/linux/setup.md +++ b/sites/docs/src/content/platform-integration/linux/setup.md @@ -127,6 +127,9 @@ or begin expanding integration with Linux.
  • Release a Linux app
  • +
  • + Set up app flavors +
  • Write Linux-specific code
  • diff --git a/sites/docs/src/content/platform-integration/windows/setup.md b/sites/docs/src/content/platform-integration/windows/setup.md index dfbfa284a9f..65c9195ffc6 100644 --- a/sites/docs/src/content/platform-integration/windows/setup.md +++ b/sites/docs/src/content/platform-integration/windows/setup.md @@ -147,6 +147,9 @@ or begin expanding integration with Windows.
  • Deploy to windows
  • +
  • + Set up app flavors +
  • Write Windows-specific code
  • diff --git a/sites/docs/src/content/tools/pubspec.md b/sites/docs/src/content/tools/pubspec.md index 6e0194889a6..83d06e6dc5d 100644 --- a/sites/docs/src/content/tools/pubspec.md +++ b/sites/docs/src/content/tools/pubspec.md @@ -243,6 +243,7 @@ flutter: [Set up flavors for iOS and macOS]: /deployment/flavors-ios [Set up flavors for Android]: /deployment/flavors +[Set up flavors for Windows and Linux]: /deployment/flavors-windows-linux [Assets and images]: /ui/assets/assets-and-images [asset images in package dependencies]: /ui/assets/assets-and-images#from-packages [resolution aware]: /ui/assets/assets-and-images#resolution-aware @@ -323,11 +324,13 @@ flutter run --flavor staging ``` To learn how to create Flutter flavors, -see [Set up Flutter flavors for Android][] and -[Set up Flutter flavors for iOS and macOS][]. +see [Set up Flutter flavors for Android][], +[Set up Flutter flavors for iOS and macOS][], and +[Set up Flutter flavors for Windows and Linux][]. [Set up Flutter flavors for Android]: /deployment/flavors [Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios +[Set up Flutter flavors for Windows and Linux]: /deployment/flavors-windows-linux ### deferred-components field diff --git a/sites/docs/src/data/sidenav/default.yml b/sites/docs/src/data/sidenav/default.yml index c1b2fe4ce36..b586fc002ce 100644 --- a/sites/docs/src/data/sidenav/default.yml +++ b/sites/docs/src/data/sidenav/default.yml @@ -577,6 +577,8 @@ permalink: /deployment/flavors - title: Create app flavors for iOS and macOS permalink: /deployment/flavors-ios + - title: Create app flavors for Windows and Linux + permalink: /deployment/flavors-windows-linux - title: Build and release an Android app permalink: /deployment/android - title: Build and release an iOS app From 76814d8bda825a841dd0526038bb746ce5643227 Mon Sep 17 00:00:00 2001 From: "Shams Zakhour (ignore Sfshaza)" Date: Mon, 17 Aug 2026 16:01:15 -0700 Subject: [PATCH 2/4] Fixes typo --- sites/docs/src/content/deployment/flavors-windows-linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/docs/src/content/deployment/flavors-windows-linux.md b/sites/docs/src/content/deployment/flavors-windows-linux.md index 0b07af393cb..0232a99653b 100644 --- a/sites/docs/src/content/deployment/flavors-windows-linux.md +++ b/sites/docs/src/content/deployment/flavors-windows-linux.md @@ -371,7 +371,7 @@ endif() and icon based on `FLUTTER_APP_FLAVOR`. - + ### Bundle assets by flavor {: #bundle-assets } From 1355bd491bbf44261ce6a0f4f7f952a9e9603b06 Mon Sep 17 00:00:00 2001 From: "Shams Zakhour (ignore Sfshaza)" Date: Thu, 27 Aug 2026 13:41:55 -0700 Subject: [PATCH 3/4] Incorporated some (not all) of the feedback --- .../src/content/deployment/flavors-ios.md | 6 +- .../src/content/deployment/flavors-linux.md | 316 +++++----------- .../src/content/deployment/flavors-windows.md | 341 +++++------------- sites/docs/src/content/deployment/flavors.md | 6 +- sites/docs/src/data/sidenav/default.yml | 6 +- 5 files changed, 202 insertions(+), 473 deletions(-) diff --git a/sites/docs/src/content/deployment/flavors-ios.md b/sites/docs/src/content/deployment/flavors-ios.md index 6659ee20b51..4b70e5a5a85 100644 --- a/sites/docs/src/content/deployment/flavors-ios.md +++ b/sites/docs/src/content/deployment/flavors-ios.md @@ -556,13 +556,15 @@ To learn about creating and using flavors, consult the following resources: * [Set up Flutter flavors for Android][] -* [Set up Flutter flavors for Windows and Linux][] +* [Set up Flutter flavors for Linux][] +* [Set up Flutter flavors for Windows][] * [How to set up Flutter & Firebase with Multiple Flavors using the FlutterFire CLI][flutterfire-cli] * [Build flavors in Flutter (Android and iOS) with different Firebase projects per flavor Flutter Ready to Go][flavors-firebase] [Set up Flutter flavors for Android]: /deployment/flavors -[Set up Flutter flavors for Windows and Linux]: /deployment/flavors-windows-linux +[Set up Flutter flavors for Linux]: /deployment/flavors-linux +[Set up Flutter flavors for Windows]: /deployment/flavors-windows [flutterfire-cli]: https://codewithandrea.com/articles/flutter-firebase-multiple-flavors-flutterfire-cli/ [flavors-firebase]: https://medium.com/@animeshjain/build-flavors-in-flutter-android-and-ios-with-different-firebase-projects-per-flavor-27c5c5dac10b diff --git a/sites/docs/src/content/deployment/flavors-linux.md b/sites/docs/src/content/deployment/flavors-linux.md index a3ee9c2327d..6e6326e035a 100644 --- a/sites/docs/src/content/deployment/flavors-linux.md +++ b/sites/docs/src/content/deployment/flavors-linux.md @@ -1,8 +1,8 @@ --- title: Set up Flutter flavors for Linux shortTitle: Flavors (Linux) -description: > - How to create Flutter flavors for Windows and Linux desktop apps. +description: >- + How to create Flutter flavors for Linux desktop apps. --- This guide shows you how to create Flutter flavors for @@ -10,7 +10,7 @@ Linux desktop apps. :::note To create app flavors for other platforms, -visit Set up flavors for... +visit the pages on setting up flavors for: * [Android][] * [iOS and macOS][] @@ -21,63 +21,55 @@ visit Set up flavors for... A Flutter flavor represents a collection of settings that define how a specific version of your app builds and runs. -For example, a flavor can determine which window title, binary name, +For example, a flavor can determine which window title, application ID, API endpoint, asset set, and logging configuration applies to a build. -On Windows and Linux, Flutter uses [CMake][] to configure and build +On Linux, Flutter uses [CMake][] to configure and build the native desktop runner. When you run `flutter run` or `flutter build` with the `--flavor` flag, -Flutter provides the flavor name to CMake as the `FLUTTER_APP_FLAVOR` -variable and isolates the build outputs in a flavor-specific directory. +Flutter writes the flavor name into +`/flutter/ephemeral/generatd_config.cmake` as the +`FLUTTER_APP_FLAVOR` variable, and isolates the build outputs +in a flavor-specific directory. + +:::important +The `generated_config.cmake` file is included from +`/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` +only becomes visible in your top-level `CMakeLists.txt` **after** +the `add_subdirectory(${FLUTTER_MANAGED_DIR})` line. +Any `if(DEFINED FLUTTER_APP_FLAVOR)` block placed before that line +is silently skipped. +::: The following table illustrates the build directories that Flutter creates when a project defines two flavors (`staging`, `production`) and two build modes (`debug`, `release`): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PlatformFlavorBuild modeOutput directory
    Windowsstagingreleasebuild/windows/<arch>/staging/runner/Release/
    productionreleasebuild/windows/<arch>/production/runner/Release/
    Linuxstagingreleasebuild/linux/<arch>/staging/release/bundle/
    productionreleasebuild/linux/<arch>/production/release/bundle/
    +| Flavor | Build mode | Output directory | +|------------|------------|------------------| +| staging | debug | `build/linux/<arch>/staging/debug/bundle/` | +| production | debug | `build/linux/<arch>/production/debug/bundle/` | +| staging | release | `build/linux/<arch>/staging/release/bundle/` | +| production | release | `build/linux/<arch>/production/release/bundle/` | +{:.table .table-striped} [CMake]: https://cmake.org/ [Android]: /deployment/flavors [iOS and macOS]: /deployment/flavors-ios +[Windows]: /deployment/flavors-windows + +## Configure CMake for flavors [OPTIONAL] {: #configure-cmake } -## Configure CMake for flavors {: #configure-cmake } +Passing `--flavor` works on Linux without any project configuration. +Flutter isolates the build directory, populates `appFlavor`, +and filters flavor-specific assets automatically. -Complete the following steps to configure two flavors called -`staging` and `production` for a new or existing Flutter project. +Complete the following optional steps only if you want to +differentiate the **native** runner per flavor—for example its +window title, application ID, or app icon. + +This example configures two flavors called `staging` and `production`. 1. Create a new Flutter project called `flavors_example`: @@ -88,79 +80,39 @@ Complete the following steps to configure two flavors called 1. Configure the CMake build files for your target platform: - - - -Open `windows/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` line. -Update the configuration to append the flavor name to the binary name -when a flavor is specified: - -```cmake title="windows/CMakeLists.txt" -# The name of the executable created for the application. -set(BINARY_NAME "flavors_example") -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") -endif() -``` - - - -Open `linux/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` and -`set(APPLICATION_ID ...)` lines. -Update the configuration to append the flavor name to the binary name -and application ID when a flavor is specified: - -```cmake title="linux/CMakeLists.txt" -# The name of the executable created for the application. -set(BINARY_NAME "flavors_example") -# The unique GTK application identifier for this application. -set(APPLICATION_ID "com.example.flavors_example") - -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") - set(APPLICATION_ID "${APPLICATION_ID}.${FLUTTER_APP_FLAVOR}") -endif() -``` - - - - -1. Verify that your flavors run correctly: - - - - -Run the `staging` flavor: - -```console title="console" -$ flutter run -d windows --flavor staging -``` - -Run the `production` flavor: - -```console title="console" -$ flutter run -d windows --flavor production -``` - - + Open `linux/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` and + `set(APPLICATION_ID ...)` lines. + Update the configuration to append the flavor name to the binary name + and application ID when a flavor is specified: + + ```cmake title="linux/CMakeLists.txt" + # The name of the executable created for the application. + set(BINARY_NAME "flavors_example") + # The unique GTK application identifier for this application. + set(APPLICATION_ID "com.example.flavors_example") + + if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") + set(APPLICATION_ID "${APPLICATION_ID}.${FLUTTER_APP_FLAVOR}") + endif() + ``` -Run the `staging` flavor: +3. Verify that your flavors run correctly: -```console title="console" -$ flutter run -d linux --flavor staging -``` + Run the `staging` flavor: -Run the `production` flavor: + ```console title="console" + $ flutter run -d linux --flavor staging + ``` -```console title="console" -$ flutter run -d linux --flavor production -``` - - + Run the `production` flavor: + ```console title="console" + $ flutter run -d linux --flavor production + ``` ## Launch a flavor {: #launch-a-flavor } -After you configure flavors for your Windows or Linux app, +After you configure flavors for your app, launch or build a specific flavor using the `--flavor` flag with the Flutter CLI. @@ -169,15 +121,6 @@ with the Flutter CLI. To run a specific flavor during development, pass the `--flavor` option to `flutter run`: - - - -```console title="console" -$ flutter run -d windows --flavor -``` - - - ```console title="console" $ flutter run -d linux --flavor ``` @@ -185,27 +128,11 @@ $ flutter run -d linux --flavor Replace `` with the name of your flavor (for example, `staging` or `production`). - - - ### Build a release binary {: #build-a-flavor } To build a release executable for a specific flavor, pass the `--flavor` option to `flutter build`: - - - -```console title="console" -$ flutter build windows --flavor -``` - -Flutter outputs the compiled executable to -`build/windows///runner/Release/`. - - - - ```console title="console" $ flutter build linux --flavor ``` @@ -213,9 +140,6 @@ $ flutter build linux --flavor Flutter outputs the compiled bundle to `build/linux///release/bundle/`. - - - ## Use flavors in Flutter code {: #use-flavors-in-code } After you configure your flavors, @@ -267,100 +191,40 @@ you can customize native settings and assets for each configuration. To help distinguish between different flavors at runtime, you can customize the native window title for each flavor. - - - -1. Open `windows/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` - as a preprocessor definition: - -```cmake title="windows/runner/CMakeLists.txt" -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") -endif() -``` - -1. Open `windows/runner/main.cpp` and update the window title - to include the flavor name when defined: - -```cpp title="windows/runner/main.cpp" -#if defined(FLUTTER_APP_FLAVOR) - std::wstring title = L"flavors_example (" + std::wstring(L"" FLUTTER_APP_FLAVOR) + L")"; - if (!window.Create(title.c_str(), origin, size)) { - return EXIT_FAILURE; - } - #else - if (!window.Create(L"flavors_example", origin, size)) { - return EXIT_FAILURE; - } - #endif -``` - - - - 1. Open `linux/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` as a preprocessor definition: -```cmake title="linux/runner/CMakeLists.txt" -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") -endif() -``` + ```cmake title="linux/runner/CMakeLists.txt" + if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") + endif() + ``` -1. Open `linux/runner/my_application.cc` and update the window title +2. Open `linux/runner/my_application.cc` and update the window title in the `my_application_activate` function: -```c title="linux/runner/my_application.cc" -#if defined(FLUTTER_APP_FLAVOR) - const char* title = "flavors_example (" FLUTTER_APP_FLAVOR ")"; -#else - const char* title = "flavors_example"; -#endif - -if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, title); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); -} else { - gtk_window_set_title(window, title); -} -``` - - - + ```c title="linux/runner/my_application.cc" + #if defined(FLUTTER_APP_FLAVOR) + const char* title = "flavors_example (" FLUTTER_APP_FLAVOR ")"; + #else + const char* title = "flavors_example"; + #endif + + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, title); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, title); + } + ``` ### Create distinct app icons {: #create-distinct-app-icons } You can provide unique icons for each flavor. - - - -1. Prepare your icon files in `.ico` format - (for example, `app_icon_staging.ico` and `app_icon_production.ico`) - and place them in `windows/runner/resources/`. - -1. In `windows/CMakeLists.txt`, select the appropriate icon file - based on `FLUTTER_APP_FLAVOR`: - -```cmake title="windows/CMakeLists.txt" -if(FLUTTER_APP_FLAVOR STREQUAL "staging") - set(APP_ICON_NAME "app_icon_staging.ico") -elseif(FLUTTER_APP_FLAVOR STREQUAL "production") - set(APP_ICON_NAME "app_icon_production.ico") -else() - set(APP_ICON_NAME "app_icon.ico") -endif() -``` - -1. Configure `windows/runner/Runner.rc` or your CMake target - to use `APP_ICON_NAME` for the application icon resource. - - - - 1. Prepare PNG icons for each flavor (for example, `app_icon_staging.png` and `app_icon_production.png`). @@ -372,9 +236,6 @@ endif() 1. Update `linux/CMakeLists.txt` to install the correct `.desktop` file and icon based on `FLUTTER_APP_FLAVOR`. - - - ### Bundle assets by flavor {: #bundle-assets } If you have assets that only apply to a specific flavor, @@ -424,8 +285,11 @@ consult the following resources: * [Set up Flutter flavors for Android][] * [Set up Flutter flavors for iOS and macOS][] -* [Build and release a Windows desktop app][] +* [Set up Flutter flavors for Windows][] * [Build and release a Linux app to the Snap Store][] -[Build and release a Windows desktop app]: /deployment/windows [Build and release a Linux app to the Snap Store]: /deployment/linux +[Set up Flutter flavors for Android]: /deployment/flavors +[Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios +[Set up Flutter flavors for Windows]: /deployment/flavors-windows + diff --git a/sites/docs/src/content/deployment/flavors-windows.md b/sites/docs/src/content/deployment/flavors-windows.md index 0232a99653b..2ff1f52c1ba 100644 --- a/sites/docs/src/content/deployment/flavors-windows.md +++ b/sites/docs/src/content/deployment/flavors-windows.md @@ -1,81 +1,74 @@ --- -title: Set up Flutter flavors for Windows and Linux -shortTitle: Flavors (Windows and Linux) -description: > - How to create Flutter flavors for Windows and Linux desktop apps. +title: Set up Flutter flavors for Windows +shortTitle: Flavors (Windows) +description: >- + How to create Flutter flavors for Windows desktop apps. --- This guide shows you how to create Flutter flavors for -Windows and Linux desktop apps. +Windows desktop apps. :::note -To create flavors for Android apps, -see [Set up Flutter flavors for Android][]. -To create flavors for iOS and macOS apps, -see [Set up Flutter flavors for iOS and macOS][]. +To create app flavors for other platforms, +visit the pages on setting up flavors for: + +* [Android][] +* [iOS and macOS][] +* [Linux][] ::: ## Overview {: #overview } A Flutter flavor represents a collection of settings that define how a specific version of your app builds and runs. -For example, a flavor can determine which window title, binary name, +For example, a flavor can determine which window title, application ID, API endpoint, asset set, and logging configuration applies to a build. -On Windows and Linux, Flutter uses [CMake][] to configure and build +On Windows, Flutter uses [CMake][] to configure and build the native desktop runner. When you run `flutter run` or `flutter build` with the `--flavor` flag, -Flutter provides the flavor name to CMake as the `FLUTTER_APP_FLAVOR` -variable and isolates the build outputs in a flavor-specific directory. +Flutter writes the flavor name into +`/flutter/ephemeral/generatd_config.cmake` as the +`FLUTTER_APP_FLAVOR` variable, and isolates the build outputs +in a flavor-specific directory. + +:::important +The `generated_config.cmake` file is included from +`/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` +only becomes visible in your top-level `CMakeLists.txt` **after** +the `add_subdirectory(${FLUTTER_MANAGED_DIR})` line. +Any `if(DEFINED FLUTTER_APP_FLAVOR)` block placed before that line +is silently skipped. +::: The following table illustrates the build directories that Flutter creates when a project defines two flavors (`staging`, `production`) -and two build modes (`debug`, `release`): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PlatformFlavorBuild modeOutput directory
    Windowsstagingreleasebuild/windows/<arch>/staging/runner/Release/
    productionreleasebuild/windows/<arch>/production/runner/Release/
    Linuxstagingreleasebuild/linux/<arch>/staging/release/bundle/
    productionreleasebuild/linux/<arch>/production/release/bundle/
    + +| Flavor | Build mode | Output directory | +|------------|-------------|---------------------------------------------------------| +| staging | debug | `build/windows/<arch>/staging/runner/Debug/` | +| production | debug | `build/windows/<arch>/production/runner/Debug/` | +| staging | release | `build/windows/<arch>/staging/runner/Release/` | +| production | release | `build/windows/<arch>/production/runner/Release/` | +{:.table .table-striped} [CMake]: https://cmake.org/ -[Set up Flutter flavors for Android]: /deployment/flavors -[Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios +[Android]: /deployment/flavors +[iOS and macOS]: /deployment/flavors-ios +[Linux]: /deployment/flavors-linux + +## Configure CMake for flavors [OPTIONAL] {: #configure-cmake } -## Configure CMake for flavors {: #configure-cmake } +Passing `--flavor` works on Windows without any project configuration. +Flutter isolates the build directory, populates `appFlavor`, +and filters flavor-specific assets automatically. -Complete the following steps to configure two flavors called -`staging` and `production` for a new or existing Flutter project. +Complete the following optional steps only if you want to +differentiate the **native** runner per flavor—for example, +its window title, application ID, or app icon. + +This example configures two flavors called `staging` and `production`. 1. Create a new Flutter project called `flavors_example`: @@ -86,79 +79,35 @@ Complete the following steps to configure two flavors called 1. Configure the CMake build files for your target platform: - - - -Open `windows/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` line. -Update the configuration to append the flavor name to the binary name -when a flavor is specified: - -```cmake title="windows/CMakeLists.txt" -# The name of the executable created for the application. -set(BINARY_NAME "flavors_example") -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") -endif() -``` - - - -Open `linux/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` and -`set(APPLICATION_ID ...)` lines. -Update the configuration to append the flavor name to the binary name -and application ID when a flavor is specified: - -```cmake title="linux/CMakeLists.txt" -# The name of the executable created for the application. -set(BINARY_NAME "flavors_example") -# The unique GTK application identifier for this application. -set(APPLICATION_ID "com.example.flavors_example") - -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") - set(APPLICATION_ID "${APPLICATION_ID}.${FLUTTER_APP_FLAVOR}") -endif() -``` - - - - -1. Verify that your flavors run correctly: - - - - -Run the `staging` flavor: - -```console title="console" -$ flutter run -d windows --flavor staging -``` + Open `windows/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` line. + Update the configuration to append the flavor name to the binary name + when a flavor is specified: -Run the `production` flavor: + ```cmake title="windows/CMakeLists.txt" + # The name of the executable created for the application. + set(BINARY_NAME "flavors_example") + if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") + endif() + ``` -```console title="console" -$ flutter run -d windows --flavor production -``` - - +3. Verify that your flavors run correctly: -Run the `staging` flavor: + Run the `staging` flavor: -```console title="console" -$ flutter run -d linux --flavor staging -``` + ```console title="console" + $ flutter run -d windows --flavor staging + ``` -Run the `production` flavor: + Run the `production` flavor: -```console title="console" -$ flutter run -d linux --flavor production -``` - - + ```console title="console" + $ flutter run -d windows --flavor production + ``` ## Launch a flavor {: #launch-a-flavor } -After you configure flavors for your Windows or Linux app, +After you configure flavors for your app, launch or build a specific flavor using the `--flavor` flag with the Flutter CLI. @@ -167,33 +116,15 @@ with the Flutter CLI. To run a specific flavor during development, pass the `--flavor` option to `flutter run`: - - - ```console title="console" $ flutter run -d windows --flavor ``` - - - -```console title="console" -$ flutter run -d linux --flavor -``` - -Replace `` with the name of your flavor -(for example, `staging` or `production`). - - - ### Build a release binary {: #build-a-flavor } To build a release executable for a specific flavor, pass the `--flavor` option to `flutter build`: - - - ```console title="console" $ flutter build windows --flavor ``` @@ -201,19 +132,6 @@ $ flutter build windows --flavor Flutter outputs the compiled executable to `build/windows///runner/Release/`. - - - -```console title="console" -$ flutter build linux --flavor -``` - -Flutter outputs the compiled bundle to -`build/linux///release/bundle/`. - - - - ## Use flavors in Flutter code {: #use-flavors-in-code } After you configure your flavors, @@ -252,7 +170,8 @@ during `flutter run` or `flutter build`. :::note The value of `appFlavor` matches the string passed to the `--flavor` flag. If you run or build without specifying a flavor, - `appFlavor` returns `null`. + `appFlavor` returns `null` and the build uses the + [default flavor](#set-default-flavor). ::: ## Customize configurations {: #customize-configurations } @@ -265,77 +184,35 @@ you can customize native settings and assets for each configuration. To help distinguish between different flavors at runtime, you can customize the native window title for each flavor. - - - 1. Open `windows/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` as a preprocessor definition: -```cmake title="windows/runner/CMakeLists.txt" -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") -endif() -``` + ```cmake title="windows/runner/CMakeLists.txt" + if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") + target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") + endif() + ``` -1. Open `windows/runner/main.cpp` and update the window title +2. Open `windows/runner/main.cpp` and update the window title to include the flavor name when defined: -```cpp title="windows/runner/main.cpp" -#if defined(FLUTTER_APP_FLAVOR) - std::wstring title = L"flavors_example (" + std::wstring(L"" FLUTTER_APP_FLAVOR) + L")"; - if (!window.Create(title.c_str(), origin, size)) { - return EXIT_FAILURE; - } - #else - if (!window.Create(L"flavors_example", origin, size)) { - return EXIT_FAILURE; - } - #endif -``` - - - - -1. Open `linux/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` - as a preprocessor definition: - -```cmake title="linux/runner/CMakeLists.txt" -if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") -endif() -``` - -1. Open `linux/runner/my_application.cc` and update the window title - in the `my_application_activate` function: - -```c title="linux/runner/my_application.cc" -#if defined(FLUTTER_APP_FLAVOR) - const char* title = "flavors_example (" FLUTTER_APP_FLAVOR ")"; -#else - const char* title = "flavors_example"; -#endif - -if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, title); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); -} else { - gtk_window_set_title(window, title); -} -``` - - - + ```cpp title="windows/runner/main.cpp" + #if defined(FLUTTER_APP_FLAVOR) + std::wstring title = L"flavors_example (" + std::wstring(L"" FLUTTER_APP_FLAVOR) + L")"; + if (!window.Create(title.c_str(), origin, size)) { + return EXIT_FAILURE; + } + #else + if (!window.Create(L"flavors_example", origin, size)) { + return EXIT_FAILURE; + } + #endif + ``` ### Create distinct app icons {: #create-distinct-app-icons } You can provide unique icons for each flavor. - - - 1. Prepare your icon files in `.ico` format (for example, `app_icon_staging.ico` and `app_icon_production.ico`) and place them in `windows/runner/resources/`. @@ -343,36 +220,19 @@ You can provide unique icons for each flavor. 1. In `windows/CMakeLists.txt`, select the appropriate icon file based on `FLUTTER_APP_FLAVOR`: -```cmake title="windows/CMakeLists.txt" -if(FLUTTER_APP_FLAVOR STREQUAL "staging") - set(APP_ICON_NAME "app_icon_staging.ico") -elseif(FLUTTER_APP_FLAVOR STREQUAL "production") - set(APP_ICON_NAME "app_icon_production.ico") -else() - set(APP_ICON_NAME "app_icon.ico") -endif() -``` + ```cmake title="windows/CMakeLists.txt" + if(FLUTTER_APP_FLAVOR STREQUAL "staging") + set(APP_ICON_NAME "app_icon_staging.ico") + elseif(FLUTTER_APP_FLAVOR STREQUAL "production") + set(APP_ICON_NAME "app_icon_production.ico") + else() + set(APP_ICON_NAME "app_icon.ico") + endif() + ``` -1. Configure `windows/runner/Runner.rc` or your CMake target +3. Configure `windows/runner/Runner.rc` or your CMake target to use `APP_ICON_NAME` for the application icon resource. - - - -1. Prepare PNG icons for each flavor - (for example, `app_icon_staging.png` and `app_icon_production.png`). - -1. Create corresponding `.desktop` files for each flavor - (for example, `flavors_example_staging.desktop` and - `flavors_example_production.desktop`) - that reference the respective icon and executable binary name. - -1. Update `linux/CMakeLists.txt` to install the correct `.desktop` file - and icon based on `FLUTTER_APP_FLAVOR`. - - - - ### Bundle assets by flavor {: #bundle-assets } If you have assets that only apply to a specific flavor, @@ -420,10 +280,9 @@ To learn more, see the [`default-flavor` field][] in For more information on flavors and desktop deployment, consult the following resources: -* [Set up Flutter flavors for Android][] -* [Set up Flutter flavors for iOS and macOS][] +* [Set up Flutter flavors for Android][Android] +* [Set up Flutter flavors for iOS and macOS][iOS and macOS] +* [Set up Flutter flavors for Linux][Linux] * [Build and release a Windows desktop app][] -* [Build and release a Linux app to the Snap Store][] [Build and release a Windows desktop app]: /deployment/windows -[Build and release a Linux app to the Snap Store]: /deployment/linux diff --git a/sites/docs/src/content/deployment/flavors.md b/sites/docs/src/content/deployment/flavors.md index faaca9908f9..ec968ddeae2 100644 --- a/sites/docs/src/content/deployment/flavors.md +++ b/sites/docs/src/content/deployment/flavors.md @@ -403,11 +403,13 @@ For more information on creating and using flavors, check out the following resources: * [Set up Flutter flavors for iOS and macOS][] -* [Set up Flutter flavors for Windows and Linux][] +* [Set up Flutter flavors for Linux][] +* [Set up Flutter flavors for Windows][] * [Build flavors in Flutter (Android and iOS) with Firebase][] * [How to Setup Flutter & Firebase with Multiple Flavors using the FlutterFire CLI][flutterfireCLI] [Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios -[Set up Flutter flavors for Windows and Linux]: /deployment/flavors-windows-linux +[Set up Flutter flavors for Linux]: /deployment/flavors-linux +[Set up Flutter flavors for Windows]: /deployment/flavors-windows [Build flavors in Flutter (Android and iOS) with Firebase]: https://medium.com/@animeshjain/build-flavors-in-flutter-android-and-ios-with-different-firebase-projects-per-flavor-27c5c5dac10b [flutterfireCLI]: https://codewithandrea.com/articles/flutter-firebase-multiple-flavors-flutterfire-cli/ diff --git a/sites/docs/src/data/sidenav/default.yml b/sites/docs/src/data/sidenav/default.yml index 46ed21c7071..15255c1e822 100644 --- a/sites/docs/src/data/sidenav/default.yml +++ b/sites/docs/src/data/sidenav/default.yml @@ -581,8 +581,10 @@ permalink: /deployment/flavors - title: Create app flavors for iOS and macOS permalink: /deployment/flavors-ios - - title: Create app flavors for Windows and Linux - permalink: /deployment/flavors-windows-linux + - title: Create app flavors for Linux + permalink: /deployment/flavors-linux + - title: Create app flavors for Windows + permalink: /deployment/flavors-windows - title: Build and release an Android app permalink: /deployment/android - title: Build and release an iOS app From c53b50ca9a12271356002a468a92d0d1078ef3aa Mon Sep 17 00:00:00 2001 From: "Shams Zakhour (ignore Sfshaza)" Date: Thu, 27 Aug 2026 17:49:40 -0700 Subject: [PATCH 4/4] Incorporating feedback --- .../src/content/deployment/flavors-linux.md | 167 ++++++++------ .../src/content/deployment/flavors-windows.md | 203 +++++++++++------- .../platform-integration/linux/setup.md | 2 +- .../platform-integration/windows/setup.md | 2 +- 4 files changed, 225 insertions(+), 149 deletions(-) diff --git a/sites/docs/src/content/deployment/flavors-linux.md b/sites/docs/src/content/deployment/flavors-linux.md index 6e6326e035a..f7b794dc732 100644 --- a/sites/docs/src/content/deployment/flavors-linux.md +++ b/sites/docs/src/content/deployment/flavors-linux.md @@ -29,13 +29,13 @@ On Linux, Flutter uses [CMake][] to configure and build the native desktop runner. When you run `flutter run` or `flutter build` with the `--flavor` flag, Flutter writes the flavor name into -`/flutter/ephemeral/generatd_config.cmake` as the +`linux/flutter/ephemeral/generated_config.cmake` as the `FLUTTER_APP_FLAVOR` variable, and isolates the build outputs in a flavor-specific directory. :::important The `generated_config.cmake` file is included from -`/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` +`linux/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` only becomes visible in your top-level `CMakeLists.txt` **after** the `add_subdirectory(${FLUTTER_MANAGED_DIR})` line. Any `if(DEFINED FLUTTER_APP_FLAVOR)` block placed before that line @@ -46,12 +46,12 @@ The following table illustrates the build directories that Flutter creates when a project defines two flavors (`staging`, `production`) and two build modes (`debug`, `release`): -| Flavor | Build mode | Output directory | -|------------|------------|------------------| -| staging | debug | `build/linux/<arch>/staging/debug/bundle/` | -| production | debug | `build/linux/<arch>/production/debug/bundle/` | -| staging | release | `build/linux/<arch>/staging/release/bundle/` | -| production | release | `build/linux/<arch>/production/release/bundle/` | +| Flavor | Build mode | Output directory | +|------------|------------|------------------------------------------------------| +| staging | debug | `build/linux//staging/debug/bundle/` | +| production | debug | `build/linux//production/debug/bundle/` | +| staging | release | `build/linux//staging/release/bundle/` | +| production | release | `build/linux//production/release/bundle/` | {:.table .table-striped} [CMake]: https://cmake.org/ @@ -59,16 +59,17 @@ and two build modes (`debug`, `release`): [iOS and macOS]: /deployment/flavors-ios [Windows]: /deployment/flavors-windows -## Configure CMake for flavors [OPTIONAL] {: #configure-cmake } +## Configure CMake for flavors (optional) {: #configure-cmake } Passing `--flavor` works on Linux without any project configuration. -Flutter isolates the build directory, populates `appFlavor`, -and filters flavor-specific assets automatically. +Existing Flutter projects support flavors with no template updates +or configuration changes required. +When you pass `--flavor`, Flutter isolates the build directory, +populates `appFlavor`, and filters flavor-specific assets automatically. Complete the following optional steps only if you want to -differentiate the **native** runner per flavor—for example its -window title, application ID, or app icon. - +differentiate the native runner per flavor—for example, +its GTK application ID or window title. This example configures two flavors called `staging` and `production`. 1. Create a new Flutter project called `flavors_example`: @@ -78,26 +79,39 @@ This example configures two flavors called `staging` and `production`. $ cd flavors_example ``` -1. Configure the CMake build files for your target platform: +1. Configure flavor-specific application IDs in `linux/CMakeLists.txt`: - Open `linux/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` and - `set(APPLICATION_ID ...)` lines. - Update the configuration to append the flavor name to the binary name - and application ID when a flavor is specified: + Open `linux/CMakeLists.txt` and find the + `add_subdirectory(${FLUTTER_MANAGED_DIR})` line. + Set the `APPLICATION_ID` per flavor immediately after that line: ```cmake title="linux/CMakeLists.txt" - # The name of the executable created for the application. - set(BINARY_NAME "flavors_example") - # The unique GTK application identifier for this application. - set(APPLICATION_ID "com.example.flavors_example") - - if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") - set(APPLICATION_ID "${APPLICATION_ID}.${FLUTTER_APP_FLAVOR}") + # Flutter library and tool build rules. + set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + add_subdirectory(${FLUTTER_MANAGED_DIR}) + + if(DEFINED FLUTTER_APP_FLAVOR) + if(FLUTTER_APP_FLAVOR STREQUAL "staging") + set(APPLICATION_ID "com.example.staging") + elseif(FLUTTER_APP_FLAVOR STREQUAL "production") + set(APPLICATION_ID "com.example.production") + endif() endif() ``` -3. Verify that your flavors run correctly: + `APPLICATION_ID` must be configured after + `add_subdirectory(${FLUTTER_MANAGED_DIR})` because + `FLUTTER_APP_FLAVOR` only becomes available at this point, + and before `add_subdirectory("runner")` where `APPLICATION_ID` is consumed. + + :::important + Leave `set(BINARY_NAME ...)` unchanged. + The Flutter CLI resolves the executable path by parsing that line literally, + so renaming the binary per flavor prevents `flutter run` + from launching the app. + ::: + +1. Verify that your flavors run correctly: Run the `staging` flavor: @@ -110,10 +124,11 @@ This example configures two flavors called `staging` and `production`. ```console title="console" $ flutter run -d linux --flavor production ``` + ## Launch a flavor {: #launch-a-flavor } After you configure flavors for your app, -launch or build a specific flavor using the `--flavor` flag +run, build, or test a specific flavor using the `--flavor` flag with the Flutter CLI. ### Run a flavor in debug mode {: #run-a-flavor } @@ -140,9 +155,19 @@ $ flutter build linux --flavor Flutter outputs the compiled bundle to `build/linux///release/bundle/`. +### Run tests with a flavor {: #test-a-flavor } + +The `--flavor` option also works with `flutter test` and `flutter drive`, +allowing you to run unit, widget, or integration tests +against a specific flavor configuration: + +```console title="console" +$ flutter test --flavor +``` + ## Use flavors in Flutter code {: #use-flavors-in-code } -After you configure your flavors, +After adding flavors, you can adjust app behavior—such as selecting API endpoints, toggling features, or setting analytics keys—based on the active flavor. @@ -178,7 +203,8 @@ during `flutter run` or `flutter build`. :::note The value of `appFlavor` matches the string passed to the `--flavor` flag. If you run or build without specifying a flavor, - `appFlavor` returns `null`. + `appFlavor` returns `null` and the build uses the + [default flavor](#set-default-flavor). ::: ## Customize configurations {: #customize-configurations } @@ -189,52 +215,56 @@ you can customize native settings and assets for each configuration. ### Create distinct window titles {: #create-distinct-window-titles } To help distinguish between different flavors at runtime, -you can customize the native window title for each flavor. +customize the native window title for each flavor. -1. Open `linux/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` - as a preprocessor definition: +1. In `linux/runner/CMakeLists.txt`, pass `FLUTTER_APP_FLAVOR` + as a preprocessor definition directly after the existing + `APPLICATION_ID` definition: ```cmake title="linux/runner/CMakeLists.txt" + # Add preprocessor definitions for the application ID. + add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") + add_definitions(-DFLUTTER_APP_FLAVOR="${FLUTTER_APP_FLAVOR}") endif() ``` -2. Open `linux/runner/my_application.cc` and update the window title - in the `my_application_activate` function: +1. In `linux/runner/my_application.cc`, update the window title + in the `my_application_activate` function: ```c title="linux/runner/my_application.cc" - #if defined(FLUTTER_APP_FLAVOR) - const char* title = "flavors_example (" FLUTTER_APP_FLAVOR ")"; - #else - const char* title = "flavors_example"; + const gchar* window_title = "flavors_example"; + #ifdef FLUTTER_APP_FLAVOR + if (g_strcmp0(FLUTTER_APP_FLAVOR, "staging") == 0) { + window_title = "Staging App"; + } else if (g_strcmp0(FLUTTER_APP_FLAVOR, "production") == 0) { + window_title = "Production App"; + } #endif - - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, title); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, title); - } ``` -### Create distinct app icons {: #create-distinct-app-icons } + Then update `my_application_activate` to use `window_title` + instead of the hardcoded string literals: -You can provide unique icons for each flavor. + ```c title="linux/runner/my_application.cc" + gtk_header_bar_set_title(header_bar, window_title); + ... + gtk_window_set_title(window, window_title); + ``` -1. Prepare PNG icons for each flavor - (for example, `app_icon_staging.png` and `app_icon_production.png`). +### Configure app icons {: #configure-app-icons } -1. Create corresponding `.desktop` files for each flavor - (for example, `flavors_example_staging.desktop` and - `flavors_example_production.desktop`) - that reference the respective icon and executable binary name. +On Linux, application icons are not embedded directly in the compiled +executable binary. +Instead, the desktop environment resolves app icons through +`.desktop` launcher files and installed icon themes. -1. Update `linux/CMakeLists.txt` to install the correct `.desktop` file - and icon based on `FLUTTER_APP_FLAVOR`. +To provide different icons or launcher entries for each flavor, +configure your Linux package format—such as Snap, Flatpak, or Debian +packages—to install distinct desktop entries and icon assets. +To learn more about packaging Linux apps, refer to +[Build and release a Linux desktop app][]. ### Bundle assets by flavor {: #bundle-assets } @@ -257,7 +287,7 @@ flutter: - production ``` -To learn more, see the [`assets` field][] in [Flutter pubspec options][]. +To learn more, consult the [`assets` field][] in [Flutter pubspec options][]. [`assets` field]: /tools/pubspec#assets [Flutter pubspec options]: /tools/pubspec @@ -273,7 +303,7 @@ flutter: default-flavor: staging ``` -To learn more, see the [`default-flavor` field][] in +To learn more, consult the [`default-flavor` field][] in [Flutter pubspec options][]. [`default-flavor` field]: /tools/pubspec#default-flavor-field @@ -283,13 +313,12 @@ To learn more, see the [`default-flavor` field][] in For more information on flavors and desktop deployment, consult the following resources: -* [Set up Flutter flavors for Android][] -* [Set up Flutter flavors for iOS and macOS][] -* [Set up Flutter flavors for Windows][] -* [Build and release a Linux app to the Snap Store][] +* [Set up Flutter flavors for Android][Android] +* [Set up Flutter flavors for iOS and macOS][iOS and macOS] +* [Set up Flutter flavors for Windows][Windows] +* [Build and release a Linux desktop app][] -[Build and release a Linux app to the Snap Store]: /deployment/linux +[Build and release a Linux desktop app]: /deployment/linux [Set up Flutter flavors for Android]: /deployment/flavors [Set up Flutter flavors for iOS and macOS]: /deployment/flavors-ios [Set up Flutter flavors for Windows]: /deployment/flavors-windows - diff --git a/sites/docs/src/content/deployment/flavors-windows.md b/sites/docs/src/content/deployment/flavors-windows.md index 2ff1f52c1ba..09044cdc0fb 100644 --- a/sites/docs/src/content/deployment/flavors-windows.md +++ b/sites/docs/src/content/deployment/flavors-windows.md @@ -22,20 +22,20 @@ visit the pages on setting up flavors for: A Flutter flavor represents a collection of settings that define how a specific version of your app builds and runs. For example, a flavor can determine which window title, -application ID, API endpoint, asset set, and logging configuration +application icon, API endpoint, asset set, and logging configuration applies to a build. On Windows, Flutter uses [CMake][] to configure and build the native desktop runner. When you run `flutter run` or `flutter build` with the `--flavor` flag, Flutter writes the flavor name into -`/flutter/ephemeral/generatd_config.cmake` as the +`windows/flutter/ephemeral/generated_config.cmake` as the `FLUTTER_APP_FLAVOR` variable, and isolates the build outputs in a flavor-specific directory. :::important The `generated_config.cmake` file is included from -`/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` +`windows/flutter/CMakeLists.txt`, so `FLUTTER_APP_FLAVOR` only becomes visible in your top-level `CMakeLists.txt` **after** the `add_subdirectory(${FLUTTER_MANAGED_DIR})` line. Any `if(DEFINED FLUTTER_APP_FLAVOR)` block placed before that line @@ -44,13 +44,14 @@ is silently skipped. The following table illustrates the build directories that Flutter creates when a project defines two flavors (`staging`, `production`) - -| Flavor | Build mode | Output directory | -|------------|-------------|---------------------------------------------------------| -| staging | debug | `build/windows/<arch>/staging/runner/Debug/` | -| production | debug | `build/windows/<arch>/production/runner/Debug/` | -| staging | release | `build/windows/<arch>/staging/runner/Release/` | -| production | release | `build/windows/<arch>/production/runner/Release/` | +and two build modes (`debug`, `release`): + +| Flavor | Build mode | Output directory | +|------------|------------|---------------------------------------------------------| +| staging | debug | `build/windows//staging/runner/Debug/` | +| production | debug | `build/windows//production/runner/Debug/` | +| staging | release | `build/windows//staging/runner/Release/` | +| production | release | `build/windows//production/runner/Release/` | {:.table .table-striped} [CMake]: https://cmake.org/ @@ -58,17 +59,16 @@ when a project defines two flavors (`staging`, `production`) [iOS and macOS]: /deployment/flavors-ios [Linux]: /deployment/flavors-linux -## Configure CMake for flavors [OPTIONAL] {: #configure-cmake } - -Passing `--flavor` works on Windows without any project configuration. -Flutter isolates the build directory, populates `appFlavor`, -and filters flavor-specific assets automatically. +## Create and run flavors {: #create-and-run-flavors } -Complete the following optional steps only if you want to -differentiate the **native** runner per flavor—for example, -its window title, application ID, or app icon. +Passing `--flavor` works on Windows without any CMake configuration. +Existing Flutter projects support flavors with no template updates +or configuration changes required. +When you pass `--flavor`, Flutter isolates the build directory, +populates `appFlavor`, and filters flavor-specific assets automatically. -This example configures two flavors called `staging` and `production`. +To try flavors with a sample project, +complete the following steps: 1. Create a new Flutter project called `flavors_example`: @@ -77,21 +77,7 @@ This example configures two flavors called `staging` and `production`. $ cd flavors_example ``` -1. Configure the CMake build files for your target platform: - - Open `windows/CMakeLists.txt` and locate the `set(BINARY_NAME ...)` line. - Update the configuration to append the flavor name to the binary name - when a flavor is specified: - - ```cmake title="windows/CMakeLists.txt" - # The name of the executable created for the application. - set(BINARY_NAME "flavors_example") - if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - set(BINARY_NAME "${BINARY_NAME}_${FLUTTER_APP_FLAVOR}") - endif() - ``` - -3. Verify that your flavors run correctly: +1. Verify that your flavors run correctly: Run the `staging` flavor: @@ -105,10 +91,14 @@ This example configures two flavors called `staging` and `production`. $ flutter run -d windows --flavor production ``` +To customize native runner settings for each flavor—such as +the window title or application icon—refer to +[Customize configurations](#customize-configurations). + ## Launch a flavor {: #launch-a-flavor } -After you configure flavors for your app, -launch or build a specific flavor using the `--flavor` flag +After you define flavors for your app, +run, build, or test a specific flavor using the `--flavor` flag with the Flutter CLI. ### Run a flavor in debug mode {: #run-a-flavor } @@ -120,6 +110,9 @@ pass the `--flavor` option to `flutter run`: $ flutter run -d windows --flavor ``` +Replace `` with the name of your flavor +(for example, `staging` or `production`). + ### Build a release binary {: #build-a-flavor } To build a release executable for a specific flavor, @@ -132,9 +125,19 @@ $ flutter build windows --flavor Flutter outputs the compiled executable to `build/windows///runner/Release/`. +### Run tests with a flavor {: #test-a-flavor } + +The `--flavor` option also works with `flutter test` and `flutter drive`, +allowing you to run unit, widget, or integration tests +against a specific flavor configuration: + +```console title="console" +$ flutter test --flavor +``` + ## Use flavors in Flutter code {: #use-flavors-in-code } -After you configure your flavors, +After adding flavors, you can adjust app behavior—such as selecting API endpoints, toggling features, or setting analytics keys—based on the active flavor. @@ -176,62 +179,106 @@ during `flutter run` or `flutter build`. ## Customize configurations {: #customize-configurations } -After adding flavors, -you can customize native settings and assets for each configuration. +To differentiate the native Windows runner per flavor—such as +giving each flavor a unique window title or application icon—configure +CMake to generate the runner source and resource files +using `configure_file`. + +### Configure CMake for native settings {: #configure-cmake-native } + +CMake evaluates `windows/runner/CMakeLists.txt` after `FLUTTER_APP_FLAVOR` +is defined. +You can inspect this variable to configure flavor-specific values, +then use `configure_file` to substitute them into template files +for the C++ runner (`main.cpp`) and the Windows resource script (`Runner.rc`). + +In `windows/runner/CMakeLists.txt`, add the following block +before the `add_executable(${BINARY_NAME} ...)` line: + +```cmake title="windows/runner/CMakeLists.txt" +# Configure flavor-specific settings. +if(DEFINED FLUTTER_APP_FLAVOR) + if(FLUTTER_APP_FLAVOR STREQUAL "staging") + set(RUNNER_APP_ICON "staging.ico") + set(WINDOW_TITLE "Staging App") + elseif(FLUTTER_APP_FLAVOR STREQUAL "production") + set(RUNNER_APP_ICON "production.ico") + set(WINDOW_TITLE "Production App") + endif() +else() + set(RUNNER_APP_ICON "app_icon.ico") + set(WINDOW_TITLE "${BINARY_NAME}") +endif() + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in" + "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/Runner.rc.in" + "${CMAKE_CURRENT_SOURCE_DIR}/Runner.rc" + @ONLY +) +``` -### Create distinct window titles {: #create-distinct-window-titles } +:::note +Because `configure_file` generates `main.cpp` and `Runner.rc` +in the source directory at build time, +add both generated files to your project's `.gitignore`: -To help distinguish between different flavors at runtime, -you can customize the native window title for each flavor. +```gitignore title=".gitignore" +windows/runner/main.cpp +windows/runner/Runner.rc +``` -1. Open `windows/runner/CMakeLists.txt` and pass `FLUTTER_APP_FLAVOR` - as a preprocessor definition: +Commit the `.in` template files to version control instead. +::: - ```cmake title="windows/runner/CMakeLists.txt" - if(DEFINED FLUTTER_APP_FLAVOR AND NOT FLUTTER_APP_FLAVOR STREQUAL "") - target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_APP_FLAVOR=\"${FLUTTER_APP_FLAVOR}\"") - endif() - ``` +### Create distinct window titles {: #create-distinct-window-titles } + +To display a flavor-specific window title when the app launches: -2. Open `windows/runner/main.cpp` and update the window title - to include the flavor name when defined: +1. Rename `windows/runner/main.cpp` to `windows/runner/main.cpp.in`. - ```cpp title="windows/runner/main.cpp" - #if defined(FLUTTER_APP_FLAVOR) - std::wstring title = L"flavors_example (" + std::wstring(L"" FLUTTER_APP_FLAVOR) + L")"; - if (!window.Create(title.c_str(), origin, size)) { +1. In `windows/runner/main.cpp.in`, find where `window.Create` is called + and replace the hardcoded title with `@WINDOW_TITLE@`: + + ```cpp title="windows/runner/main.cpp.in" + if (!window.Create(L"@WINDOW_TITLE@", origin, size)) { return EXIT_FAILURE; } - #else - if (!window.Create(L"flavors_example", origin, size)) { - return EXIT_FAILURE; - } - #endif ``` + At configure time, CMake substitutes `@WINDOW_TITLE@` + with the title configured for the active flavor. + ### Create distinct app icons {: #create-distinct-app-icons } -You can provide unique icons for each flavor. +To provide unique desktop icons for each flavor: -1. Prepare your icon files in `.ico` format - (for example, `app_icon_staging.ico` and `app_icon_production.ico`) - and place them in `windows/runner/resources/`. +1. Prepare your icon files in `.ico` format + (for example, `staging.ico` and `production.ico`) + and place them in `windows/runner/resources/` + alongside the default `app_icon.ico`. -1. In `windows/CMakeLists.txt`, select the appropriate icon file - based on `FLUTTER_APP_FLAVOR`: +1. Rename `windows/runner/Runner.rc` to `windows/runner/Runner.rc.in`. - ```cmake title="windows/CMakeLists.txt" - if(FLUTTER_APP_FLAVOR STREQUAL "staging") - set(APP_ICON_NAME "app_icon_staging.ico") - elseif(FLUTTER_APP_FLAVOR STREQUAL "production") - set(APP_ICON_NAME "app_icon_production.ico") - else() - set(APP_ICON_NAME "app_icon.ico") - endif() +1. In `windows/runner/Runner.rc.in`, locate the `IDI_APP_ICON` line + and update the icon path to use `@RUNNER_APP_ICON@`: + + ```rc title="windows/runner/Runner.rc.in" + IDI_APP_ICON ICON "resources\\@RUNNER_APP_ICON@" ``` -3. Configure `windows/runner/Runner.rc` or your CMake target - to use `APP_ICON_NAME` for the application icon resource. + You can also update the metadata strings, such as `FileDescription` + and `ProductName`, to use `@WINDOW_TITLE@`: + + ```rc title="windows/runner/Runner.rc.in" + VALUE "FileDescription", "@WINDOW_TITLE@" "\0" + VALUE "ProductName", "@WINDOW_TITLE@" "\0" + ``` ### Bundle assets by flavor {: #bundle-assets } @@ -254,7 +301,7 @@ flutter: - production ``` -To learn more, see the [`assets` field][] in [Flutter pubspec options][]. +To learn more, consult the [`assets` field][] in [Flutter pubspec options][]. [`assets` field]: /tools/pubspec#assets [Flutter pubspec options]: /tools/pubspec @@ -270,7 +317,7 @@ flutter: default-flavor: staging ``` -To learn more, see the [`default-flavor` field][] in +To learn more, consult the [`default-flavor` field][] in [Flutter pubspec options][]. [`default-flavor` field]: /tools/pubspec#default-flavor-field diff --git a/sites/docs/src/content/platform-integration/linux/setup.md b/sites/docs/src/content/platform-integration/linux/setup.md index b67a084fe9f..e9493e27da0 100644 --- a/sites/docs/src/content/platform-integration/linux/setup.md +++ b/sites/docs/src/content/platform-integration/linux/setup.md @@ -128,7 +128,7 @@ or begin expanding integration with Linux. Release a Linux app
  • - Set up app flavors + Set up app flavors
  • Write Linux-specific code diff --git a/sites/docs/src/content/platform-integration/windows/setup.md b/sites/docs/src/content/platform-integration/windows/setup.md index 65c9195ffc6..3960c0c96de 100644 --- a/sites/docs/src/content/platform-integration/windows/setup.md +++ b/sites/docs/src/content/platform-integration/windows/setup.md @@ -148,7 +148,7 @@ or begin expanding integration with Windows. Deploy to windows
  • - Set up app flavors + Set up app flavors
  • Write Windows-specific code