### Install Packages via Pub Source: https://pub.dev/documentation/flutter_flavorizr/latest After updating your pubspec.yaml, run the 'pub get' command in your project's root directory to download and install the specified dependencies, including flutter_flavorizr. ```bash pub get ``` -------------------------------- ### Install Packages via Pub Source: https://pub.dev/documentation/flutter_flavorizr/latest/index After updating your pubspec.yaml, run the 'pub get' command in your project's root directory to download and install the specified dependencies, including flutter_flavorizr. ```bash pub get ``` -------------------------------- ### Flutter Flavorizr Available Instructions Source: https://pub.dev/documentation/flutter_flavorizr/latest Lists the available commands provided by the Flutter Flavorizr tool. These commands cover various aspects of flavor management, including asset handling, platform-specific configurations, and IDE setup. ```APIDOC Available Instructions: - assets:download: Downloads the assets zip from the network. - assets:extract: Extracts the downloaded zip in the project .tmp directory. - assets:clean: Removes the assets from the project directory. - android:flavorizrGradle: Adds the flavors to the Android flavorizr.gradle file. - android:buildGradle: Imports the Android flavorizr.gradle file into build.gradle file. - android:androidManifest: Changes the reference of the app name in the AndroidManifest.xml. - android:dummyAssets: Generates some default icons for your custom flavors. - android:icons: Creates a set of icons for each flavor according to the icon directive. - flutter:flavors: Creates the flutter flavor configuration file. - flutter:app: Creates the app.dart entry. - flutter:pages: Creates a set of default pages for the app. - flutter:main: Creates the main target to run the app. - google:firebase: Adds Google Firebase configurations for Android and iOS for each flavor. - huawei:agconnect: Adds Huawei AGConnect configurations for Android for each flavor. - ide:config: Generates debugging configurations for each flavor of your IDE. - ios:podfile: Updates the Pods-Runner path for each flavor. - ios:xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - ios:buildTargets: Creates a set of build targets for each flavor and build configuration. - ios:schema: Creates a set of schemas for each flavor. - ios:dummyAssets: Generates some default icons for your custom flavors. - ios:icons: Creates a set of icons for each flavor according to the icon directive. - ios:plist: Updates the info.plist file. - ios:launchScreen: Creates a set of launchscreens for each flavor. - macos:podfile: Updates the Pods-Runner path for each flavor. - macos:xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - macos:configs: Creates a set of xcconfig files for each flavor and build configuration. - macos:buildTargets: Creates a set of build targets for each flavor and build configuration. - macos:schema: Creates a set of schemas for each flavor. - macos:dummyAssets: Generates some default icons for your custom flavors. - macos:icons: Creates a set of icons for each flavor according to the icon directive. - macos:plist: Updates the info.plist file. ``` -------------------------------- ### Example Flavor Configuration (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Demonstrates a basic Flutter flavor configuration using YAML, specifying app name, Android application ID, and iOS bundle ID. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Flavorizr Configuration Example (F Class) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Example Dart code demonstrating how to access flavor-specific data, such as app names, within the generated `flavors.dart` file using a static `F` class. ```dart class F { static late final Flavor appFlavor; static String get name => appFlavor.name; static String get title { switch (appFlavor) { case Flavor.apple: return 'Apple App'; case Flavor.banana: return 'Banana App'; } } } ``` -------------------------------- ### Example Custom Processor Execution Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Demonstrates running specific processors like 'assets:download' and 'assets:extract' to manage project assets. The order of processors is crucial for correct execution. ```bash flutter pub run flutter_flavorizr -p assets:download ``` ```bash flutter pub run flutter_flavorizr -p assets:download,assets:extract ``` -------------------------------- ### Flutter Flavorizr Available Instructions Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Lists the available commands provided by the Flutter Flavorizr tool. These commands cover various aspects of flavor management, including asset handling, platform-specific configurations, and IDE setup. ```APIDOC Available Instructions: - assets:download: Downloads the assets zip from the network. - assets:extract: Extracts the downloaded zip in the project .tmp directory. - assets:clean: Removes the assets from the project directory. - android:flavorizrGradle: Adds the flavors to the Android flavorizr.gradle file. - android:buildGradle: Imports the Android flavorizr.gradle file into build.gradle file. - android:androidManifest: Changes the reference of the app name in the AndroidManifest.xml. - android:dummyAssets: Generates some default icons for your custom flavors. - android:icons: Creates a set of icons for each flavor according to the icon directive. - flutter:flavors: Creates the flutter flavor configuration file. - flutter:app: Creates the app.dart entry. - flutter:pages: Creates a set of default pages for the app. - flutter:main: Creates the main target to run the app. - google:firebase: Adds Google Firebase configurations for Android and iOS for each flavor. - huawei:agconnect: Adds Huawei AGConnect configurations for Android for each flavor. - ide:config: Generates debugging configurations for each flavor of your IDE. - ios:podfile: Updates the Pods-Runner path for each flavor. - ios:xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - ios:buildTargets: Creates a set of build targets for each flavor and build configuration. - ios:schema: Creates a set of schemas for each flavor. - ios:dummyAssets: Generates some default icons for your custom flavors. - ios:icons: Creates a set of icons for each flavor according to the icon directive. - ios:plist: Updates the info.plist file. - ios:launchScreen: Creates a set of launchscreens for each flavor. - macos:podfile: Updates the Pods-Runner path for each flavor. - macos:xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - macos:configs: Creates a set of xcconfig files for each flavor and build configuration. - macos:buildTargets: Creates a set of build targets for each flavor and build configuration. - macos:schema: Creates a set of schemas for each flavor. - macos:dummyAssets: Generates some default icons for your custom flavors. - macos:icons: Creates a set of icons for each flavor according to the icon directive. - macos:plist: Updates the info.plist file. ``` -------------------------------- ### Example Custom Processor Execution Source: https://pub.dev/documentation/flutter_flavorizr/latest Demonstrates running specific processors like 'assets:download' and 'assets:extract' to manage project assets. The order of processors is crucial for correct execution. ```bash flutter pub run flutter_flavorizr -p assets:download ``` ```bash flutter pub run flutter_flavorizr -p assets:download,assets:extract ``` -------------------------------- ### Flavorizr Configuration Example (F Class) Source: https://pub.dev/documentation/flutter_flavorizr/latest Example Dart code demonstrating how to access flavor-specific data, such as app names, within the generated `flavors.dart` file using a static `F` class. ```dart class F { static late final Flavor appFlavor; static String get name => appFlavor.name; static String get title { switch (appFlavor) { case Flavor.apple: return 'Apple App'; case Flavor.banana: return 'Banana App'; } } } ``` -------------------------------- ### Example Flavor Configuration (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Demonstrates a basic Flutter flavor configuration using YAML, specifying app name, Android application ID, and iOS bundle ID. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Android Custom Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Shows how to add custom properties for Android flavors, such as versionNameSuffix, signingConfig, minSdkVersion, and versionCode. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" customConfig: versionNameSuffix: "-green-prod" # Don't forget to escape strings with \" signingConfig: flavorSigning.green versionCode: 1000 minSdkVersion: 23 # ..... and any custom property you want to add ``` -------------------------------- ### Android Custom Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Shows how to add custom properties for Android flavors, such as versionNameSuffix, signingConfig, minSdkVersion, and versionCode. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" customConfig: versionNameSuffix: "-green-prod" # Don't forget to escape strings with \" signingConfig: flavorSigning.green versionCode: 1000 minSdkVersion: 23 # ..... and any custom property you want to add ``` -------------------------------- ### iOS/macOS Variable Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Demonstrates how to define variables for iOS and macOS flavors, with optional targeting for debug or release modes. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" variables: VARIABLE_ONE: value: "variable1" VARIABLE_TWO: target: "Debug" value: "variable2" ``` -------------------------------- ### iOS/macOS Variable Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Demonstrates how to define variables for iOS and macOS flavors, with optional targeting for debug or release modes. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" variables: VARIABLE_ONE: value: "variable1" VARIABLE_TWO: target: "Debug" value: "variable2" ``` -------------------------------- ### Android resValue Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Shows how to define custom string resources for Android flavors using the `resValues` property. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" resValues: variable_one: type: "string" value: "example variable one" variable_two: type: "string" value: "example variable two" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Android resValue Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Shows how to define custom string resources for Android flavors using the `resValues` property. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" resValues: variable_one: type: "string" value: "example variable one" variable_two: type: "string" value: "example variable two" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Android buildConfigField Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Illustrates how to define custom build configuration fields for Android flavors, including different data types. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" buildConfigFields: field_one: type: "String" value: "example field one" field_two: type: "char" value: "y" field_three: type: "double" value: "20.0" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Android buildConfigField Configuration Example (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Illustrates how to define custom build configuration fields for Android flavors, including different data types. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" buildConfigFields: field_one: type: "String" value: "example field one" field_two: type: "char" value: "y" field_three: type: "double" value: "20.0" ios: bundleId: "com.example.apple" ``` -------------------------------- ### Configure Firebase for Flutter Flavors (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Defines the paths to GoogleService-Info.plist or google-services.json for Firebase integration within different project flavors. This configuration is essential for flavor-specific Firebase setup. ```YAML flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" firebase: config: ".firebase/apple/google-services.json" ios: bundleId: "com.example.apple" firebase: config: ".firebase/apple/GoogleService-Info.plist" banana: app: name: "Banana App" android: applicationId: "com.example.banana" firebase: config: ".firebase/banana/google-services.json" ios: bundleId: "com.example.banana" firebase: config: ".firebase/banana/GoogleService-Info.plist" ``` -------------------------------- ### Configure Firebase for Flutter Flavors (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Defines the paths to GoogleService-Info.plist or google-services.json for Firebase integration within different project flavors. This configuration is essential for flavor-specific Firebase setup. ```YAML flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" firebase: config: ".firebase/apple/google-services.json" ios: bundleId: "com.example.apple" firebase: config: ".firebase/apple/GoogleService-Info.plist" banana: app: name: "Banana App" android: applicationId: "com.example.banana" firebase: config: ".firebase/banana/google-services.json" ios: bundleId: "com.example.banana" firebase: config: ".firebase/banana/GoogleService-Info.plist" ``` -------------------------------- ### Run flutter_flavorizr with Custom Processors Source: https://pub.dev/documentation/flutter_flavorizr/latest Executes flutter_flavorizr with a specified set of processors, allowing granular control over the build and configuration steps. Processors are listed comma-separated. ```bash flutter pub run flutter_flavorizr -p , ``` -------------------------------- ### Run flutter_flavorizr with Custom Processors Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Executes flutter_flavorizr with a specified set of processors, allowing granular control over the build and configuration steps. Processors are listed comma-separated. ```bash flutter pub run flutter_flavorizr -p , ``` -------------------------------- ### Run flutter_flavorizr Command Source: https://pub.dev/documentation/flutter_flavorizr/latest The basic command to execute the flutter_flavorizr tool, which processes the flavor configurations and generates necessary files for different app flavors. ```bash flutter pub run flutter_flavorizr ``` -------------------------------- ### Run flutter_flavorizr Command Source: https://pub.dev/documentation/flutter_flavorizr/latest/index The basic command to execute the flutter_flavorizr tool, which processes the flavor configurations and generates necessary files for different app flavors. ```bash flutter pub run flutter_flavorizr ``` -------------------------------- ### Flutter Flavorizr iOS Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Details configuration options for iOS flavors. This includes build settings for Xcode, and specific settings for Podfile, xcconfig files, build targets, schemas, and plist files. ```APIDOC ios (under app) Configuration: Parameters: - buildSettings (Dictionary): An Xcode build configuration dictionary. Refer to [XCode Build Settings](https://xcodebuildsettings.com) for details. ``` ```APIDOC ios Configuration Details: - podfile: Updates the Pods-Runner path for each flavor. - xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - buildTargets: Creates a set of build targets for each flavor and build configuration. - schema: Creates a set of schemas for each flavor. - dummyAssets: Generates some default icons for your custom flavors. - icons: Creates a set of icons for each flavor according to the icon directive. - plist: Updates the info.plist file. - launchScreen: Creates a set of launchscreens for each flavor. ``` -------------------------------- ### Flutter Flavorizr iOS Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest Details configuration options for iOS flavors. This includes build settings for Xcode, and specific settings for Podfile, xcconfig files, build targets, schemas, and plist files. ```APIDOC ios (under app) Configuration: Parameters: - buildSettings (Dictionary): An Xcode build configuration dictionary. Refer to [XCode Build Settings](https://xcodebuildsettings.com) for details. ``` ```APIDOC ios Configuration Details: - podfile: Updates the Pods-Runner path for each flavor. - xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - buildTargets: Creates a set of build targets for each flavor and build configuration. - schema: Creates a set of schemas for each flavor. - dummyAssets: Generates some default icons for your custom flavors. - icons: Creates a set of icons for each flavor according to the icon directive. - plist: Updates the info.plist file. - launchScreen: Creates a set of launchscreens for each flavor. ``` -------------------------------- ### flutter_flavorizr execute function Source: https://pub.dev/documentation/flutter_flavorizr/latest/flutter_flavorizr The primary entry point for the flutter_flavorizr command-line interface. It parses arguments and executes the main process. ```APIDOC execute(List args) -> void Description: A common entry point to parse command line arguments and execute the process. Parameters: args: A list of strings representing command line arguments. Returns: void ``` -------------------------------- ### Run Flavored Flutter App Source: https://pub.dev/documentation/flutter_flavorizr/latest Command to launch a Flutter application with a specific flavor applied. The `--flavor` flag specifies which flavor configuration to use during the build and run process. ```bash flutter run --flavor ``` ```bash flutter run --flavor apple ``` ```bash flutter run --flavor banana ``` -------------------------------- ### Run flutter_flavorizr in Verbose Mode Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Enables verbose logging for flutter_flavorizr, providing detailed output of all operations and processor activities during the flavor generation process. ```bash flutter pub run flutter_flavorizr -v ``` -------------------------------- ### Run Flavored Flutter App Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Command to launch a Flutter application with a specific flavor applied. The `--flavor` flag specifies which flavor configuration to use during the build and run process. ```bash flutter run --flavor ``` ```bash flutter run --flavor apple ``` ```bash flutter run --flavor banana ``` -------------------------------- ### Flutter Flavorizr macOS Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest Outlines configuration options for macOS flavors. This covers settings for the Podfile, xcconfig files, build targets, schemas, and icon generation, similar to iOS but tailored for macOS. ```APIDOC macos (under app) Configuration: Parameters: - buildSettings (Dictionary): An Xcode build configuration dictionary. Refer to [XCode Build Settings](https://xcodebuildsettings.com) for details. ``` ```APIDOC macos Configuration Details: - podfile: Updates the Pods-Runner path for each flavor. - xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - configs: Creates a set of xcconfig files for each flavor and build configuration (alias for xcconfig). - buildTargets: Creates a set of build targets for each flavor and build configuration. - schema: Creates a set of schemas for each flavor. - dummyAssets: Generates some default icons for your custom flavors. - icons: Creates a set of icons for each flavor according to the icon directive. - plist: Updates the info.plist file. ``` -------------------------------- ### Run flutter_flavorizr in Verbose Mode Source: https://pub.dev/documentation/flutter_flavorizr/latest Enables verbose logging for flutter_flavorizr, providing detailed output of all operations and processor activities during the flavor generation process. ```bash flutter pub run flutter_flavorizr -v ``` -------------------------------- ### Flutter Flavorizr macOS Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Outlines configuration options for macOS flavors. This covers settings for the Podfile, xcconfig files, build targets, schemas, and icon generation, similar to iOS but tailored for macOS. ```APIDOC macos (under app) Configuration: Parameters: - buildSettings (Dictionary): An Xcode build configuration dictionary. Refer to [XCode Build Settings](https://xcodebuildsettings.com) for details. ``` ```APIDOC macos Configuration Details: - podfile: Updates the Pods-Runner path for each flavor. - xcconfig: Creates a set of xcconfig files for each flavor and build configuration. - configs: Creates a set of xcconfig files for each flavor and build configuration (alias for xcconfig). - buildTargets: Creates a set of build targets for each flavor and build configuration. - schema: Creates a set of schemas for each flavor. - dummyAssets: Generates some default icons for your custom flavors. - icons: Creates a set of icons for each flavor according to the icon directive. - plist: Updates the info.plist file. ``` -------------------------------- ### Define Flavors using flavorizr.yaml Source: https://pub.dev/documentation/flutter_flavorizr/latest Configure your application flavors by creating a 'flavorizr.yaml' file in your project's root. This file specifies flavor names, app names, application IDs for Android, and bundle IDs for iOS and macOS. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" ios: bundleId: "com.example.banana" macos: bundleId: "com.example.banana" ``` -------------------------------- ### Define Flavors using flavorizr.yaml Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Configure your application flavors by creating a 'flavorizr.yaml' file in your project's root. This file specifies flavor names, app names, application IDs for Android, and bundle IDs for iOS and macOS. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" ios: bundleId: "com.example.banana" macos: bundleId: "com.example.banana" ``` -------------------------------- ### Flutter Flavorizr App Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Defines the core application-level configuration settings for Flutter flavors. This includes the app's name and optional icon path, which are fundamental for branding and identification across platforms. ```APIDOC app (under *flavorname*) Configuration: Parameters: - name (String): The name of the App. This is a required field. - icon (String): The path to the icon for this flavor. This is an optional field. ``` -------------------------------- ### Run flutter_flavorizr in Force Mode Source: https://pub.dev/documentation/flutter_flavorizr/latest Skips the confirmation prompt before executing flutter_flavorizr, allowing for automated or unattended runs. Use with caution as it bypasses user confirmation. ```bash flutter pub run flutter_flavorizr -f ``` -------------------------------- ### Flutter Flavorizr App Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest Defines the core application-level configuration settings for Flutter flavors. This includes the app's name and optional icon path, which are fundamental for branding and identification across platforms. ```APIDOC app (under *flavorname*) Configuration: Parameters: - name (String): The name of the App. This is a required field. - icon (String): The path to the icon for this flavor. This is an optional field. ``` -------------------------------- ### Initialize Firebase in Flutter App (Dart) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Demonstrates how to initialize Firebase Core in a Flutter application, ensuring it's done correctly after ensuring Flutter bindings are initialized. It highlights not passing options directly to Firebase.initializeApp() when using flavor configurations. ```Dart import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); // Do not pass the options here runApp(const App()); } ``` -------------------------------- ### Initialize Firebase in Flutter App (Dart) Source: https://pub.dev/documentation/flutter_flavorizr/latest Demonstrates how to initialize Firebase Core in a Flutter application, ensuring it's done correctly after ensuring Flutter bindings are initialized. It highlights not passing options directly to Firebase.initializeApp() when using flavor configurations. ```Dart import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); // Do not pass the options here runApp(const App()); } ``` -------------------------------- ### Execute Dart Command-Line Entry Point Source: https://pub.dev/documentation/flutter_flavorizr/latest/flutter_flavorizr/execute The `execute` function serves as the primary entry point for the flutter_flavorizr CLI. It parses command-line arguments using `ArgParser`, configures logging levels, initializes the `Flavorizr` parser with specified paths, and executes the core processing logic. It supports flags for forcing operations and specifying processors, and includes error handling for parsing issues. ```dart void execute( 1. [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> args ) A common entry point to parse command line arguments and execute the process Returns the exit code that should be set when the calling process exits. `0` implies success. ```dart void execute(List args) { final argParser = ArgParser() ..addFlag('force', abbr: 'f') ..addMultiOption( 'processors', abbr: 'p', allowed: Processor.defaultInstructionSet, splitCommas: true, ) ..addFlag('verbose', abbr: 'v'); final results = argParser.parse(args); final force = results['force'] as bool? ?? false; final argProcessors = results['processors']; final level = results['verbose'] == true ? Level.verbose : Level.info; final logger = Logger(level: level); const parser = Parser( pubspecPath: 'pubspec', flavorizrPath: 'flavorizr', ); late Flavorizr flavorizr; try { flavorizr = parser.parse(); } catch (error) { logger.err(error.toString()); exit(65); } if (argProcessors.isNotEmpty) { flavorizr.instructions = argProcessors; } final processor = Processor( flavorizr, force: force, logger: logger, ); processor.execute(); } ``` ``` -------------------------------- ### Run flutter_flavorizr in Force Mode Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Skips the confirmation prompt before executing flutter_flavorizr, allowing for automated or unattended runs. Use with caution as it bypasses user confirmation. ```bash flutter pub run flutter_flavorizr -f ``` -------------------------------- ### Configure AppGallery Connect for Flutter Flavors (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest Specifies the paths to agconnect-services.json for Huawei AppGallery Connect integration within different Android flavors. This allows flavor-specific configuration for Huawei services. ```YAML flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" agconnect: config: ".agconnect/apple/agconnect-services.json" ios: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" agconnect: config: ".agconnect/banana/agconnect-services.json" ios: bundleId: "com.example.banana" ``` -------------------------------- ### Configure AppGallery Connect for Flutter Flavors (YAML) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Specifies the paths to agconnect-services.json for Huawei AppGallery Connect integration within different Android flavors. This allows flavor-specific configuration for Huawei services. ```YAML flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" agconnect: config: ".agconnect/apple/agconnect-services.json" ios: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" agconnect: config: ".agconnect/banana/agconnect-services.json" ios: bundleId: "com.example.banana" ``` -------------------------------- ### Flutter Flavorizr Android Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Specifies configuration options for Android flavors. This includes details like application ID, Firebase integration, resource values, build configuration fields, and icon generation settings. ```APIDOC android (under app) Configuration: Parameters: - flavorDimensions (String): The value for flavorDimensions in the android build.gradle file. Defaults to "flavor-type". - resValues (Array): An array containing resValues configurations. - buildConfigFields (Array): An array containing buildConfigFields configurations. ``` ```APIDOC android (under *flavorname*) Configuration: Parameters: - applicationId (String): The applicationId of the Android App. This is a required field. - firebase (Object): An object containing Firebase configuration details. - resValues (Array): An array containing resValues configurations. - buildConfigFields (Array): An array containing buildConfigFields configurations. - customConfig (Array): An array containing custom configurations that override defaultConfig. - generateDummyAssets (bool): Set to true to generate dummy assets (icon set, strings, etc.). Defaults to true. - icon (String): The path to the icon for this Android flavor. - adaptiveIcon (Array): An array containing foreground, background, and optional monochrome settings for adaptive icons. ``` -------------------------------- ### Flutter Flavorizr Android Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest Specifies configuration options for Android flavors. This includes details like application ID, Firebase integration, resource values, build configuration fields, and icon generation settings. ```APIDOC android (under app) Configuration: Parameters: - flavorDimensions (String): The value for flavorDimensions in the android build.gradle file. Defaults to "flavor-type". - resValues (Array): An array containing resValues configurations. - buildConfigFields (Array): An array containing buildConfigFields configurations. ``` ```APIDOC android (under *flavorname*) Configuration: Parameters: - applicationId (String): The applicationId of the Android App. This is a required field. - firebase (Object): An object containing Firebase configuration details. - resValues (Array): An array containing resValues configurations. - buildConfigFields (Array): An array containing buildConfigFields configurations. - customConfig (Array): An array containing custom configurations that override defaultConfig. - generateDummyAssets (bool): Set to true to generate dummy assets (icon set, strings, etc.). Defaults to true. - icon (String): The path to the icon for this Android flavor. - adaptiveIcon (Array): An array containing foreground, background, and optional monochrome settings for adaptive icons. ``` -------------------------------- ### macOS Flavor Build Settings Workaround Source: https://pub.dev/documentation/flutter_flavorizr/latest A workaround configuration for macOS flavors in Flutter Flavorizr to address potential issues with running from the terminal, involving specific build settings. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" buildSettings: LD_RUNPATH_SEARCH_PATHS: - "$(inherited)" - "@executable_path/../Frameworks" ``` -------------------------------- ### Android Adaptive Icon Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest Defines adaptive icon properties for Android flavors, including foreground, background, and optional monochrome image paths within the flavorizr configuration. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" icon: "assets/icon/appleApp/ic_launcher.png" adaptiveIcon: foreground: "assets/adaptive_icon/appleApp/ic_launcher_foreground.png" background: "assets/adaptive_icon/appleApp/ic_launcher_background.png" monochrome: "assets/adaptive_icon/appleApp/ic_launcher_monochrome.png" ``` -------------------------------- ### macOS Flavor Build Settings Workaround Source: https://pub.dev/documentation/flutter_flavorizr/latest/index A workaround configuration for macOS flavors in Flutter Flavorizr to address potential issues with running from the terminal, involving specific build settings. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" buildSettings: LD_RUNPATH_SEARCH_PATHS: - "$(inherited)" - "@executable_path/../Frameworks" ``` -------------------------------- ### Android Adaptive Icon Configuration Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Defines adaptive icon properties for Android flavors, including foreground, background, and optional monochrome image paths within the flavorizr configuration. ```yaml flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" icon: "assets/icon/appleApp/ic_launcher.png" adaptiveIcon: foreground: "assets/adaptive_icon/appleApp/ic_launcher_foreground.png" background: "assets/adaptive_icon/appleApp/ic_launcher_background.png" monochrome: "assets/adaptive_icon/appleApp/ic_launcher_monochrome.png" ``` -------------------------------- ### Add flutter_flavorizr to dev_dependencies Source: https://pub.dev/documentation/flutter_flavorizr/latest Integrate the flutter_flavorizr package into your Flutter project by adding it to the dev_dependencies section in your pubspec.yaml file. This makes the tool available for development tasks. ```yaml dev_dependencies: flutter_flavorizr: ^2.4.1 ``` -------------------------------- ### Add flutter_flavorizr to dev_dependencies Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Integrate the flutter_flavorizr package into your Flutter project by adding it to the dev_dependencies section in your pubspec.yaml file. This makes the tool available for development tasks. ```yaml dev_dependencies: flutter_flavorizr: ^2.4.1 ``` -------------------------------- ### Generated Android Flavor (DSL) Source: https://pub.dev/documentation/flutter_flavorizr/latest The output of the custom Android flavor configuration, presented in a DSL format. ```groovy apple { dimension "flavor-type" applicationId "com.example.apple" versionNameSuffix "-green-prod" signingConfig flavorSigning.green versionCode 1000 minSdkVersion 23 } ``` -------------------------------- ### Generated Android Flavor (DSL) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index The output of the custom Android flavor configuration, presented in a DSL format. ```groovy apple { dimension "flavor-type" applicationId "com.example.apple" versionNameSuffix "-green-prod" signingConfig flavorSigning.green versionCode 1000 minSdkVersion 23 } ``` -------------------------------- ### Define Flavors in pubspec.yaml (Deprecated) Source: https://pub.dev/documentation/flutter_flavorizr/latest Alternatively, define flavors directly within your pubspec.yaml file using the 'flavorizr' key. This method is marked for deprecation in future versions (3.x). It allows specifying app name, applicationId, and bundleId for each flavor. ```yaml flavorizr: flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" ios: bundleId: "com.example.banana" macos: bundleId: "com.example.banana" ``` -------------------------------- ### Define Flavors in pubspec.yaml (Deprecated) Source: https://pub.dev/documentation/flutter_flavorizr/latest/index Alternatively, define flavors directly within your pubspec.yaml file using the 'flavorizr' key. This method is marked for deprecation in future versions (3.x). It allows specifying app name, applicationId, and bundleId for each flavor. ```yaml flavorizr: flavors: apple: app: name: "Apple App" android: applicationId: "com.example.apple" ios: bundleId: "com.example.apple" macos: bundleId: "com.example.apple" banana: app: name: "Banana App" android: applicationId: "com.example.banana" ios: bundleId: "com.example.banana" macos: bundleId: "com.example.banana" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.