I have spent months and days to write a library in dart [flutter app], and want to monetize my efforts. How do I share these dart library as closed source, so no one can see my source code?
Is there a way to hide my source code ?
There's no way to distribute closed source flutter package.
I've received an answer from dartlang dev here: https://github.com/dart-lang/sdk/issues/42863
The way I've been doing it is using git as a provider for my dependencies.
For example, fluttertoast
here is a private dart library:
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+4
splashscreen:
fluttertoast:
git: [email protected]:androidfanatic/FlutterToast.git
I just had to make sure that other people who were working with me had access to the git repo and then their flutter environment was able to just use the library.
There are a bunch of dependency sources that we can use like package servers and packages on local system but I've only ever used git for sharing private flutter libraries.
https://dart.dev/tools/pub/dependencies#dependency-sources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With