Skip to content

Building SEGUL GUI from source

For most users, building the GUI version from source may not be necessary. However, this guide is useful if you wish to contribute to the project or build similar apps.

The GUI version of SEGUL is built using the Flutter framework. We use Dart as the programming language for the GUI. The Dart code communicates with the SEGUL core library via a foreign function interface (FFI). We simplify this process by using the Flutter Rust Bridge (FRB) library that generates the FFI code for us. Learn more about the SEGUL architecture here.

To build the GUI version of SEGUL, install the following tools:

Follow the instructions to install Flutter here. It will also guide you to install Android Studio and other required dependencies.

Install Rust with rustup. SEGUI builds its Rust library through Flutter native assets, which requires rustup. The rust/rust-toolchain.toml file pins the Rust version and targets, and rustup installs them on the first build. Flutter then compiles the Rust library during flutter run, flutter test, and flutter build, so the first build takes several minutes.

Follow the instructions to install Flutter Rust Bridge (FRB) here. We use FRB v2. You will need to install the CLI tool through Cargo and the FRB package for Flutter. Keep in mind that the version of the FRB CLI tool and the FRB package must match.

We use GitHub CLI tool here.

Terminal window
gh repo clone hhandika/segui

If you are using git:

Terminal window
git clone https://github.com/hhandika/segui.git

Then, change the directory to segui directory. Install Flutter dependencies:

Terminal window
cd segui
flutter pub get
Terminal window
flutter run
Terminal window
flutter build windows --release

You need to have a macOS machine and Xcode installed to build for Apple Devices.

Follow the instructions to install Xcode here.

Terminal window
flutter build macos --release
Terminal window
flutter build ios --release

Follow the instructions to install Linux dependencies here.

Terminal window
flutter build linux --release
Terminal window
flutter build apk --release

This material is based upon work supported by the National Science Foundation under grant numbers: DEB-1754393 and DEB-2244754. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.