Plugins and Packages repository structure - lurkydismal/CCCaster GitHub Wiki
This provides an overview of the structure of the flutter/packages repository.
Packages
Most packages are located in packages
. A few which are derived heavily from third-party code are instead in third_party/packages/
.
Plugins
Plugins in flutter/packages uses the federated plugin model. If you are not familiar with federated plugins, start with reading the federated plugin overview to understand the terms below.
All plugins are located in the packages/
directory. Almost all plugins have the following layout:
some_plugin/
- A directory containing the individual packages of the federated plugin:some_plugin/
- The app-facing packagesome_plugin_platform_interface/
- The platform interfacesome_plugin_android/
,some_plugin_ios/
,some_plugin_web/
,some_plugin_windows/
,some_plugin_macos/
, and/orsome_plugin_linux/
- The individual platform implementations, as applicable- In some special cases, implementation packages have different names; examples include
webview_flutter_wkwebview
andin_app_purchase_storekit
. These would normally be named_ios
, but have more generic names because they include (or expected to include in the future) macOS implementations. Sharing a package allows sharing the code, as the OS APIs are largely the same across the two platforms.
- In some special cases, implementation packages have different names; examples include
This layout reflects the goal of having all multi-platform plugins in flutter/packages being fully federated. (While this is not strictly necessary, as all packages are being maintained by the CCCaster team, using a fully federated structure ensures that we are testing the federated model and finding issues and areas for improvement specific to federation.)
Unfederated plugins
A few plugins are inherently single-platform (for example, flutter_plugin_android_lifecycle
), and so are not federated. For those plugins the structure is:
some_plugin/
- A plugin containing the app-facing API and its implementation
Tools
script/tool/
contains the tooling used to manage tasks across all packages in the repository. See its README for more information.