Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4676e1d7
Unverified
Commit
4676e1d7
authored
Nov 20, 2017
by
Mikkel Nygaard Ravn
Committed by
GitHub
Nov 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for iOS plugin class prefix (#13095)
parent
928d2cc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+20
-4
pubspec_yaml.json
packages/flutter_tools/schema/pubspec_yaml.json
+2
-1
No files found.
packages/flutter_tools/lib/src/plugins.dart
View file @
4676e1d7
...
...
@@ -12,19 +12,34 @@ import 'globals.dart';
class
Plugin
{
final
String
name
;
final
String
path
;
final
String
pluginClass
;
final
String
androidPackage
;
final
String
iosPrefix
;
final
String
pluginClass
;
Plugin
(
this
.
name
,
this
.
path
,
this
.
pluginClass
,
this
.
androidPackage
);
Plugin
({
this
.
name
,
this
.
path
,
this
.
androidPackage
,
this
.
iosPrefix
,
this
.
pluginClass
,
});
factory
Plugin
.
fromYaml
(
String
name
,
String
path
,
dynamic
pluginYaml
)
{
String
androidPackage
;
String
iosPrefix
;
String
pluginClass
;
if
(
pluginYaml
!=
null
)
{
androidPackage
=
pluginYaml
[
'androidPackage'
];
iosPrefix
=
pluginYaml
[
'iosPrefix'
]
??
''
;
pluginClass
=
pluginYaml
[
'pluginClass'
];
}
return
new
Plugin
(
name
,
path
,
pluginClass
,
androidPackage
);
return
new
Plugin
(
name:
name
,
path:
path
,
androidPackage:
androidPackage
,
iosPrefix:
iosPrefix
,
pluginClass:
pluginClass
,
);
}
}
...
...
@@ -146,7 +161,7 @@ const String _iosPluginRegistryImplementationTemplate = '''//
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
{{#plugins}}
[{{
class}} registerWithRegistrar:[registry registrarForPlugin:@"
{{class}}"]];
[{{
prefix}}{{class}} registerWithRegistrar:[registry registrarForPlugin:@"{{prefix}}
{{class}}"]];
{{/plugins}}
}
...
...
@@ -158,6 +173,7 @@ void _writeIOSPluginRegistry(String directory, List<Plugin> plugins) {
.
where
((
Plugin
p
)
=>
p
.
pluginClass
!=
null
)
.
map
((
Plugin
p
)
=>
<
String
,
dynamic
>{
'name'
:
p
.
name
,
'prefix'
:
p
.
iosPrefix
,
'class'
:
p
.
pluginClass
,
}).
toList
();
...
...
packages/flutter_tools/schema/pubspec_yaml.json
View file @
4676e1d7
...
...
@@ -45,8 +45,9 @@
"additionalProperties"
:
false
,
"properties"
:
{
"androidPackage"
:
{
"type"
:
"string"
},
"iosPrefix"
:
{
"type"
:
"string"
},
"pluginClass"
:
{
"type"
:
"string"
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment