Hi,
I have a library written in C++ for drawing on a canvas. It leaves the implementation of the canvas up to the user, depending on which platform the library is meant to be used on; it just expects various functions like canvas.setColor() and canvas.drawLine() to be available. I was wondering if it'd be at all possible to use this library in conjunction with a Flutter Canvas (which supports all those functions), via FFI?
Of course I'd be happy to write some kind of wrappers in Flutter/Dart and C/C++, but my understanding is that even with this, this might be tricky. Is there some reasonable way to work around this kind of issue? Is the easiest way to implement a dummy canvas in C++ that caches all the instructions in some data type, and then pull this from Flutter using FFI, and draw the instructions? This could get rather tedious; is there some best practice for encoding this kind of thing?
Kind regards,
Odev