Flutter Rust Bridge (FRB) Template App
FRB Template App - Integrating Rust with Flutter.
I would like to showcase the Flutter Rust Bridge Template app in this chapter. It's from one of the main contributors of the Flutter Rust Bridge, Viet Dinh.
π Β Flutter Rust Bridge Template on Github
This chapter is intended as an additional exercise to become more acquainted with integrating Rust into a Flutter project, without the added complexity of integrating with IOTA.
Additionally, this chapter will cover the configuration steps for macOS and iOS, and as a consequence, it will introduce a modified workflow.
I will start this project from scratch and only take the necessary code from the FRB repository.
From the "straight forward" to a "modified" workflow
Remember the workflow used in the introduction chapter How everything works together.
You can simply list all the steps one after the other in a straight forward workflow.
This works for Android.
When working on macOS and iOS, you may encounter a Chicken and Egg problem, which is not a serious issue but may result in error messages that we would like to avoid.
The issue at hand is that the setup for FRB requires configuring a C header file that contains a list of all the exported symbols from the Rust library. However, this header file does not yet exist during the setup process. It will only be generated later when the Dart interface is generated.
To resolve this issue, I combine the Initialization and Development steps.
The Step about Setting up the Flutter Rust Bridge is now separated into two parts.
I will be following the modified workflow in the upcoming subchapters. There are platform specific instructions for setting up the FRB on Android, macOS, and iOS. However, there are also some general steps that apply to all target platforms, which I will cover before and after the specific subchapters.
To create the FRB example app successfully, it's important to follow each subchapter in order, starting from the beginning and moving forward.