call 0.2.2 call: ^0.2.2 copied to clipboard
Calling dynamic link library(native function) in the way of defining static resources. You can use the package to open the dylib defined in the `assets` field of `pubsepc.yaml`.
call #
You can use the package to open the dylib defined in the assets
field of pubsepc.yaml
.
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 whole 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!!!