Unverified Commit 83f3b7db authored by amirh's avatar amirh Committed by GitHub

Rename OnPlatformViewCreated to PlatformViewCreatedCallback (#20189)

parent 9e9ac1a1
...@@ -37,7 +37,7 @@ class PlatformViewsRegistry { ...@@ -37,7 +37,7 @@ class PlatformViewsRegistry {
/// Callback signature for when a platform view was created. /// Callback signature for when a platform view was created.
/// ///
/// `id` is the platform view's unique identifier. /// `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. /// Provides access to the platform views service.
/// ///
...@@ -62,7 +62,7 @@ class PlatformViewsService { ...@@ -62,7 +62,7 @@ class PlatformViewsService {
static AndroidViewController initAndroidView({ static AndroidViewController initAndroidView({
@required int id, @required int id,
@required String viewType, @required String viewType,
OnPlatformViewCreated onPlatformViewCreated, PlatformViewCreatedCallback onPlatformViewCreated,
}) { }) {
assert(id != null); assert(id != null);
assert(viewType != null); assert(viewType != null);
...@@ -328,7 +328,7 @@ class AndroidViewController { ...@@ -328,7 +328,7 @@ class AndroidViewController {
AndroidViewController._( AndroidViewController._(
this.id, this.id,
String viewType, String viewType,
OnPlatformViewCreated onPlatformViewCreated, PlatformViewCreatedCallback onPlatformViewCreated,
) : assert(id != null), ) : assert(id != null),
assert(viewType != null), assert(viewType != null),
_viewType = viewType, _viewType = viewType,
...@@ -370,7 +370,7 @@ class AndroidViewController { ...@@ -370,7 +370,7 @@ class AndroidViewController {
final String _viewType; final String _viewType;
final OnPlatformViewCreated _onPlatformViewCreated; final PlatformViewCreatedCallback _onPlatformViewCreated;
/// The texture entry id into which the Android view is rendered. /// The texture entry id into which the Android view is rendered.
int _textureId; int _textureId;
......
...@@ -57,7 +57,7 @@ class AndroidView extends StatefulWidget { ...@@ -57,7 +57,7 @@ class AndroidView extends StatefulWidget {
/// Callback to invoke after the Android view has been created. /// Callback to invoke after the Android view has been created.
/// ///
/// May be null. /// May be null.
final OnPlatformViewCreated onPlatformViewCreated; final PlatformViewCreatedCallback onPlatformViewCreated;
@override @override
State createState() => new _AndroidViewState(); State createState() => new _AndroidViewState();
......
...@@ -94,7 +94,7 @@ void main() { ...@@ -94,7 +94,7 @@ void main() {
test('OnPlatformViewCreated callback', () async { test('OnPlatformViewCreated callback', () async {
viewsController.registerViewType('webview'); viewsController.registerViewType('webview');
final List<int> createdViews = <int>[]; 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( final AndroidViewController controller1 = PlatformViewsService.initAndroidView(
id: 0, viewType: 'webview', onPlatformViewCreated: callback); id: 0, viewType: 'webview', onPlatformViewCreated: callback);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment