createNativeView static method

Widget createNativeView(
  1. dynamic created(
    1. int viewId
    ),
  2. {Key? key}
)

Creates the video renderer Widget. The Widget is identified by viewId, the operation and layout of the Widget are managed by the app.

Implementation

static Widget createNativeView(Function(int viewId) created, {Key? key}) {
  print('enxrtc' + key.toString());
  if (Platform.isIOS) {
    return UiKitView(
      key: key,
      viewType: 'EnxPlayer',
      onPlatformViewCreated: (viewId) {
        created(viewId);
        print('enxRtc view created' + viewId.toString());
      },
    );
  } else {
    return AndroidView(
      key: key,
      viewType: 'EnxPlayer',
      onPlatformViewCreated: (viewId) {
        print(viewId);
        created(viewId);
      },
    );
  }
}