I was looking for a way to possibly use a java library of my own inside of my Flutter App. I did some research but was only able to find information about how to integrate flutter with native Java libraries on Android exclusively.
Is there a way to call on java code also from Flutter Web and/or Flutter Desktop?
I am sorry I can't provide further information to this question as I was not able to find any "lead" if not starflut (https://pub.dev/packages/starflut) - which to the 'beginner' programmer I am in Flutter might seem an overkill approach to this problem - and I'm not even sure it supports Flutter Web/Desktop as of yet.
Any help, comments or ideas would be highly appreciated
EDIT 1
As implementing Java on Flutter Web seems close to impossible (or not worth the hassle), would calling C++ libraries from Flutter Web be a possibility?
EDIT 2
To better describe my problem/situation, I'll add some context.
I need to write a library that can be accessed by multiple flutter apps (both Web and possibly Mobile, but PWA would also be ok), but also by multiple programs which don't use the flutter framework.
I considered a couple of options, but I am still quite inexperienced and I am not sure which way to go forward with:
- C++ as the core of the library, and making language bindings to Dart
- It seems C++ code can work on mobile, but I haven't found a way it can be run on Web as well as within Flutter
- JavaScript as the core of the library, and
- either accessing the library directly from Flutter Web (seems to be possible https://medium.com/flutter-community/using-javascript-code-in-flutter-web-903de54a2000 )
- Though I am not sure if this solution would work also on Mobile Flutter
- Using Dart itself as the core of the library
- this would be the quickest option when rolling out the Flutter App(s), but it would also have the drawback that I'll need to rewrite the library in another language later on