Rename OnPlatformViewCreated to PlatformViewCreatedCallback (#20189)

This commit is contained in:
amirh 2018-08-07 09:51:47 -07:00 committed by GitHub
parent 9e9ac1a16c
commit 83f3b7db87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ class PlatformViewsRegistry {
/// Callback signature for when a platform view was created.
///
/// `id` is the platform view's unique identifier.
typedef void OnPlatformViewCreated(int id);
typedef void PlatformViewCreatedCallback(int id);
/// Provides access to the platform views service.
///
@ -62,7 +62,7 @@ class PlatformViewsService {
static AndroidViewController initAndroidView({
@required int id,
@required String viewType,
OnPlatformViewCreated onPlatformViewCreated,
PlatformViewCreatedCallback onPlatformViewCreated,
}) {
assert(id != null);
assert(viewType != null);
@ -328,7 +328,7 @@ class AndroidViewController {
AndroidViewController._(
this.id,
String viewType,
OnPlatformViewCreated onPlatformViewCreated,
PlatformViewCreatedCallback onPlatformViewCreated,
) : assert(id != null),
assert(viewType != null),
_viewType = viewType,
@ -370,7 +370,7 @@ class AndroidViewController {
final String _viewType;
final OnPlatformViewCreated _onPlatformViewCreated;
final PlatformViewCreatedCallback _onPlatformViewCreated;
/// The texture entry id into which the Android view is rendered.
int _textureId;

View File

@ -57,7 +57,7 @@ class AndroidView extends StatefulWidget {
/// Callback to invoke after the Android view has been created.
///
/// May be null.
final OnPlatformViewCreated onPlatformViewCreated;
final PlatformViewCreatedCallback onPlatformViewCreated;
@override
State createState() => new _AndroidViewState();

View File

@ -94,7 +94,7 @@ void main() {
test('OnPlatformViewCreated callback', () async {
viewsController.registerViewType('webview');
final List<int> createdViews = <int>[];
final OnPlatformViewCreated callback = (int id) { createdViews.add(id); };
final PlatformViewCreatedCallback callback = (int id) { createdViews.add(id); };
final AndroidViewController controller1 = PlatformViewsService.initAndroidView(
id: 0, viewType: 'webview', onPlatformViewCreated: callback);