call 0.1.0 call: ^0.1.0 copied to clipboard
Flutter - Calling dynamic link library through `assets` static resources.
call #
Flutter - Calling native libraries(dynamic link library) through assets
static resources.
Support:
Platforms: Windows, Linux, MacOS.
Mode: Debug and Release.
(PS: Android and IOS don't need this to easily call native libraries)
Click me to lookup the doc on GitHub.
First #
Write your C-code, and compile it to a dylib. Example:
gcc -shared -fPIC -o libadd.dll main.c
Second #
You should declare path of the dylib in the pubspec.yaml
file as images.
Third #
Let's write some easy flutter code to test it.
Fourth #
I use the Windows OS now, and run the app by flutter run -d Windows
.
Finally, you can see the number, 100!!!