buildGromoreOhosPlatformView function

Widget buildGromoreOhosPlatformView({
  1. required String viewType,
  2. required Map<String, dynamic> creationParams,
  3. required PlatformViewCreatedCallback onPlatformViewCreated,
  4. required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
})

创建鸿蒙原生广告视图。

Implementation

Widget buildGromoreOhosPlatformView({
  required String viewType,
  required Map<String, dynamic> creationParams,
  required PlatformViewCreatedCallback onPlatformViewCreated,
  required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
}) {
  final GromoreOhosPlatformViewBuilder? builder = _ohosPlatformViewBuilder;
  if (builder == null) {
    return ErrorWidget(
      'HarmonyOS 平台请改为导入 gromore_ads_kit_ohos.dart,'
      '并在 runApp 前调用 registerGromoreAdsKitOhosPlatformViews()。',
    );
  }

  return builder(
    viewType: viewType,
    creationParams: creationParams,
    onPlatformViewCreated: onPlatformViewCreated,
    gestureRecognizers: gestureRecognizers,
  );
}