mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
Deprecation cleanup in flutter_tools (#44469)
One deprecated member was no longer used; removed it. The other probably shouldn't be deprecated, because it's not the parser that's deprecated so much as the format it's parsing. The code itself will live on until we decide to stop supporting the format, it's not like people calling the member should use something else.
This commit is contained in:
parent
c921c5ae67
commit
f4da9f72eb
|
@ -117,17 +117,6 @@ class AppContext {
|
|||
return _unboxNull(value ?? _generateIfNecessary(T, _fallbacks)) as T;
|
||||
}
|
||||
|
||||
/// Gets the value associated with the specified [type], or `null` if no
|
||||
/// such value has been associated.
|
||||
@Deprecated('use get<T> instead for type safety.')
|
||||
Object operator [](Type type) {
|
||||
dynamic value = _generateIfNecessary(type, _overrides);
|
||||
if (value == null && _parent != null) {
|
||||
value = _parent[type];
|
||||
}
|
||||
return _unboxNull(value ?? _generateIfNecessary(type, _fallbacks));
|
||||
}
|
||||
|
||||
/// Runs [body] in a child context and returns the value returned by [body].
|
||||
///
|
||||
/// If [overrides] is specified, the child context will return corresponding
|
||||
|
|
|
@ -35,28 +35,31 @@ class Plugin {
|
|||
/// Parses [Plugin] specification from the provided pluginYaml.
|
||||
///
|
||||
/// This currently supports two formats. Legacy and Multi-platform.
|
||||
///
|
||||
/// Example of the deprecated Legacy format.
|
||||
/// flutter:
|
||||
/// plugin:
|
||||
/// androidPackage: io.flutter.plugins.sample
|
||||
/// iosPrefix: FLT
|
||||
/// pluginClass: SamplePlugin
|
||||
///
|
||||
/// flutter:
|
||||
/// plugin:
|
||||
/// androidPackage: io.flutter.plugins.sample
|
||||
/// iosPrefix: FLT
|
||||
/// pluginClass: SamplePlugin
|
||||
///
|
||||
/// Example Multi-platform format.
|
||||
/// flutter:
|
||||
/// plugin:
|
||||
/// platforms:
|
||||
/// android:
|
||||
/// package: io.flutter.plugins.sample
|
||||
/// pluginClass: SamplePlugin
|
||||
/// ios:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// linux:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// macos:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// windows:
|
||||
/// pluginClass: SamplePlugin
|
||||
///
|
||||
/// flutter:
|
||||
/// plugin:
|
||||
/// platforms:
|
||||
/// android:
|
||||
/// package: io.flutter.plugins.sample
|
||||
/// pluginClass: SamplePlugin
|
||||
/// ios:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// linux:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// macos:
|
||||
/// pluginClass: SamplePlugin
|
||||
/// windows:
|
||||
/// pluginClass: SamplePlugin
|
||||
factory Plugin.fromYaml(String name, String path, dynamic pluginYaml) {
|
||||
final List<String> errors = validatePluginYaml(pluginYaml);
|
||||
if (errors.isNotEmpty) {
|
||||
|
@ -65,7 +68,7 @@ class Plugin {
|
|||
if (pluginYaml != null && pluginYaml['platforms'] != null) {
|
||||
return Plugin._fromMultiPlatformYaml(name, path, pluginYaml);
|
||||
}
|
||||
return Plugin._fromLegacyYaml(name, path, pluginYaml); // ignore: deprecated_member_use_from_same_package
|
||||
return Plugin._fromLegacyYaml(name, path, pluginYaml);
|
||||
}
|
||||
|
||||
factory Plugin._fromMultiPlatformYaml(String name, String path, dynamic pluginYaml) {
|
||||
|
@ -118,7 +121,6 @@ class Plugin {
|
|||
);
|
||||
}
|
||||
|
||||
@deprecated
|
||||
factory Plugin._fromLegacyYaml(String name, String path, dynamic pluginYaml) {
|
||||
final Map<String, PluginPlatform> platforms = <String, PluginPlatform>{};
|
||||
final String pluginClass = pluginYaml['pluginClass'];
|
||||
|
@ -396,7 +398,7 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
|
|||
case AndroidEmbeddingVersion.v2:
|
||||
templateContext['needsShim'] = false;
|
||||
// If a plugin is using an embedding version older than 2.0 and the app is using 2.0,
|
||||
// then add shim for the old plugins.
|
||||
// then add shim for the old plugins.
|
||||
for (Map<String, dynamic> plugin in androidPlugins) {
|
||||
if (plugin['supportsEmbeddingV1'] && !plugin['supportsEmbeddingV2']) {
|
||||
templateContext['needsShim'] = true;
|
||||
|
|
Loading…
Reference in a new issue