I am developing a plugin for Dart (Flutter). I have split up the source into many different implementation files to keep things clean and avoid having one massive file.
The problem is, I don't want users to have to import tons of source files whenever they want to use my package.
Is there any way, in flutter or Dart itself, to be able to declare some sort of umbrella interface?
In your plugin, you have a
libfolder. Create alib/srcsub-folder and move the bulk of your implementation files there. It's typical to be left with just one file inlibe.g.someplugin.dart.In there you can have any top level classes or functions but this is where you include the implementation source files using the
exportdirective.Here's an example from the google_sign_in plugin, from
google_sign_in.dart: