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
104e7ba5
Commit
104e7ba5
authored
Mar 30, 2017
by
Jakob Andersen
Committed by
GitHub
Mar 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update plugin template to new channel API. (#9105)
parent
0ee7fabe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
build.gradle.tmpl
...ter_tools/templates/plugin/android.tmpl/build.gradle.tmpl
+4
-0
pluginClass.java.tmpl
...in/java/com/yourcompany/projectName/pluginClass.java.tmpl
+1
-1
pluginClass.m.tmpl
...ools/templates/plugin/ios.tmpl/Classes/pluginClass.m.tmpl
+3
-5
No files found.
packages/flutter_tools/templates/plugin/android.tmpl/build.gradle.tmpl
View file @
104e7ba5
...
...
@@ -30,3 +30,7 @@ android {
disable 'InvalidPackage'
}
}
dependencies {
compile 'com.android.support:support-fragment:25.0.0'
}
packages/flutter_tools/templates/plugin/android.tmpl/src/main/java/com/yourcompany/projectName/pluginClass.java.tmpl
View file @
104e7ba5
...
...
@@ -29,7 +29,7 @@ public class {{pluginClass}} implements MethodCallHandler {
if
(
call
.
method
.
equals
(
"getPlatformVersion"
))
{
response
.
success
(
"Android "
+
android
.
os
.
Build
.
VERSION
.
RELEASE
);
}
else
{
throw
new
IllegalArgumentException
(
"Unknown method "
+
call
.
method
);
response
.
notImplemented
(
);
}
}
}
packages/flutter_tools/templates/plugin/ios.tmpl/Classes/pluginClass.m.tmpl
View file @
104e7ba5
...
...
@@ -7,15 +7,13 @@
self = [super init];
if (self) {
FlutterMethodChannel *channel = [FlutterMethodChannel
methodChannelNamed:@"{{projectName}}"
binaryMessenger:flutterView
codec:[FlutterStandardMethodCodec sharedInstance]];
methodChannelWithName:@"{{projectName}}"
binaryMessenger:flutterView];
[channel setMethodCallHandler:^(FlutterMethodCall *call,
FlutterResultReceiver result) {
if ([@"getPlatformVersion" isEqualToString:call.method]) {
result([@"iOS " stringByAppendingString:[[UIDevice currentDevice]
systemVersion]],
nil);
systemVersion]]);
}
}];
}
...
...
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