Issue This post is a duplicate of the Github Issue here. dart –version Dart SDK version: 2.15.0-116.0.dev (dev) (Thu Sep 16 09:47:01 2021 -0700) on "linux_x64" I’ve been looking up examples for callbacks and I have tried to get callbacks
Continue readingTag: ffi
How can I load a C dynamic library for FFI by specifying path in flutter?
Issue I want to load a C Dynamic Library in flutter, how can I specify the path, and open it? is it possible to add .so file to the asset folder? final dynamicLibrary = DynamicLibrary.open(libraryPath); final Pointer<Utf8> Function() _someMethod =
Continue readingHow to Link Lib.a in IOS, static as well as dynamic linking?
Issue I have some open source c++ library , I have converted into lib.a for different IOS architecture, how can I link this library in Xcode For IOS Devices. http://wiki.zeromq.org/build:iphone Reference Link The Main Target is to first test this
Continue readingHow to pass a callback to a win32 function with dart ffi?
Issue I’m trying to connect to my MIDI device to a Flutter app running on Windows. I’m using win32 and dart ffi. I have the following: final Pointer<HMIDIIN> hMidiDevice = malloc(); Pointer<NativeFunction<MidiInProc>> callbackPointer = Pointer.fromFunction(midiInCallback); final result = midiInOpen( hMidiDevice,
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 readingHow to pass const char* to dart?
Issue I don’t understand how to pass (…, const char *request) to dart function I used Pointer but there is an error in .asFunction() import ‘dart:ffi’; import ‘dart:io’ show Directory; import ‘package:path/path.dart’ as path; import ‘package:ffi/ffi.dart’; // FFI signature void
Continue readingUsing a C++ DLL in Flutter Windows desktop app
Issue I have some libraries to interact with a FTDI chip that I packaged into a DLL in C++. I would like to create a front-end with Flutter and use that library in a windows desktop app. These features are
Continue readingflutter how to create an dart:ffi struct reference
Issue I created a struct with dart:ffi. import ‘dart:ffi’; import ‘package:ffi/ffi.dart’; class TestStruct extends Struct{ external Pointer<Utf8> strText; @Int32() external int nNum; @Bool() external bool bIsTrue; //contstruct TestStruct(String str, int number, bool state){ strText = str as Pointer<Utf8>; nNum =
Continue readingHow to map Dart String with FFI
Issue I’ve the Dart type as: typedef dart_func = String Function(String x); And want to map it with Dart FFi, but their could not find neither String, nor Utf8, I tried typedef ffi_func = ffi.Pointer<Utf8> Function(ffi.Pointer<Utf8> x); But it failed,
Continue readingUsing a C++ DLL in Flutter Windows desktop app
Issue I have some libraries to interact with a FTDI chip that I packaged into a DLL in C++. I would like to create a front-end with Flutter and use that library in a windows desktop app. These features are
Continue reading