rename initWithFlutterView to initWithController (#9208)

This commit is contained in:
Collin Jackson
2017-04-05 08:21:36 -07:00
committed by GitHub
parent 4a4d100b91
commit 244a7a02b5
3 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
{{#withPluginHook}}
FlutterViewController *flutterController =
(FlutterViewController *)self.window.rootViewController;
_{{pluginProjectName}} = [[{{pluginClass}} alloc] initWithFlutterView:flutterController];
_{{pluginProjectName}} = [[{{pluginClass}} alloc] initWithController:flutterController];
{{/withPluginHook}}
return YES;
}

View File

@@ -1,5 +1,5 @@
#import <Flutter/Flutter.h>
@interface {{pluginClass}} : NSObject
- initWithFlutterView:(FlutterViewController *)flutterView;
- initWithController:(FlutterViewController *)controller;
@end

View File

@@ -3,12 +3,12 @@
@implementation {{pluginClass}} {
}
- (instancetype)initWithFlutterView:(FlutterViewController *)flutterView {
- (instancetype)initWithController:(FlutterViewController *)controller {
self = [super init];
if (self) {
FlutterMethodChannel *channel = [FlutterMethodChannel
methodChannelWithName:@"{{projectName}}"
binaryMessenger:flutterView];
binaryMessenger:controller];
[channel setMethodCallHandler:^(FlutterMethodCall *call,
FlutterResultReceiver result) {
if ([@"getPlatformVersion" isEqualToString:call.method]) {