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
87ee003f
Unverified
Commit
87ee003f
authored
Jul 30, 2020
by
Ayush Bherwani
Committed by
GitHub
Jul 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaces deprecated api usage for android (#62515)
parent
26f9d734
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
pluginClass.java.tmpl
...mpl/src/main/java/androidIdentifier/pluginClass.java.tmpl
+1
-1
pluginClass.kt.tmpl
...mpl/src/main/kotlin/androidIdentifier/pluginClass.kt.tmpl
+4
-4
No files found.
packages/flutter_tools/templates/plugin/android-java.tmpl/src/main/java/androidIdentifier/pluginClass.java.tmpl
View file @
87ee003f
...
...
@@ -19,7 +19,7 @@ public class {{pluginClass}} implements FlutterPlugin, MethodCallHandler {
@
Override
public
void
onAttachedToEngine
(@
NonNull
FlutterPluginBinding
flutterPluginBinding
)
{
channel
=
new
MethodChannel
(
flutterPluginBinding
.
get
FlutterEngine
().
getDartExecuto
r
(),
"{{projectName}}"
);
channel
=
new
MethodChannel
(
flutterPluginBinding
.
get
BinaryMessenge
r
(),
"{{projectName}}"
);
channel
.
setMethodCallHandler
(
this
);
}
...
...
packages/flutter_tools/templates/plugin/android-kotlin.tmpl/src/main/kotlin/androidIdentifier/pluginClass.kt.tmpl
View file @
87ee003f
package
{{
androidIdentifier
}}
import
androidx
.
annotation
.
NonNull
;
import
androidx
.
annotation
.
NonNull
import
io
.
flutter
.
embedding
.
engine
.
plugins
.
FlutterPlugin
import
io
.
flutter
.
plugin
.
common
.
MethodCall
...
...
@@ -10,7 +10,7 @@ import io.flutter.plugin.common.MethodChannel.Result
import
io
.
flutter
.
plugin
.
common
.
PluginRegistry
.
Registrar
/**
{{
pluginClass
}}
*/
public
class
{{
pluginClass
}}:
FlutterPlugin
,
MethodCallHandler
{
class
{{
pluginClass
}}:
FlutterPlugin
,
MethodCallHandler
{
///
The
MethodChannel
that
will
the
communication
between
Flutter
and
native
Android
///
///
This
local
reference
serves
to
register
the
plugin
with
the
Flutter
Engine
and
unregister
it
...
...
@@ -18,8 +18,8 @@ public class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
private
lateinit
var
channel
:
MethodChannel
override
fun
onAttachedToEngine
(@
NonNull
flutterPluginBinding
:
FlutterPlugin
.
FlutterPluginBinding
)
{
channel
=
MethodChannel
(
flutterPluginBinding
.
getFlutterEngine
().
getDartExecutor
()
,
"{{projectName}}"
)
channel
.
setMethodCallHandler
(
this
)
;
channel
=
MethodChannel
(
flutterPluginBinding
.
binaryMessenger
,
"{{projectName}}"
)
channel
.
setMethodCallHandler
(
this
)
}
override
fun
onMethodCall
(@
NonNull
call
:
MethodCall
,
@
NonNull
result
:
Result
)
{
...
...
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