Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

flutter

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 ?

like image 688
user3769778 Avatar asked Nov 03 '19 14:11

user3769778


Video Answer


2 Answers

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

like image 55
Defuera Avatar answered Oct 16 '22 21:10

Defuera


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

like image 32
Manish Avatar answered Oct 16 '22 23:10

Manish