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
ca300100
Unverified
Commit
ca300100
authored
May 24, 2018
by
Sarah Zakarias
Committed by
GitHub
May 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update plugin template to comply with new type and style rules (#17840)
parent
54899c76
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
18 deletions
+15
-18
MainActivity.java.tmpl
...pp/src/main/java/androidIdentifier/MainActivity.java.tmpl
+0
-1
AppDelegate.h
...tools/templates/create/ios-objc.tmpl/Runner/AppDelegate.h
+1
-1
AppDelegate.m
...tools/templates/create/ios-objc.tmpl/Runner/AppDelegate.m
+2
-1
main.m
...lutter_tools/templates/create/ios-objc.tmpl/Runner/main.m
+2
-2
main.dart.tmpl
packages/flutter_tools/templates/create/lib/main.dart.tmpl
+6
-5
CHANGELOG.md.tmpl
packages/flutter_tools/templates/plugin/CHANGELOG.md.tmpl
+1
-1
pluginClass.java.tmpl
...mpl/src/main/java/androidIdentifier/pluginClass.java.tmpl
+3
-7
No files found.
packages/flutter_tools/templates/create/android-java.tmpl/app/src/main/java/androidIdentifier/MainActivity.java.tmpl
View file @
ca300100
package
{{
androidIdentifier
}};
import
android
.
os
.
Bundle
;
import
io
.
flutter
.
app
.
FlutterActivity
;
import
io
.
flutter
.
plugins
.
GeneratedPluginRegistrant
;
...
...
packages/flutter_tools/templates/create/ios-objc.tmpl/Runner/AppDelegate.h
View file @
ca300100
#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface
AppDelegate
:
FlutterAppDelegate
...
...
packages/flutter_tools/templates/create/ios-objc.tmpl/Runner/AppDelegate.m
View file @
ca300100
...
...
@@ -3,7 +3,8 @@
@implementation
AppDelegate
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
[
GeneratedPluginRegistrant
registerWithRegistry
:
self
];
// Override point for customization after application launch.
return
[
super
application
:
application
didFinishLaunchingWithOptions
:
launchOptions
];
...
...
packages/flutter_tools/templates/create/ios-objc.tmpl/Runner/main.m
View file @
ca300100
#import
<
UIKit
/
UIKit
.
h
>
#import
<
Flutter
/
Flutter
.
h
>
#import
<
UIKit
/
UIKit
.
h
>
#import
"AppDelegate.h"
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
@
autoreleasepool
{
return
UIApplicationMain
(
argc
,
argv
,
nil
,
NSStringFromClass
([
AppDelegate
class
]))
;
}
...
...
packages/flutter_tools/templates/create/lib/main.dart.tmpl
View file @
ca300100
...
...
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';
{{/withDriverTest}}
{{#withPluginHook}}
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:{{pluginProjectName}}/{{pluginProjectName}}.dart';
{{/withPluginHook}}
...
...
@@ -136,13 +138,13 @@ class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
initState() {
void
initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
initPlatformState() async {
Future<void>
initPlatformState() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
...
...
@@ -154,8 +156,7 @@ class _MyAppState extends State<MyApp> {
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted)
return;
if (!mounted) return;
setState(() {
_platformVersion = platformVersion;
...
...
@@ -167,7 +168,7 @@ class _MyAppState extends State<MyApp> {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title:
new
Text('Plugin example app'),
title:
const
Text('Plugin example app'),
),
body: new Center(
child: new Text('Running on: $_platformVersion\n'),
...
...
packages/flutter_tools/templates/plugin/CHANGELOG.md.tmpl
View file @
ca300100
##
[0.0.1] - TODO: Add release date.
##
0.0.1
* TODO: Describe initial release.
packages/flutter_tools/templates/plugin/android-java.tmpl/src/main/java/androidIdentifier/pluginClass.java.tmpl
View file @
ca300100
package
{{
androidIdentifier
}};
import
io
.
flutter
.
plugin
.
common
.
MethodCall
;
import
io
.
flutter
.
plugin
.
common
.
MethodChannel
;
import
io
.
flutter
.
plugin
.
common
.
MethodChannel
.
MethodCallHandler
;
import
io
.
flutter
.
plugin
.
common
.
MethodChannel
.
Result
;
import
io
.
flutter
.
plugin
.
common
.
MethodCall
;
import
io
.
flutter
.
plugin
.
common
.
PluginRegistry
.
Registrar
;
/**
*
{{
pluginClass
}}
*/
/**
{{
pluginClass
}}
*/
public
class
{{
pluginClass
}}
implements
MethodCallHandler
{
/**
*
Plugin
registration
.
*/
/**
Plugin
registration
.
*/
public
static
void
registerWith
(
Registrar
registrar
)
{
final
MethodChannel
channel
=
new
MethodChannel
(
registrar
.
messenger
(),
"{{projectName}}"
);
channel
.
setMethodCallHandler
(
new
{{
pluginClass
}}());
...
...
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