Releasing Flutter projects on GitHub

If you’re working on a Flutter project and want to distribute it on GitHub, this article will guide you through the process.

·

4 min read

Flutter is a popular open-source framework for building high-performance, high-fidelity mobile, web, and desktop applications. If you’re working on a Flutter project and want to distribute it on GitHub, this article will guide you through the process.

In this article, I will use NetShare as an example project. NetShare is an open-source Flutter project that makes it easy to share data in a local network. The latest release includes support for Android, macOS, Windows, and Linux platforms.

Android

  1. Prepare the app icon by using your preferred design tool. You can use Adobe Illustrator to export a high-quality PNG icon and then use Android Studio to generate all density icons. For more information, see the official Create App Icons documentation.

  2. Open android project (inside flutter project) on Android Studio and add the app icon.

  3. Set up the release configuration/key per the guideline provided in the official Flutter documentation.

  4. Build the release APK from the console on the Flutter project root directory: flutter build apk

  5. Upload the release APK to the Release on your GitHub project.

macOS

  1. Design your app icon by using your preferred design tool. And then you may use appicon.co to generate all density icons.

  2. Open the macOS project and update the AppIcon on XCode. Check official Apple documentation for more details.

  3. Build the project from the console on the Flutter project root directory: flutter build macos. Sometimes, the old icon may be cached, and you need to run `flutter clean before building the app.

  4. On XCode, go to Product > Archive.

  5. Once the archive is finished, click on Distribute App.

  6. Select the method of distribution as Copy App

  7. Compress the app to a zip file and upload it to Release on your GitHub project.

Windows

  1. Update the app icon at windows\runner\resources\app_icon.ico

  2. Change the app name at windows\runner\main.cpp

  3. Execute flutter build windows

  4. Download and install Inno Setup

  5. Open Inno Setup, create a new app, and follow step-by-step with protocoderspoint’s tutorial

  6. Upload the output file to the Release on your GitHub project.

You may also want to try the MSIX distribution by following the official Flutter guideline.

Linux

Flutter apps can also be distributed on Linux using the Debian package format. To create a Debian package, we can use the flutter_to_debian package.

  1. Follow the instructions in the flutter_to_debian package documentation at https://pub.dev/packages/flutter_to_debian.

  2. Add flutter_to_debian to your system PATH by running the following command in your terminal:

export PATH="$PATH":"$HOME/.pub-cache/bin"
  1. Run flutter_to_debian from your Flutter project directory
huynq@ubuntu:~/Documents/WIP/netshare$ flutter_to_debian

checking for debian 📦 in root project...  ✅

start building debian package... ♻️  ♻️  ♻️

No skeleton found
🔥🔥🔥 (debian 📦) build done successfully  ✅

😎 find your .deb at
debian/packages/NetShare_2.0.0_amd64.deb
  1. Test the output by installing it locally using the dpkg command:
sudo dpkg -i NetShare_2.0.0_amd64.deb
  1. If the installation is successful and the app works as expected, upload output file to Releases on your GitHub project.

iOS

iOS distribution requires an Apple developer account. Instead, publishing app to the AppStore could be an option. Please see the guidelines at Build and release an iOS app for specific steps.

Web

Web is easy to distribute since there are various ways to do it. You could use Firebase hosting or other hosting services to host built web content.

  1. Execute flutter build web. There are two renderers html and canvaskit that you can choose (see web renderers for more details).

  2. Check the output result locally with your local web server (node/python/…). I use Python server as an example:

cd build/web
python -m http.server 8000

This will start a web server at http://localhost:8000 that serves the output files in the build/web directory.

  1. Deploy web by your favorite service (see deploy-to-the-web).

Conclusion

In this article, we have walked through the steps of releasing a Flutter project on GitHub. Each platform requires specific configuration and tooling, but with the appropriate guidelines and references, you can distribute your app on any platform you choose. By following these guidelines and distributing your Flutter project on GitHub, you can reach a wider audience and make your project accessible to others.

Thank you for reading this article, and I hope that it will be helpful in guiding you through the process of releasing your Flutter project on GitHub.

Also, if you are interested in the NetShare project, please keep up with the progress by following project on Github and Twitter:

Thanks for reading!