registerWith static method

void registerWith(
  1. Registrar registrar
)

Implementation

static void registerWith(Registrar registrar) {
  final self = FlutterDropzonePlugin();
  _isReady = _readyCompleter.future;
  html.window.addEventListener('flutter_dropzone_web_ready', (_) {
    if (!_readyCompleter.isCompleted) _readyCompleter.complete(true);
  });
  FlutterDropzonePlatform.instance = self;

  // ignore: undefined_prefixed_name
  ui.platformViewRegistry.registerViewFactory('com.creativephotocloud.plugins/dropzone', (viewId) {
    final view = _views[viewId] = FlutterDropzoneView(viewId);
    return view.container;
  });

  html.document.body!.append(html.ScriptElement()
    ..src = 'assets/packages/flutter_dropzone_web/assets/flutter_dropzone.js' // ignore: unsafe_html
    ..type = 'application/javascript'
    ..defer = true);
}