{
    "url": "https://delaparra-services.nl/nl/skills/flutter-run",
    "locale": "nl",
    "title": "Flutter-buildflavors | DeLaParra Services",
    "description": "Een Flutter-buildflavor is een benoemde buildvariant voor een platform, vaak bedoeld voor verschillende appomgevingen.",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/flutter-run",
        "nl": "https://delaparra-services.nl/nl/skills/flutter-run"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/nl/skills/flutter-run.csv",
        "md": "https://delaparra-services.nl/nl/skills/flutter-run.md",
        "json": "https://delaparra-services.nl/nl/skills/flutter-run.json",
        "zip": "https://delaparra-services.nl/nl/skills/flutter-run.zip",
        "pdf": "https://delaparra-services.nl/nl/skills/flutter-run.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/nl/skills/flutter-run.csv",
            "encodingFormat": "text/csv",
            "name": "flutter-run.csv"
        },
        {
            "url": "https://delaparra-services.nl/nl/skills/flutter-run.json",
            "encodingFormat": "application/json",
            "name": "flutter-run.json"
        },
        {
            "url": "https://delaparra-services.nl/nl/skills/flutter-run.md",
            "encodingFormat": "text/markdown",
            "name": "flutter-run.md"
        },
        {
            "url": "https://delaparra-services.nl/nl/skills/flutter-run.pdf",
            "encodingFormat": "application/pdf",
            "name": "flutter-run.pdf"
        },
        {
            "url": "https://delaparra-services.nl/nl/skills/flutter-run.zip",
            "encodingFormat": "application/zip",
            "name": "flutter-run.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-run/download",
            "encodingFormat": "application/zip",
            "name": "flutter-run-files.zip"
        }
    ],
    "markdown": "# Flutter-buildflavors\n\n \n\nEen Flutter-buildflavor is een benoemde buildvariant voor een platform, vaak bedoeld voor verschillende appomgevingen.\n\n \n\n**Licentie** MIT\n\n \n\n**Bron** gabuldev/flutter-skills\n\n [Download zip](<https://delaparra-services.nl/skills/flutter-run/download>)   \n\nYou are running or building a Flutter app. The core idea of this skill: **a bare ` flutter run ` is almost never the right command in a real project.** Flavors, ` --dart-define `s and the Flutter version all have to line up, and remembering them by hand is where the lost afternoons come from.\n\n \n\n## Put a task runner in front of ` flutter `\n\n \n\nMake the repo's ` Makefile ` (or melos script, or ` just ` file) the source of truth for how each app is launched, and run *that*. It is the only way the flags stay consistent between your machine, a teammate's, and CI.\n\n \n\nA shape that works for a multi-app monorepo:\n\n \n\n```\nmake setup                                  # pin Flutter (FVM) + bootstrap deps\nmake secrets ENV=dev PROJECT=<app>          # fetch secrets → .secrets.<app>.<env>.json (gitignored)\n\nmake dev PROJECT=<app>                      # web (Chrome), ENV=dev\nmake dev PROJECT=<app> PLATFORM=android     # Android, flavor applied automatically\nmake build PROJECT=<app> ENV=prod           # release build\n```\n\n \n\nPin the SDK with **FVM** (` fvm flutter ... `) and commit ` .fvmrc `. \"Works on my machine\" in Flutter is usually two different SDK minors.\n\n \n\n## Configuration: ` --dart-define `, and the file form\n\n \n\nApp config should reach the binary through ` --dart-define `, read back with ` String.fromEnvironment `:\n\n \n\n```\nclass AppEnv {\n  static const baseURL = String.fromEnvironment('BASE_URL');\n  static const appName = String.fromEnvironment('APP_NAME');\n  static const apiKey  = String.fromEnvironment('X_API_KEY');\n}\n```\n\n \n\n` String.fromEnvironment ` is **const** and resolved at compile time. Two consequences that bite:\n\n \n\n- A missing define is not an error — it is the empty string. An app that \"can't reach the backend\" is very often an empty ` BASE_URL `, not a network problem. \n- Changing a define requires a rebuild, not a hot reload.\n\n \n\nPass many values at once with ` --dart-define-from-file ` instead of a long chain of flags:\n\n \n\n```\nflutter run --dart-define-from-file=.secrets.myapp.dev.json\n```\n\n \n\nKeep ` .secrets.*.json ` **gitignored** and generate it from your secret manager (Doppler, 1Password, Vault, ` gcloud secrets `) in a ` make secrets ` target. Have the task runner fall back to a couple of safe public defines when the file is absent, and **print a loud warning** — a silent fallback produces an app that launches and then misbehaves in ways that look like application bugs.\n\n \n\n## Android flavors\n\n \n\nIf the app declares product flavors, a ` flutter run ` without ` --flavor ` **fails outright** — ` flutter run ` cannot pick one for you. Have the task runner supply a sensible default and let it be overridden:\n\n \n\n```\nmake dev PROJECT=<app> PLATFORM=android                    # default flavor\nmake dev PROJECT=<app> PLATFORM=android FLAVOR=<other>     # pin one\n```\n\n \n\nWhere a flavor encodes more than one axis (device model × payment acquirer, free × paid, region), name it ` <axisA><AxisB> ` and **derive the matching ` --dart-define ` from the flavor name** in the task runner rather than asking the caller to keep two flags in sync. Apps with no flavors must not be passed ` --flavor ` at all.\n\n \n\n## Device selection\n\n \n\n- Web → ` -d chrome ` (` -d web ` is not a device id; that error is common). \n- Android/iOS with exactly one device attached → let Flutter auto-select. \n- More than one → pin it: ` flutter devices ` to list, then ` -d <id> `.\n\n \n\nConfirm the device is actually visible before debugging anything else — USB debugging off, or an unauthorized adb prompt on the device, looks identical to a broken toolchain.\n\n \n\n## Quality commands\n\n \n\n```\nflutter analyze\ndart format .          # NOT `flutter format` — removed in Flutter 3.38\nflutter test\nflutter clean          # first thing to try on an inexplicable build failure\n```\n\n \n\nIn a melos monorepo, run these across packages with ` melos exec -- <cmd> `.\n\n \n\n## Troubleshooting\n\n    Symptom Likely cause Fix     App runs but no data, login fails ` BASE_URL ` define empty or pointing at a dead/old backend Run through the task runner so defines are injected; verify the URL the app compiled with   Feature that needs a secret misbehaves, ids come back empty Only the fallback defines were passed, the rest are ` \"\" ` Generate the secrets file so ` --dart-define-from-file ` injects everything   Android build: \"flavor must be specified\" Bare ` flutter run ` on a multi-flavor app Pass ` --flavor `, or use the task-runner target that does   ` flutter format ` → \"Could not find a command named format\" Removed in Flutter 3.38 Use ` dart format . `   Device not found / ` -d web ` fails ` web ` is not a device id Use ` -d chrome `; ` flutter devices ` to list real ids   Blank white page on web after changing a path dependency Stale incremental web build ` rm -rf build/web ` and rebuild — see **flutter-web**   Works locally, breaks in CI SDK version drift Pin with FVM and commit ` .fvmrc `    \n\n## Rules\n\n \n\n1. Prefer the repo's task-runner target over a hand-typed ` flutter run `. \n1. Never commit the secrets file; generate it, and gitignore the pattern. \n1. A fallback for missing config must warn loudly, never fail silently. \n1. Pin the Flutter SDK version in the repo. \n1. Changing a ` --dart-define ` needs a rebuild — hot reload will not pick it up.\n\n \n\n## Bestanden\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md `\n\n \n\n## Gerelateerde termen\n\n \n\n- [Flutter-buildflavors](<https://delaparra-services.nl/nl/kennisbank/flutter-build-flavors>)\n\n \n\n## Gerelateerde diensten\n\n \n\n- [App-ontwikkeling](<https://delaparra-services.nl/nl/services#service-02>)\n\n \n\n[Een skill installeren in je AI-assistent](<https://delaparra-services.nl/nl/handleidingen/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/nl/skills/flutter-run)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Maatwerk software, webapplicaties en mobiele apps, ontwikkeld in Laravel door één ontwikkelaar in Groningen. Vaste prijs vooraf, volledige broncode bij oplevering.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, Nederland",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Webdesign en -ontwikkeling",
                    "App-ontwikkeling",
                    "Maatwerk software en webapplicaties",
                    "OpenSpec",
                    "Beoordeling van AI-code",
                    "Je eigen programmeeragent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/nl/skills/flutter-run#webpage",
                "url": "https://delaparra-services.nl/nl/skills/flutter-run",
                "name": "Flutter-buildflavors | DeLaParra Services",
                "description": "Een Flutter-buildflavor is een benoemde buildvariant voor een platform, vaak bedoeld voor verschillende appomgevingen.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "nl",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/nl/skills/flutter-run#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/nl/skills/flutter-run#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/nl"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Flutter-buildflavors"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/nl/skills/flutter-run#skill",
                "url": "https://delaparra-services.nl/nl/skills/flutter-run",
                "name": "Flutter-buildflavors",
                "description": "Een Flutter-buildflavor is een benoemde buildvariant voor een platform, vaak bedoeld voor verschillende appomgevingen.",
                "inLanguage": "nl",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/nl/skills/flutter-run#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/nl/skills/flutter-run#dataset",
                "name": "Flutter-buildflavors",
                "description": "Een Flutter-buildflavor is een benoemde buildvariant voor een platform, vaak bedoeld voor verschillende appomgevingen.",
                "url": "https://delaparra-services.nl/nl/skills/flutter-run",
                "identifier": "https://delaparra-services.nl/nl/skills/flutter-run#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/nl/skills/flutter-run#skill"
                },
                "creditText": "gabuldev/flutter-skills",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "nl",
                "dateModified": "2026-11-30T13:17:19+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/nl/kennisbank#skills",
                    "name": "Skills voor AI-programmeerassistenten",
                    "url": "https://delaparra-services.nl/nl/kennisbank"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/nl/kennisbank#catalog",
                    "name": "Datacatalogus van de kennisbank",
                    "url": "https://delaparra-services.nl/nl/kennisbank"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/nl/skills/flutter-run.csv",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/nl/skills/flutter-run.json",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/nl/skills/flutter-run.md",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/nl/skills/flutter-run.pdf",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/nl/skills/flutter-run.zip",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-run-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-run/download",
                        "inLanguage": "nl",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}