Fully support Dart-only mobile and macOS plugins (#96183)
This commit is contained in:
@@ -98,6 +98,7 @@ const String _kFlutterPluginsPluginListKey = 'plugins';
|
||||
const String _kFlutterPluginsNameKey = 'name';
|
||||
const String _kFlutterPluginsPathKey = 'path';
|
||||
const String _kFlutterPluginsDependenciesKey = 'dependencies';
|
||||
const String _kFlutterPluginsHasNativeBuildKey = 'native_build';
|
||||
|
||||
/// Filters [plugins] to those supported by [platformKey].
|
||||
List<Map<String, Object>> _filterPluginsByPlatform(List<Plugin> plugins, String platformKey) {
|
||||
@@ -108,9 +109,13 @@ List<Map<String, Object>> _filterPluginsByPlatform(List<Plugin> plugins, String
|
||||
final Set<String> pluginNames = platformPlugins.map((Plugin plugin) => plugin.name).toSet();
|
||||
final List<Map<String, Object>> pluginInfo = <Map<String, Object>>[];
|
||||
for (final Plugin plugin in platformPlugins) {
|
||||
// This is guaranteed to be non-null due to the `where` filter above.
|
||||
final PluginPlatform platformPlugin = plugin.platforms[platformKey]!;
|
||||
pluginInfo.add(<String, Object>{
|
||||
_kFlutterPluginsNameKey: plugin.name,
|
||||
_kFlutterPluginsPathKey: globals.fsUtils.escapePath(plugin.path),
|
||||
if (platformPlugin is NativeOrDartPlugin)
|
||||
_kFlutterPluginsHasNativeBuildKey: (platformPlugin as NativeOrDartPlugin).isNative(),
|
||||
_kFlutterPluginsDependenciesKey: <String>[...plugin.dependencies.where(pluginNames.contains)],
|
||||
});
|
||||
}
|
||||
@@ -130,7 +135,8 @@ List<Map<String, Object>> _filterPluginsByPlatform(List<Plugin> plugins, String
|
||||
/// "dependencies": [
|
||||
/// "plugin-a",
|
||||
/// "plugin-b"
|
||||
/// ]
|
||||
/// ],
|
||||
/// "native_build": true
|
||||
/// }
|
||||
/// ],
|
||||
/// "android": [],
|
||||
|
||||
Reference in New Issue
Block a user