/flutter_flavors_by_dart_define

🍦 How to use Flavors using Dart Define.

Primary LanguageDart

Flutter Flavors by Dart Define 🍦


Flavor - iOS Flavor - Android


About this app 🗣

A simple app showing how to use Flavors using Dart Defines (Thanks DeividWillyan for this helper) and show a flavor banner.

Flavor - Dev

flutter run --dart-define=DEFINE_APP_NAME='[DEV] App Flavor' --dart-define=DEFINE_APP_SUFFIX=.dev 

Flavor - iOS

Flavor - QA

flutter run --dart-define=DEFINE_APP_NAME='[QA] App Flavor' --dart-define=DEFINE_APP_SUFFIX=.qa

Flavor - iOS

Prod (no flavor)

Flavor - iOS

Running on VsCode (launch.json)

If you wanna run this app on vsCode, just Copy/Paste this code bellow on your launch.json on vsCode:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch development",
            "request": "launch",
            "type": "dart",
            "args": [
                "--dart-define",
                "DEFINE_APP_NAME=[DEV] App Flavor",
                "--dart-define",
                "DEFINE_APP_SUFFIX=.dev"
            ],
        },
        {
            "name": "Launch qa",
            "request": "launch",
            "type": "dart",
            "args": [
                "--dart-define",
                "DEFINE_APP_NAME=[QA] App Flavor",
                "--dart-define",
                "DEFINE_APP_SUFFIX=.qa"
            ],
        },
        {
            "name": "Launch production",
            "request": "launch",
            "type": "dart"
        }
    ]
}

Tech Stack 👩🏾‍💻

Plugins 📟