registerWith static method

void registerWith(
  1. Registrar registrar
)

Implementation

static void registerWith(Registrar registrar) {
  //ZimFlutterSdkPlatform.instance = ZimFlutterSdkWeb();
  final MethodChannel channel = MethodChannel(
    'zego_zim_plugin',
    const StandardMethodCodec(),
    registrar,
  );

  final eventChannel = PluginEventChannel(
      'zim_event_handler', const StandardMethodCodec(), registrar);

  final pluginInstance = ZegoZimPlugin();
  channel.setMethodCallHandler(pluginInstance.handleMethodCall);
  eventChannel.setController(ZegoZimPlugin._evenController);

  _evenController.stream.listen((event) {
    ZIMEventHandlerWeb.eventListener(event);
  });

  // var element = ScriptElement()
  //   ..src = 'assets/packages/zego_zim/assets/index.js'
  //   ..type = 'application/javascript';

  // document.body!.append(element);
}