### Install Packages via Command Line Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md After adding flutter_flavorizr to your pubspec.yaml, install the packages using the 'pub get' command. ```terminal pub get ``` -------------------------------- ### Basic Flavor Configuration Example Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Define different app flavors (development, staging, production) with their respective app names, Android application IDs, and iOS/macOS bundle IDs in a `flavorizr.yaml` file. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" ios: bundleId: "com.example.myapp.dev" macos: bundleId: "com.example.myapp.dev" staging: app: name: "My App Staging" android: applicationId: "com.example.myapp.staging" ios: bundleId: "com.example.myapp.staging" macos: bundleId: "com.example.myapp.staging" production: app: name: "My App" android: applicationId: "com.example.myapp" ios: bundleId: "com.example.myapp" macos: bundleId: "com.example.myapp" ``` -------------------------------- ### Install xcodeproj for iOS/macOS Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Prerequisites for iOS and macOS flavor management require installing the xcodeproj gem via RubyGems. ```bash # Install the package flutter pub get # Prerequisites for iOS/macOS (install via RubyGems) gem install xcodeproj ``` -------------------------------- ### Generated VS Code Launch Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Example of a generated launch.json file for VS Code, enabling debugging of 'development' and 'production' flavors. ```json // Generated .vscode/launch.json { "version": "0.2.0", "configurations": [ { "name": "development", "request": "launch", "type": "dart", "args": ["--flavor", "development"] }, { "name": "production", "request": "launch", "type": "dart", "args": ["--flavor", "production"] } ] } ``` -------------------------------- ### Regenerate Pods with Flutter Pub Get Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/doc/troubleshooting/unable-to-load-contents-of-file-list/README.md After cleaning and removing old pods, run this command to regenerate the Pods for the project. ```bash flutter pub get ``` -------------------------------- ### Deintegrate and Remove Pods Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/doc/troubleshooting/unable-to-load-contents-of-file-list/README.md Commands to manually deintegrate Cocoapods and remove related files. This ensures a clean slate for pod installation. ```bash cd ios && pod deintegrate ``` ```bash rm -rf ios/Pods ios/.symlinks ios/Podfile.lock ``` -------------------------------- ### Customize Flavorizr Process with Instructions Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Define specific processors to run for partial updates or platform-specific configurations, such as only processing Android and Flutter related tasks. ```yaml # flavorizr.yaml - Only process Android and Flutter instructions: - assets:download - assets:extract - android:androidManifest - android:flavorizrGradle - android:buildGradle - android:dummyAssets - android:icons - flutter:flavors - flutter:app - flutter:pages - flutter:main - assets:clean flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" production: app: name: "My App" android: applicationId: "com.example.myapp" ``` -------------------------------- ### Run Flutter Flavorizr Commands Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Execute Flutter Flavorizr using `flutter pub run flutter_flavorizr` with options for forcing execution, enabling verbose logging, or specifying particular processors. ```bash # Run with default processor set (generates all configurations) flutter pub run flutter_flavorizr # Run with force flag (skip confirmation prompt) flutter pub run flutter_flavorizr -f # Run in verbose mode for detailed logging flutter pub run flutter_flavorizr -v # Run specific processors only flutter pub run flutter_flavorizr -p android:androidManifest,android:buildGradle # Run assets processors first, then Android only flutter pub run flutter_flavorizr -p assets:download,assets:extract,android:dummyAssets,android:icons ``` -------------------------------- ### Firebase Configuration for Flavors Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md This YAML configuration demonstrates how to set up Firebase for different flavors. It specifies the path to the `google-services.json` for Android and `GoogleService-Info.plist` for iOS and macOS under the `firebase.config` key for each flavor. ```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 Flavored Apps Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Launch or build your Flutter application for a specific flavor using the `--flavor` flag with `flutter run` or `flutter build` commands. ```bash # Run the development flavor flutter run --flavor development # Run the production flavor flutter run --flavor production # Build APK for a specific flavor flutter build apk --flavor staging # Build iOS app for a specific flavor flutter build ios --flavor production ``` -------------------------------- ### Run Flutter Flavorizr Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Execute flutter_flavorizr from the terminal to apply your flavor configurations. Use the -p flag to specify custom processors and -v for verbose output. ```terminal flutter pub run flutter_flavorizr ``` ```terminal flutter pub run flutter_flavorizr -p , ``` ```terminal flutter pub run flutter_flavorizr -p assets:download ``` ```terminal flutter pub run flutter_flavorizr -p assets:download,assets:extract ``` ```terminal flutter pub run flutter_flavorizr -v ``` ```terminal flutter pub run flutter_flavorizr -f ``` -------------------------------- ### Define Flavors in flavorizr.yaml Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Define your application flavors, including app name, applicationId for Android, and bundleId for iOS and macOS, in a flavorizr.yaml file. ```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" ``` -------------------------------- ### Configure Google Firebase for Flavors Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Specify paths to google-services.json and GoogleService-Info.plist for Android, iOS, and macOS flavors. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" firebase: config: ".firebase/development/google-services.json" ios: bundleId: "com.example.myapp.dev" firebase: config: ".firebase/development/GoogleService-Info.plist" macos: bundleId: "com.example.myapp.dev" firebase: config: ".firebase/development/GoogleService-Info.plist" production: app: name: "My App" android: applicationId: "com.example.myapp" firebase: config: ".firebase/production/google-services.json" ios: bundleId: "com.example.myapp" firebase: config: ".firebase/production/GoogleService-Info.plist" macos: bundleId: "com.example.myapp" firebase: config: ".firebase/production/GoogleService-Info.plist" ``` -------------------------------- ### Generate IDE Run Configurations for Flavors Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Configure VS Code and IntelliJ IDEA to generate run configurations for debugging different application flavors. ```yaml # flavorizr.yaml ide: - vscode - idea flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" ios: bundleId: "com.example.myapp.dev" production: app: name: "My App" android: applicationId: "com.example.myapp" ios: bundleId: "com.example.myapp" ``` -------------------------------- ### Initialize Flavor in main.dart Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Initialize the F.appFlavor static variable in your main function by finding the correct Flavor enum value based on the appFlavor string. ```dart // lib/main.dart (generated by Flavorizr) import 'package:flutter/material.dart'; import 'flavors.dart'; void main() { F.appFlavor = Flavor.values.firstWhere( (element) => element.name == appFlavor, ); runApp(const App()); } ``` -------------------------------- ### Configure Huawei AppGallery Connect for Android Flavors Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Specify paths to agconnect-services.json files for Android flavors integrating with Huawei AppGallery Connect. ```yaml # flavorizr.yaml flavors: huawei_dev: app: name: "My App HMS Dev" android: applicationId: "com.example.myapp.hms.dev" agconnect: config: ".agconnect/development/agconnect-services.json" ios: bundleId: "com.example.myapp.hms.dev" huawei_prod: app: name: "My App HMS" android: applicationId: "com.example.myapp.hms" agconnect: config: ".agconnect/production/agconnect-services.json" ios: bundleId: "com.example.myapp.hms" ``` -------------------------------- ### Run Flutter App with Flavor Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/doc/troubleshooting/unable-to-load-contents-of-file-list/README.md Command to run a Flutter application with a specific flavor and target file. This command often triggers the build error. ```bash flutter run --flavor apple -t lib/main_apple.dart ``` -------------------------------- ### Adjust macOS Deployment Target Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/doc/troubleshooting/unable-to-load-contents-of-file-list/README.md When troubleshooting on macOS, use these commands to adjust the deployment target for the macOS build. ```bash cd macos && pod deintegrate ``` -------------------------------- ### Android Adaptive Icons Configuration Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Configure adaptive icons for Android flavors by specifying paths for foreground, background, and optionally monochrome versions. ```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" ``` -------------------------------- ### Clean Flutter Project Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/doc/troubleshooting/unable-to-load-contents-of-file-list/README.md Use this command to clean the Flutter project. This is the first step in resolving the iOS build issue. ```bash flutter clean ``` -------------------------------- ### iOS/macOS Build Settings Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Configure Xcode build settings for iOS and macOS. Settings can be applied globally or overridden per flavor. ```yaml # flavorizr.yaml app: ios: buildSettings: SWIFT_VERSION: "5.0" ENABLE_BITCODE: "NO" macos: buildSettings: SWIFT_VERSION: "5.0" flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" ios: bundleId: "com.example.myapp.dev" buildSettings: CODE_SIGN_IDENTITY: "iPhone Developer" DEVELOPMENT_TEAM: "TEAM123DEV" PROVISIONING_PROFILE_SPECIFIER: "Dev Profile" macos: bundleId: "com.example.myapp.dev" buildSettings: CODE_SIGN_IDENTITY: "Mac Developer" LD_RUNPATH_SEARCH_PATHS: - "$(inherited)" - "@executable_path/../Frameworks" production: app: name: "My App" android: applicationId: "com.example.myapp" ios: bundleId: "com.example.myapp" buildSettings: CODE_SIGN_IDENTITY: "iPhone Distribution" DEVELOPMENT_TEAM: "TEAM456PROD" PROVISIONING_PROFILE_SPECIFIER: "AppStore Profile" macos: bundleId: "com.example.myapp" ``` -------------------------------- ### Configure Huawei AppGallery Connect per Flavor Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Define the `agconnect` object within each Android flavor to specify the path to the `agconnect-services.json` configuration file. This enables AppGallery Connect for that specific flavor. ```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" ``` -------------------------------- ### Run Flutter App with a Specific Flavor Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Use this command to run your Flutter application with a specified flavor. Replace `` with the name of your desired flavor. ```terminal flutter run --flavor ``` ```terminal flutter run --flavor apple flutter run --flavor banana ``` -------------------------------- ### Flavorizr Configuration for macOS Workaround Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md This YAML configuration can be used as a temporary workaround for running macOS flavors from the terminal, addressing a bug in the Flutter SDK. It specifies build settings for macOS. ```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" ``` -------------------------------- ### Custom App Icons per Flavor Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Specify custom app icons for each flavor, including general app icons, Android-specific icons (adaptive foreground, background, monochrome), and iOS/macOS icons within the `flavorizr.yaml`. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" icon: "assets/icons/dev_icon.png" android: applicationId: "com.example.myapp.dev" icon: "assets/icons/android/dev_icon.png" adaptiveIcon: foreground: "assets/icons/android/dev_foreground.png" background: "assets/icons/android/dev_background.png" monochrome: "assets/icons/android/dev_monochrome.png" ios: bundleId: "com.example.myapp.dev" icon: "assets/icons/ios/dev_icon.png" macos: bundleId: "com.example.myapp.dev" icon: "assets/icons/macos/dev_icon.png" production: app: name: "My App" icon: "assets/icons/prod_icon.png" android: applicationId: "com.example.myapp" ios: bundleId: "com.example.myapp" macos: bundleId: "com.example.myapp" ``` -------------------------------- ### Define Flavors in pubspec.yaml (Deprecated) Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Alternatively, define flavors directly within your pubspec.yaml file under the 'flavorizr' key. This method will be deprecated in future versions. ```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" ``` -------------------------------- ### Firebase Initialization without Options Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md This Dart code shows how to initialize Firebase in your Flutter app when using flutter_flavorizr for Firebase configurations. Crucially, `Firebase.initializeApp()` should be called without passing any options to avoid conflicts with flavor-specific 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()); } ``` -------------------------------- ### Custom Android Configuration Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Define custom properties for Android flavors using the 'customConfig' key. This allows for versioning, signing configurations, and more. ```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 BuildConfigFields Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Define compile-time constants for Android builds. Ensure correct type and value formatting, especially for strings requiring escaped quotes. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" buildConfigFields: API_KEY: type: "String" value: "\"dev_api_key_12345\"" MAX_RETRIES: type: "int" value: "5" DEBUG_MODE: type: "boolean" value: "true" ios: bundleId: "com.example.myapp.dev" production: app: name: "My App" android: applicationId: "com.example.myapp" buildConfigFields: API_KEY: type: "String" value: "\"prod_api_key_67890\"" MAX_RETRIES: type: "int" value: "3" DEBUG_MODE: type: "boolean" value: "false" ios: bundleId: "com.example.myapp" ``` -------------------------------- ### Define iOS/macOS Variables Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Use the 'variables' key to define custom variables for iOS and macOS targets. Specify the 'target' (debug, release, profile) and the 'value' for each variable. ```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" ``` -------------------------------- ### Initialize Firebase in Flutter App Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Initialize Firebase Core in your Flutter app. Flavorizr handles the configuration based on the selected flavor, so options should not be passed directly. ```dart // lib/main.dart - Initialize Firebase without options import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); // Do NOT pass options - Flavorizr handles config per flavor await Firebase.initializeApp(); runApp(const MyApp()); } ``` -------------------------------- ### Android resValues Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Configure string and boolean resources for Android flavors. These values are accessible at compile time. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" resValues: api_base_url: type: "string" value: "https://dev-api.example.com" app_env: type: "string" value: "development" enable_logging: type: "bool" value: "true" ios: bundleId: "com.example.myapp.dev" production: app: name: "My App" android: applicationId: "com.example.myapp" resValues: api_base_url: type: "string" value: "https://api.example.com" app_env: type: "string" value: "production" enable_logging: type: "bool" value: "false" ios: bundleId: "com.example.myapp" ``` -------------------------------- ### Android CustomConfig Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Override default Android settings like versioning and SDK requirements per flavor. Note the use of escaped quotes for string values like versionNameSuffix. ```yaml # flavorizr.yaml app: android: flavorDimensions: "environment" flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" customConfig: versionNameSuffix: "-dev" minSdkVersion: 21 targetSdkVersion: 34 versionCode: 1 ios: bundleId: "com.example.myapp.dev" production: app: name: "My App" android: applicationId: "com.example.myapp" customConfig: versionNameSuffix: "\"\"" minSdkVersion: 23 targetSdkVersion: 34 versionCode: 100 signingConfig: signingConfigs.release ios: bundleId: "com.example.myapp" ``` -------------------------------- ### iOS/macOS Variables Configuration Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Define custom variables for iOS and macOS builds. Variables can be targeted to specific build configurations like 'Release' or 'Debug'. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" android: applicationId: "com.example.myapp.dev" ios: bundleId: "com.example.myapp.dev" variables: API_BASE_URL: value: "https://dev-api.example.com" ENABLE_ANALYTICS: target: "Release" value: "NO" DEBUG_LEVEL: target: "Debug" value: "VERBOSE" macos: bundleId: "com.example.myapp.dev" variables: API_BASE_URL: value: "https://dev-api.example.com" production: app: name: "My App" android: applicationId: "com.example.myapp" ios: bundleId: "com.example.myapp" variables: API_BASE_URL: value: "https://api.example.com" ENABLE_ANALYTICS: value: "YES" macos: bundleId: "com.example.myapp" ``` -------------------------------- ### Configure Android resValues for a flavor Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Use resValues to define string resources for a specific Android flavor. Ensure the type is set to 'string'. ```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" ``` -------------------------------- ### Disable Dummy Asset Generation in flavorizr.yaml Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Configure flavorizr.yaml to disable automatic dummy asset generation for specific flavors by setting 'generateDummyAssets' to false. ```yaml # flavorizr.yaml flavors: development: app: name: "My App Dev" icon: "assets/icons/dev_icon.png" android: applicationId: "com.example.myapp.dev" generateDummyAssets: false icon: "assets/icons/android/dev_icon.png" ios: bundleId: "com.example.myapp.dev" generateDummyAssets: false icon: "assets/icons/ios/dev_icon.png" macos: bundleId: "com.example.myapp.dev" generateDummyAssets: false icon: "assets/icons/macos/dev_icon.png" ``` -------------------------------- ### Add Flutter Flavorizr as Dev Dependency Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Add Flutter Flavorizr to your pubspec.yaml file under dev_dependencies to enable flavor generation capabilities. ```yaml # pubspec.yaml dev_dependencies: flutter_flavorizr: ^2.4.2 ``` -------------------------------- ### Extended F Class with Custom Properties Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Extend the generated F class to include custom flavor-specific configurations such as API base URLs, feature flags, and theme colors. ```dart // lib/flavors.dart - Extended with custom properties enum Flavor { development, staging, production, } class F { static late final Flavor appFlavor; static String get name => appFlavor.name; static String get title { switch (appFlavor) { case Flavor.development: return 'My App Dev'; case Flavor.staging: return 'My App Staging'; case Flavor.production: return 'My App'; } } // Custom: API Base URL per flavor static String get apiBaseUrl { switch (appFlavor) { case Flavor.development: return 'https://dev-api.example.com'; case Flavor.staging: return 'https://staging-api.example.com'; case Flavor.production: return 'https://api.example.com'; } } // Custom: Feature flags per flavor static bool get enableAnalytics { switch (appFlavor) { case Flavor.development: return false; case Flavor.staging: return true; case Flavor.production: return true; } } // Custom: Theme color per flavor static Color get primaryColor { switch (appFlavor) { case Flavor.development: return Colors.green; case Flavor.staging: return Colors.orange; case Flavor.production: return Colors.blue; } } } ``` -------------------------------- ### Configure Android buildConfigFields for a flavor Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Use buildConfigFields to define constants for your Android flavor's BuildConfig class. Specify the type and value for each field. ```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" ``` -------------------------------- ### Generated Android Flavor Code Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md This is the resulting Groovy code generated for a custom Android flavor based on the YAML configuration. ```groovy apple { dimension "flavor-type" applicationId "com.example.apple" versionNameSuffix "-green-prod" signingConfig flavorSigning.green versionCode 1000 minSdkVersion 23 } ``` -------------------------------- ### F Class for Flavor Customizations Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md This Dart code defines the `F` class, which holds flavor-specific customizations. It includes a static `appFlavor` variable and getters for `name` and `title` that adapt based on the current flavor. ```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'; } } } ``` -------------------------------- ### Add flutter_flavorizr to dev_dependencies Source: https://github.com/angeloavv/flutter_flavorizr/blob/master/README.md Add flutter_flavorizr to your pubspec.yaml file under dev_dependencies. This package is intended for development support. ```yaml dev_dependencies: flutter_flavorizr: ^2.4.2 ``` -------------------------------- ### Using F Class in App Widget Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt Access flavor-specific data like F.title and F.name within your Flutter widgets to customize behavior and UI elements. ```dart // lib/app.dart - Using F class for flavor-specific behavior import 'package:flutter/material.dart'; import 'flavors.dart'; class App extends StatelessWidget { const App({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: F.title, theme: ThemeData(primarySwatch: Colors.blue), home: Scaffold( appBar: AppBar(title: Text(F.title)), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Current Flavor: ${F.name}'), Text('App Title: ${F.title}'), if (F.appFlavor == Flavor.development) const Text('Debug Mode Enabled', style: TextStyle(color: Colors.red)), ], ), ), ), ); } } ``` -------------------------------- ### Generated Flavor Enum and F Class Source: https://context7.com/angeloavv/flutter_flavorizr/llms.txt This enum and class are generated by Flavorizr to manage flavor definitions and provide access to flavor-specific properties like name and title. ```dart // lib/flavors.dart (generated by Flavorizr) enum Flavor { development, staging, production, } class F { static late final Flavor appFlavor; static String get name => appFlavor.name; static String get title { switch (appFlavor) { case Flavor.development: return 'My App Dev'; case Flavor.staging: return 'My App Staging'; case Flavor.production: return 'My App'; } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.