Issue I want to create binding to this C function in dart, this C function accepts a function pointer called progress_monitor: FFI_PLUGIN_EXPORT void* magickSetProgressMonitor(…, const void* progress_monitor,…); where progress_monitor is a function pointer: typedef bool(*MagickProgressMonitor)(const char *,const long long, const
Continue readingTag: dart-ffi
Error: Not found: 'dart:ffi' with flutter web
Issue Read carefully before reporting. My flutter web project was working perfectly fine. A few hours later, it started complaining about ‘dart:ffi: which i didn’t even import. I saw similar questions but none of them were in my case. I
Continue readingHow to create a shared library in android and use it in flutter?
Issue TL;DR I have this C function in meaning_of_life.c: #define FFI_PLUGIN_EXPORT FFI_PLUGIN_EXPORT int getMeaningOfLife(){ return 42; } I tried to compile it to a shared library (.so) using alot of ways but I keep getting errors when I try to
Continue readingHow to return and correctly identify a duplicate enum from C to dart using dart ffi?
Issue I stepped over this enum in C: typedef enum { UndefinedGravity, ForgetGravity = 0, NorthWestGravity = 1, NorthGravity = 2, NorthEastGravity = 3, WestGravity = 4, CenterGravity = 5, EastGravity = 6, SouthWestGravity = 7, SouthGravity = 8, SouthEastGravity
Continue readingHow to use .a file for iOS with Flutter FFI?
Issue I have a rust project. Compiling it to .so for android, I’m able to run it with Android. I have also generated .a file for iOS and used instructions for this answer but it’s throwing following error: Semantic Issue
Continue readingFlutter: convert bitmap (e.g. screenshot) from clipboard to base64 string
Issue This is my current requirement: A) The screenshot/bitmap in my clipboard must be pasted into the app (Platform: primarily Windows, but must run on all other platforms aswell: Android/iOS/Linux/MacOS/Web) I found out that Flutter does not support anything else
Continue readingUsing a C++ DLL in Flutter The type must be a subtype
Issue dll` to my flutter project In .dll I type function: int testdll(int param) { //… } on flutter I type this: final DynamicLibrary nativePointerTestLib = DynamicLibrary.open("assets/SimpleDllFlutter.dll"); final Int Function(Int arr) testdllflutter = nativePointerTestLib .lookup<NativeFunction<Int Function(Int)>>("testdll") .asFunction(); and I get
Continue readingFindWindowA function does not yield the expected output in dart foreign function interface
Issue The following dart code’s expected output is the handle to the file explorer window but the output always comes out to be 0 even though the file explorer window does exist! import ‘package:ffi/ffi.dart’; import ‘dart:ffi’; void main() { DynamicLibrary
Continue readingProcessing flutter images with C++ openCV
Issue I am working on a project, where I want to process my images using C++ OpenCV. For simplicity’s sake, I just want to convert Uint8List to cv::Mat and back. Following this tutorial, I managed to make a pipeline that
Continue readingReading png using dart ffi and libpng
Issue I am trying to use libpng1.6 to load a png from file, but the execution fails with a segmentation fault. I load the library and libpng function called png_image_begin_read_from_file as shown: final dylib = ffi.DynamicLibrary.open( "/opt/homebrew/Cellar/libpng/1.6.37/lib/libpng.dylib"); final dart_function_t png_image_begin_read_from_file
Continue reading