Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Fixed the platform view creation public method #30996

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* the Dart code, this will be null. Otherwise this will be the value sent from the Dart code as
* decoded by `createArgsCodec`.
*/
- (nonnull NSView*)createWithviewIdentifier:(int64_t)viewId arguments:(nullable id)args;
- (nonnull NSView*)createWithViewIdentifier:(int64_t)viewId arguments:(nullable id)args;

/**
* Returns the `FlutterMessageCodec` for decoding the args parameter of `createWithFrame`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the create issue below as well, which is also breaking? Or is that for consistency with iOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was for consistency with iOS.

Expand Down
8 changes: 4 additions & 4 deletions shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h"
#import "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/embedder/embedder.h"

/**
* Constructs and returns a FlutterLocale struct corresponding to |locale|, which must outlive
Expand Down Expand Up @@ -99,7 +99,7 @@ - (void)loadAOTData:(NSString*)assetsDir;
/**
* Creates a platform view channel and sets up the method handler.
*/
- (void)setupPlatformViewChannel;
- (void)setUpPlatformViewChannel;

@end

Expand Down Expand Up @@ -239,7 +239,7 @@ - (instancetype)initWithName:(NSString*)labelPrefix
object:nil];

_platformViewController = [[FlutterPlatformViewController alloc] init];
[self setupPlatformViewChannel];
[self setUpPlatformViewChannel];

return self;
}
Expand Down Expand Up @@ -656,7 +656,7 @@ - (void)shutDownEngine {
_engine = nullptr;
}

- (void)setupPlatformViewChannel {
- (void)setUpPlatformViewChannel {
_platformViewsChannel =
[FlutterMethodChannel methodChannelWithName:@"flutter/platform_views"
binaryMessenger:self.binaryMessenger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void)onCreateWithViewID:(int64_t)viewId
return;
}

NSView* platform_view = [factory createWithviewIdentifier:viewId arguments:nil];
NSView* platform_view = [factory createWithViewIdentifier:viewId arguments:nil];
_platformViews[viewId] = platform_view;
result(nil);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
@end

@implementation TestFlutterPlatformViewFactory
- (NSView*)createWithviewIdentifier:(int64_t)viewId arguments:(nullable id)args {
- (NSView*)createWithViewIdentifier:(int64_t)viewId arguments:(nullable id)args {
return [[TestFlutterPlatformView alloc] initWithFrame:CGRectZero];
}

Expand Down