user3769778
user3769778

Reputation: 967

How to share a closed source Flutter library written in Dart?

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 ?

Upvotes: 21

Views: 3220

Answers (3)

Mafaz Ahsan
Mafaz Ahsan

Reputation: 103

I think there is a way to publish closed source flutter library. It includes dart source code but it is distributed as C/C++ library in binary form according to the instructions mentioned in their official documentation here.

https://flutter.dev/docs/development/platform-integration/c-interop

Upvotes: 0

Defuera
Defuera

Reputation: 5506

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

Upvotes: 4

Manish
Manish

Reputation: 5213

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

Upvotes: 1

Related Questions