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

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

Tags:

Dart

Flutter