view method

Widget view ()

Implementation

Widget view() {
  if (_platformView == null) {
    print("[RTMP] get platformview");
    if (defaultTargetPlatform == TargetPlatform.iOS) {
      _platformView = UiKitView(
        key: _globalKey,
        viewType: DEF_CAMERA_RTMP_VIEW,
        onPlatformViewCreated: (_) {
          _didCreated();
        },
      );
    } else if (defaultTargetPlatform == TargetPlatform.android) {
      _platformView = AndroidView(
        key: _globalKey,
        viewType: DEF_CAMERA_RTMP_VIEW,
        onPlatformViewCreated: (_) {
          _didCreated();
        },
      );
    } else {
      _platformView = Container();
    }
  }
  return Container(
      color: Colors.transparent,
      alignment: Alignment.center,
      child: AspectRatio(
        aspectRatio: 720.0 / 1280,
        child: _platformView,
      ));
}