- Android, Windows and Linux (More possible) support
- FFI
- Dart to C++
- C++ to Dart
- JSON Compatible
- State Management
- Tab Controller
- A* Path Generation
- Key-value data persistence
- More sample UI stuff
- Automated Linux release
- Go through all steps on new machine to validate!!!
- Make it's own directory,
UI
- Make a simple navigator using the DefaultTabController
- Create a simple BLoC structure
- Download
json.hpp
and put injson_library\src
- Create a bridge C++ class (Don't know if that is best practice or not... new to this) and
.def
file - Create
json_library\CMakeLists.txt
and a build/generator script - Create root level
.gitignore
for*library/bin
and*library/build
- Download the contents of the
json_library\src\dart
directory from the dart-lang repo - Add
Dart_InitializeApiDL
to the.def
file - Make some test functions in
*bridge.cpp
and include them in*bridge.hpp
and the.def
file - Add
C
as a a language tojson_library\CMakeLists.txt
- Look for
*.c
and*.h
files injson_library\CMakeLists.txt
- Implement the
ReceivePort
and required funtions inUI\lib\native_json.dart
as per this comment - Add
../json_library/src/dart/dart_api_dl.h
to entry points inUI\config.yaml
- Update
UI\android\app\CMakeLists.txt
in the same way
- Download and install CMake and make sure to add to path during installation
- Download and install VS2022 Build Tools
- Open PowerShell and run
where.exe /R C:\ msbuild
and confirm thatC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
is present - Add
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
to Environment Variables PATH winget install -e --id LLVM.LLVM
(For dart ffigen)- Restart any open shells
- Configure Flutter project for ffigen
- Add
ffigen
todev_dependencies
inUI\pubspec.yaml
- Create
UI\config.yaml
based off the file in this repo - Create empty
UI\lib\generated_bindings.dart
- Add
- run
json_library\build.bat
- Create wrapper like
UI\lib\native_json.dart
These steps assume that you have completed the windows specific steps above and also have a working Android Studio installation / android mobile emulator.
- Add
**/.cxx
toUI\android\.gitignore
- Setup CMake for Android
where.exe cmake
in PowerShell should yieldC:\Program Files\CMake\bin\cmake.exe
- Update
UI\android\local.properties
by addingcmake.dir=C:\\Program Files\\CMake
(Make sure not to have trailing slashes or bin!)
- Update
UI\android\build.gradle
by adding:android { ... externalNativeBuild { cmake { path = file("CMakeLists.txt") } } }
- (Not sure if necessary) Update beginning of
UI\android\app\src\main\AndroidManifest.xml
with:<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <application ... android:extractNativeLibs="true" tools:replace="android:extractNativeLibs"> </application>
- Create
UI\windows\CMakeLists.txt
based off the file in this repo
Install the manual way, not using snap
. Huge speed decrease with snap
.
sudo apt install cmake clang lldb lld
cd json_library/
./build.sh
(Notsudo
or paths will be wrong!)
- Ubuntu Android Studio
- Linux Android Studio (Haven't tried this method)