Rename OnPlatformViewCreated to PlatformViewCreatedCallback (#20189)
This commit is contained in:
parent
9e9ac1a16c
commit
83f3b7db87
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user