unqlite_flutter icon indicating copy to clipboard operation
unqlite_flutter copied to clipboard

Desktop support?

Open feimenggo opened this issue 2 years ago • 1 comments

Waiting for macOs and Windows support.

feimenggo avatar Oct 03 '22 02:10 feimenggo

@feimenggo

This library can support desktop:

String _libPath = '';

set libPath(String path) => _libPath = path;

ffi.DynamicLibrary _load() {
  var path = _libPath.isNotEmpty ? _libPath : "libunqlite.so";

  if (Platform.isWindows) {
    path = _libPath.isNotEmpty ? _libPath : "libunqlite.dll";
  } else if (Platform.isMacOS) {
    path = _libPath.isNotEmpty ? _libPath : "libunqlite.dylib";
  } else if (Platform.isIOS) {
    return ffi.DynamicLibrary.process();
  }

  return ffi.DynamicLibrary.open(path);
}

Just call libPath to set the path of the dynamic library.For the compilation of the dynamic library, you can check the documentation of this unqlite, and configure the cmake environment and compiler.

arcticfox1919 avatar Feb 27 '23 13:02 arcticfox1919