# GitLab

- Tool: FlutterFlow
- Difficulty: Intermediate
- Time required: 45 minutes
- Last updated: July 2026

## TL;DR

Connect FlutterFlow to GitLab by first enabling FlutterFlow's built-in GitHub integration (Pro plan required), pushing your project to a GitHub repository, then setting up a GitLab pull mirror that imports every FlutterFlow commit automatically. From there, a .gitlab-ci.yml pipeline with a Flutter Docker image handles testing and building your app.

## Why There Is No Native FlutterFlow → GitLab Connection

FlutterFlow's philosophy is to handle source control through its built-in GitHub integration: when you push your project from FlutterFlow it commits the generated Flutter code to a GitHub repository with a single click. GitLab is not a supported target, and there is no 'Connect GitLab' button anywhere in FlutterFlow's settings. The only honest path to GitLab is through GitHub as an intermediary.

The good news is that GitLab has a first-class repository mirroring feature that makes this straightforward. You point a GitLab project at the GitHub repository FlutterFlow writes to, and GitLab checks for new commits periodically (or immediately when triggered) and imports them. From GitLab's perspective the Flutter project looks like any Flutter repo it hosts natively, so your full CI/CD tooling — .gitlab-ci.yml pipelines, container registry, merge request approvals, environments — works without any special configuration.

The setup involves three tools: FlutterFlow (Pro plan for export), GitHub (hosts the generated Flutter project), and GitLab (mirrors it and runs CI). The flow is always one-directional: FlutterFlow → GitHub → GitLab. Edits made directly in GitLab or in a local branch pushed to GitLab will not flow back to FlutterFlow and will be overwritten the next time FlutterFlow exports. Keep FlutterFlow as the source of truth for all visual changes, and use GitLab purely for CI/CD, security scanning, and deployment pipelines.

## Before you start

- FlutterFlow Pro plan ($70/month) — the GitHub export integration requires Pro; Free and Standard plans cannot push code
- A GitHub account and an empty GitHub repository to receive FlutterFlow's exports
- A GitLab account (GitLab Free tier is sufficient for mirroring and basic CI)
- A GitHub Personal Access Token (PAT) with repo scope — needed for GitLab to mirror a private GitHub repository
- Basic familiarity with YAML files for writing the .gitlab-ci.yml pipeline configuration

## Step-by-step guide

### 1. Connect FlutterFlow to GitHub and push the initial Flutter project

FlutterFlow's GitHub integration is the only supported way to get your project code out of the browser editor and into a Git host. Open your FlutterFlow project and navigate to Settings (gear icon) → Integrations → GitHub. Click Connect GitHub, which opens an OAuth authorization flow — approve access for your GitHub account or organization. After authorization, FlutterFlow asks you to choose a repository: you can let FlutterFlow create a new repo, or select an existing empty one. For a GitLab mirror setup, create a dedicated GitHub repo like `my-app-flutterflow` so it has a clear purpose. Once connected, click Push to GitHub (the GitHub icon in the top toolbar will now be active). FlutterFlow generates the entire Flutter project — all Dart files, pubspec.yaml, platform folders — and commits it to the `main` branch of your GitHub repository. This initial commit is the foundation the GitLab mirror will pull from. Verify the push worked by opening your GitHub repository in a browser: you should see a standard Flutter project structure with lib/, android/, ios/, web/, and pubspec.yaml at the root. Going forward, every time you make changes in FlutterFlow and click the Push to GitHub button, a new commit appears in this repository.

**Expected result:** Your FlutterFlow project's Flutter code is visible in a GitHub repository, with a standard Flutter project structure committed to the main branch.

### 2. Create a GitLab project and configure a pull mirror from GitHub

Log into GitLab (gitlab.com or your self-hosted instance) and create a new blank project with any name — for example, `my-app-gitlab`. Do not initialize it with a README since the mirror will provide all content. Once the blank project is created, open the project's left sidebar and navigate to Settings → Repository. Scroll down to the Mirroring repositories section and click Expand. Click the Add new mirror button (the label may say 'Add a mirror' depending on your GitLab version). In the Git repository URL field, paste the HTTPS clone URL of your GitHub repository — it looks like `https://github.com/your-username/my-app-flutterflow.git`. Set the Mirror direction to Pull (GitLab pulls FROM GitHub). If your GitHub repository is private — which it should be, since FlutterFlow commits your entire app code — you need to authenticate: in the Authentication section, select Personal access token and paste a GitHub Personal Access Token (PAT) with at least repo read scope. You can generate a PAT in GitHub → Settings → Developer Settings → Personal access tokens → Fine-grained tokens. Check the box for Mirror only protected branches if you want to limit what syncs. Click the Save button. GitLab will immediately attempt an initial mirror sync — you can click the refresh icon next to the mirror entry to trigger it manually. After a minute, refresh your GitLab project's repository view: you should see the same Flutter project files that are in GitHub.

**Expected result:** The GitLab project's repository tab shows the same Flutter project files that FlutterFlow pushed to GitHub — the mirror is active and synced.

### 3. Add a GitHub Personal Access Token for private-repo mirroring

If your GitHub repository is public you can skip this step, but a private repository is strongly recommended since your Flutter source code may contain logic you don't want exposed. The GitLab mirror needs read access to your GitHub repo. In GitHub, go to your account avatar in the top-right → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token. Give it a descriptive name like "GitLab mirror for FlutterFlow app." Set the Expiration to a reasonable period (90 days or 1 year, then set a calendar reminder to rotate it). Under Repository access, select Only select repositories and choose the specific FlutterFlow GitHub repo. Under Permissions, grant Contents: Read-only — this is the minimum required for mirroring. Click Generate token and copy it immediately (it won't be shown again). Go back to your GitLab project → Settings → Repository → Mirroring repositories, click Edit on the mirror you created, and paste the token in the Password or Token field. Save. Test by clicking the sync icon — if the mirror shows a green checkmark, authentication is working. If it shows a red error, double-check that the PAT has access to the correct repository and that you copied it without extra spaces.

**Expected result:** The GitLab mirror entry shows a green status badge, confirming it can authenticate with GitHub and pull commits successfully.

### 4. Write a .gitlab-ci.yml pipeline that runs flutter test and builds the app

Now that GitLab has your Flutter project via the mirror, you can run CI/CD pipelines on it. Create a file called `.gitlab-ci.yml` at the root of your GitLab repository. The key challenge for Flutter CI on GitLab is that the default runner images don't include the Flutter SDK — you need to specify a Docker image that has Flutter pre-installed. The most commonly used image is `ghcr.io/cirruslabs/flutter:stable` (published by Cirrus CI and widely used in the community). Your pipeline needs at least two jobs: a test job that runs `flutter test` to validate the app, and optionally a build job that compiles `flutter build web --release` or `flutter build apk --release`. Keep secrets (signing keystores, API keys) in GitLab CI/CD variables (Settings → CI/CD → Variables) — never commit them to the repository. Reference them in the pipeline as `$VARIABLE_NAME`. The pipeline triggers automatically on every commit that the mirror syncs from GitHub, which means every FlutterFlow export that triggers a Push to GitHub will also trigger your GitLab CI pipeline within minutes.

```
# .gitlab-ci.yml — Flutter CI pipeline for a FlutterFlow-exported project

image: ghcr.io/cirruslabs/flutter:stable

stages:
  - test
  - build

# Cache pub packages between pipeline runs to speed up jobs
cache:
  key: "flutter-pub-cache"
  paths:
    - .pub-cache/

variables:
  PUB_CACHE: "$CI_PROJECT_DIR/.pub-cache"

before_script:
  - flutter --version
  - flutter pub get

flutter_test:
  stage: test
  script:
    - flutter analyze
    - flutter test --coverage
  artifacts:
    when: always
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura.xml

build_web:
  stage: build
  script:
    - flutter build web --release
  artifacts:
    paths:
      - build/web/
    expire_in: 1 week
  only:
    - main
```

**Expected result:** A GitLab pipeline appears under CI/CD → Pipelines, showing the flutter_test and build_web jobs running automatically against the mirrored FlutterFlow code.

### 5. Verify the end-to-end flow and set GitLab pipeline notifications

Test the complete pipeline by making a visible change in FlutterFlow — for example, changing a text label on one of your screens — then clicking the Push to GitHub button in FlutterFlow. Wait up to 5 minutes for GitLab's mirror polling interval to pick up the new commit (or click the sync icon in GitLab → Settings → Repository → Mirroring repositories to trigger an immediate sync). Once the commit appears in your GitLab project's repository, navigate to CI/CD → Pipelines — you should see a new pipeline triggered by the mirrored commit. Click into the pipeline to watch the individual jobs run: the test job will run `flutter analyze` and `flutter test`, and the build job will compile the web artifact. If everything is green, the integration is fully working. To stay informed about pipeline results, set up GitLab email notifications: go to your GitLab account → Notifications and set the notification level for this project to only failed pipelines (so you get alerted when a FlutterFlow export breaks a test, without getting spammed on every successful run). You can also connect GitLab to Slack via Settings → Integrations → Slack Notifications for team-wide alerts.

**Expected result:** A FlutterFlow export triggers a commit in GitHub, which mirrors to GitLab within minutes and automatically starts the CI pipeline — the full one-way pipeline is working end-to-end.

## Best practices

- Keep the GitHub repository that FlutterFlow writes to private — it contains your full app source code including any custom action logic.
- Never commit google-services.json, keystores, or API keys into the GitHub or GitLab repository — store them as GitLab CI/CD variables and reference them in the pipeline as $VARIABLE_NAME.
- Add .gitlab-ci.yml directly in GitLab (not in the GitHub repo) so FlutterFlow exports can never overwrite your pipeline configuration.
- Rotate the GitHub Personal Access Token used for mirroring before it expires — set a calendar reminder at creation time to avoid silent CI failures.
- Use GitLab's protected branches feature to prevent the mirror from overwriting a production branch accidentally — mirror only to main and deploy from there through a merge request flow.
- Cache the .pub-cache directory in your pipeline to speed up subsequent runs; the first run fetches all Flutter packages, but cached runs are significantly faster.
- Use GitLab CI/CD environments (Settings → CI/CD → Environments) to track which FlutterFlow export version is deployed to staging vs production.
- Add flutter analyze to your pipeline before flutter test — it catches type errors and deprecation warnings in the generated Dart code that tests alone won't catch.

## Use cases

### Running automated flutter test on every FlutterFlow export

Every time a designer exports a new version of the FlutterFlow project, the commit is mirrored to GitLab, triggering a pipeline that runs flutter test and blocks a deployment if widget tests fail. This gives an engineering team a quality gate they can't get inside FlutterFlow alone.

Prompt example:

```
Set up GitLab CI to run flutter test on every FlutterFlow commit that arrives via the GitHub mirror, and block deployment if any tests fail.
```

### Building and distributing Android APKs through GitLab CI/CD

Your company's IT team has GitLab runners and uses GitLab's package registry. Each FlutterFlow export triggers a pipeline that compiles an Android APK, signs it with a keystore stored in GitLab CI variables, and uploads it to the GitLab package registry for internal distribution.

Prompt example:

```
Write a .gitlab-ci.yml that builds a signed release Android APK from the FlutterFlow export, using the keystore from CI variables, and uploads the artifact to GitLab.
```

### Running security scanning on the generated Flutter codebase

Your enterprise requires static analysis on all code before it reaches production. GitLab's SAST and dependency scanning jobs run automatically on each mirrored FlutterFlow commit, flagging vulnerable packages or hardcoded credentials in the generated Dart.

Prompt example:

```
Enable GitLab SAST and dependency scanning on the mirrored FlutterFlow Flutter project to catch security issues in the generated code before deployment.
```

## Troubleshooting

### GitLab mirror shows a red error badge with "Authentication failed" after setup.

Cause: The GitHub Personal Access Token entered in the GitLab mirror configuration is incorrect, expired, or does not have read access to the repository.

Solution: Go to GitHub → Settings → Developer settings → Personal access tokens and generate a new token with repo read scope for the specific FlutterFlow repository. In GitLab → Settings → Repository → Mirroring repositories, click Edit on the mirror entry and paste the new token in the Password field. Save and click the sync icon to retry. Confirm the token is for the correct GitHub account that owns the repository.

### Expected a 'Connect GitLab' button in FlutterFlow's Settings → Integrations, but it doesn't exist.

Cause: FlutterFlow has no native GitLab integration. Its only Git target is GitHub. The button simply does not exist.

Solution: This is expected behavior — the GitHub-to-GitLab mirror workaround described in this guide is the only supported path. First connect FlutterFlow to GitHub (Settings → Integrations → GitHub), push the project there, then set up the GitLab mirror as described in step 2. There is no shortcut.

### GitLab CI pipeline fails with: "Could not find a file named 'pubspec.yaml' in the current directory" or "flutter: command not found".

Cause: Either the pipeline is running in the wrong working directory, or the Docker image specified in .gitlab-ci.yml doesn't have Flutter installed.

Solution: Confirm the image line in .gitlab-ci.yml is `image: ghcr.io/cirruslabs/flutter:stable` — that image includes the Flutter SDK. Also verify that `flutter pub get` is in your `before_script` and is running before any flutter commands. If you get the pubspec.yaml error, your repository might have a non-standard structure from the FlutterFlow export — check that pubspec.yaml is at the root of the repo and not inside a subdirectory.

### A CI/CD pipeline commit pushed from GitLab was overwritten by the next FlutterFlow mirror sync.

Cause: The GitHub-to-GitLab mirror is a read-only pull mirror — commits made directly in GitLab are not pushed back to GitHub. When FlutterFlow exports again and mirrors to GitLab, it force-updates the mirror, overwriting GitLab-only commits.

Solution: Never commit application code changes directly in GitLab for files that FlutterFlow generates. The only file safe to commit directly in GitLab is .gitlab-ci.yml, because FlutterFlow exports don't include it. For all other code changes, make them in FlutterFlow, push to GitHub, and let the mirror carry them to GitLab.

## Frequently asked questions

### Does FlutterFlow have a native GitLab integration?

No. FlutterFlow's only built-in Git integration targets GitHub. GitLab is reached through a repository mirror: FlutterFlow pushes to GitHub, and GitLab pulls from GitHub automatically. There is no 'Connect GitLab' button in FlutterFlow's settings, and one is not announced for the near future.

### How often does the GitLab mirror sync commits from GitHub?

GitLab's pull mirror polls for new commits approximately every 5 minutes on the free tier. You can trigger an immediate sync by clicking the sync icon in Settings → Repository → Mirroring repositories. GitLab Premium reduces the polling interval further. For near-instant sync, configure a GitHub webhook that calls GitLab's mirror trigger API after each push.

### Can I push code changes from GitLab back to FlutterFlow?

Not directly. The mirror is one-way: FlutterFlow → GitHub → GitLab. Changes committed in GitLab will be overwritten by the next FlutterFlow export via mirror. The only sustainable workflow is FlutterFlow as the source of truth for generated code, and GitLab as the CI/CD runtime. Custom action Dart files should be edited in FlutterFlow's Custom Code editor, not in the GitLab repository.

### What Flutter Docker image should I use for GitLab CI?

The most widely used image for Flutter on GitLab CI is `ghcr.io/cirruslabs/flutter:stable`, published by Cirrus CI. It includes the full Flutter SDK, Dart, and the necessary build tools. Specify it at the top of your .gitlab-ci.yml with `image: ghcr.io/cirruslabs/flutter:stable`. You can pin a specific Flutter version by replacing `stable` with a version tag like `3.22.0`.

### Can I build iOS IPA files from the GitLab pipeline?

Building iOS apps requires a macOS runner with Xcode installed, which GitLab's free shared runners don't provide (they run Linux). You would need to register a self-hosted GitLab runner on a Mac, or use a third-party CI service like Codemagic or Bitrise that specializes in mobile CI. For Flutter web and Android APK builds, the Linux runners with the Flutter Docker image work fine.

---

Source: https://www.rapidevelopers.com/flutterflow-integrations/gitlab
© RapidDev — https://www.rapidevelopers.com/flutterflow-integrations/gitlab
