'How to compile dart package
I am experienced programming in languages like C, C# etc, and recently started Flutter with Dart. I would like to create a Dart package/library that can be published without sharing all the source code because some if it is proprietary.
I have read about the different types of builds, and tried to build just the package to aot-snapshot. This failed because it was looking for the main entry function. So clearly it was trying to build the entire Flutter app. However, the package itself does not need Flutter at all. It would consist of Dart code and a few binary files in assets that I need to load at runtime. As such, I removed the package's dependency to Flutter, and it actually produced a file when trying to create the aot.
My question is, is there any way to use this aot snapshot in the Flutter app, through some Dart interface scripts? Otherwise, is there any other reasonable way to pre-compile Dart code (not native code because I want it to work on different platforms) and use it in Flutter apps?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
