This is an example of how to use Flutter Engine Embedder in order to get a Flutter project rendering in a new host environment. The intended audience is people who need to support host environment other than the ones already provided by Flutter. This is an advanced topic and not intended for beginners.
In this example we are demonstrating rendering a Flutter project inside of the GUI library GLFW. For more information about using the embedder you can read the wiki article Custom Flutter Engine Embedders.
The following example was tested on MacOSX but with a bit of tweaking should be able to run on other *nix platforms and Windows.
The example has the following dependencies:
brew install glfw
brew install cmake
In order to build and run the example you should be able to go into this directory and run ./run.sh
.
There are a few things you might have to tweak in order to get your build working:
CMakeList.txt
file you will see that it is setup to search for the header and library for the Flutter Engine in specific locations, those might not be the location of your Flutter Engine.kPixelRatio
variable in FlutterEmbedderGLFW.cc
file.CMakeLists.txt
we are searching for the GLFW library, if CMake can't find it you may have to edit that.