-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
I'm maintaining a package providing bindings to sqlite via dart:ffi. For Android apps, we need to compile sqlite3 as a dynamic library that gets put into the apk. For iOS and non-Flutter Dart apps, we use the sqlite3 library from the system, if available.
Since dart:ffi is still in an early stage, many users want to use native bindings for tests only, and use another package like sqflite for production. Unit tests are run on a desktop machine, so we don't compile any native libraries and instead use the one from the system. Unfortunately, the Flutter tool will include the native build script even if the package is just a dev_dependency. This means that native libraries are added into the built apk for no reason, but are still increasing app size.
Proposal
The dev_dependecies section of a pubspec indicates that a package is only used for development. So, I believe that the Flutter tool should not view packages in dev_dependencies as a native package and not run their native buildscripts when using flutter run or flutter build.