Building Flutter apps

Setting up a Flutter app on Nevercode

This tutorial guides you through setting up your Flutter app on Nevercode. You will need to set up the project just once to build it for both iOS and Android.

Nevercode doesn't require any kind of additional software or configuration files from your side. We’ll scan your repository and from what you have there, our builders find everything they need. You’ll just have to confirm what configuration you want to build.

The guide covers how to:

Add a new app

  1. If this is your very first app on Nevercode, you can immediately move on to the next step and specify your app repository. Otherwise, click Add a new app on Nevercode dashboard.
Nevercode dashboard

Nevercode dashboard

  1. Select the appropriate option for where your app repository is hosted. See Specifying app repository for details.
Connecting your repo

Connecting your repo

If you choose to add the repository manually, see Defining checkout URL and Authenticating repository access for details.

Define build configuration

  1. After specifying the app repository, Nevercode takes a first look at it by listing the branches in your repository. Select a branch from the dropdown that Nevercode should scan for projects. Note that you can change the branch later if needed.
  2. Click Scan branch.
    Nevercode scans the repository from the specified branch. This includes cloning the repository, looking for projects from it and searching for the configurations. All these actions can be monitored real-time from your browser via the live log window.
  3. After the scan is complete, select a project from the Project dropdown.
Configuring build settings

Configuring build settings

  1. Choose which configuration to build. The available options are debug, release and profile.
  2. Select the platform(s) for which you would like to build the app.
  3. Enable the appropriate build options by checking the corresponding boxes.
  4. Finally, click the Save and start build button. Nevercode will start the very first build of your app and you can monitor the real-time logs right in your browser.

For repositories hosted on GitHub, Bitbucket or GitLab, you can also specify the feature branches to be watched for changes.

Define additional settings

Our environment variables and files functionality enables you to fine-tune the settings of your project. Navigate to the Environment tab in your app settings to add the following Flutter-specific variables:

Variable name
Explanation

NC_FLUTTER_VERSION

Flutter version to be checked out (default is latest).

NC_FLUTTER_CHANNEL

Flutter channel to be checked out. Note that when you define both NC_FLUTTER_CHANNEL and NC_FLUTTER_VERSION, we will use the Flutter version specified by NC_FLUTTER_VERSION.

NC_FLUTTER_VERBOSE

Verbose output for Flutter builds.

NC_FLUTTER_ANDROID_FLAVOR

Custom Gradle task to be built.

NC_FLUTTER_IOS_FLAVOR

Custom iOS scheme to be built.

Location of Flutter checkout

Our Flutter checkout is located at $HOME/programs/flutter.

Sign code

The very first version of your app on Nevercode is built without code signing. Navigate to the Code signing tab in your project settings to set up code signing for both platforms. See how to sign your Android binaries and iOS binaries on Nevercode.

Set up Git hooks

By setting up Git hooks, you can have Nevercode automatically build your app every time you push changes to the repository. Please refer to Building automatically (Git hooks) for instructions.

Run tests

Nevercode detects and runs your Flutter tests automatically. As Flutter does not generate a xUnit report that we could parse, we cannot display the test logs on Nevercode's UI. Depending on the test results, you'll be able to see either "tests passed" or "tests failed" in the build log.

Publish build artefacts

Your build artefacts will be available on the Artefacts tab in build overview. You can set up Nevercode to automatically publish the artefacts to our supported distribution channels.

Manage build versions

To make your build version management easy, Nevercode exports two environment variables that you can use in your build scripts: NEVERCODE_BUILD and NEVERCODE_BUILD_NUMBER. You can read more about it from Incrementing Android app version.

Other configuration

See also how to: