pointer_interceptor_web 0.10.3 copy "pointer_interceptor_web: ^0.10.3" to clipboard
pointer_interceptor_web: ^0.10.3 copied to clipboard

Platformweb

Web implementation of the pointer_interceptor plugin.

example/lib/main.dart

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:js_interop';
import 'dart:ui_web' as ui_web;

import 'package:flutter/material.dart';
import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart';
import 'package:pointer_interceptor_web/pointer_interceptor_web.dart';
import 'package:web/web.dart' as web;

const String _htmlElementViewType = '_htmlElementViewType';
const double _containerWidth = 640;
const double _containerHeight = 480;

/// The html.Element that will be rendered underneath the flutter UI.
final web.Element _htmlElement =
    (web.document.createElement('div') as web.HTMLDivElement)
      ..style.width = '100%'
      ..style.height = '100%'
      ..style.backgroundColor = '#fabada'
      ..style.cursor = 'auto'
      ..id = 'background-html-view';

// See other examples commented out below...

// final web.Element _htmlElement =
//     (web.document.createElement('video') as web.HTMLVideoElement)
//       ..style.width = '100%'
//       ..style.height = '100%'
//       ..style.cursor = 'auto'
//       ..style.backgroundColor = 'black'
//       ..id = 'background-html-view'
//       ..src="/?originalUrl=https%3A%2F%2Fwww.pub.dev%2F%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2339%3Bhttps%3A%26%2347%3B%26%2347%3Barchive.org%26%2347%3Bdownload%26%2347%3BBigBuckBunny_124%26%2347%3BContent%26%2347%3Bbig_buck_bunny_720p_surround.mp4%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..poster%2520%3D%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2339%3Bhttps%3A%26%2347%3B%26%2347%3Bpeach.blender.org%26%2347%3Bwp-content%26%2347%3Buploads%26%2347%3Btitle_anouncement.jpg%3Fx11217%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..controls%2520%3D%2520true%3B%26%2347%3B%26%2347%3B%2520final%2520web.Element%2520_htmlElement%2520%3D%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520(web.document.createElement(%26%2339%3Bvideo%26%2339%3B)%2520as%2520web.HTMLIFrameElement)%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..width%2520%3D%2520%26%2339%3B100%25%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..height%2520%3D%2520%26%2339%3B100%25%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..id%2520%3D%2520%26%2339%3Bbackground-html-view%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..src%2520%3D%2520%26%2339%3Bhttps%3A%26%2347%3B%26%2347%3Bwww.youtube.com%26%2347%3Bembed%26%2347%3BIyFZznAk69U%26%2339%3B%26%2347%3B%26%2347%3B%2520%2520%2520%2520%2520%2520%2520..style.border%2520%3D%2520%26%2339%3Bnone%26%2339%3B%3Bvoid%2520main()%2520%7B%2520%2520runApp(const%2520MyApp())%3B%7D%26%2347%3B%26%2347%3B%26%2347%3B%2520Main%2520appclass%2520MyApp%2520extends%2520StatelessWidget%2520%7B%2520%2520%26%2347%3B%26%2347%3B%26%2347%3B%2520Creates%2520main%2520app.%2520%2520const%2520MyApp(%7Bsuper.key%7D)%3B%2520%2520%40override%2520%2520Widget%2520build(BuildContext%2520context)%2520%7B%2520%2520%2520%2520return%2520const%2520MaterialApp(%2520%2520%2520%2520%2520%2520title%3A%2520%26%2339%3BStopping%2520Clicks%2520with%2520PointerInterceptor%26%2339%3B%2C%2520%2520%2520%2520%2520%2520home%3A%2520MyHomePage()%2C%2520%2520%2520%2520)%3B%2520%2520%7D%7D%26%2347%3B%26%2347%3B%26%2347%3B%2520First%2520pageclass%2520MyHomePage%2520extends%2520StatefulWidget%2520%7B%2520%2520%26%2347%3B%26%2347%3B%26%2347%3B%2520Creates%2520first%2520page.%2520%2520const%2520MyHomePage(%7Bsuper.key%7D)%3B%2520%2520%40override%2520%2520State%26lt%3BMyHomePage%26gt%3B%2520createState()%2520%3D%26gt%3B%2520_MyHomePageState()%3B%7Dclass%2520_MyHomePageState%2520extends%2520State%26lt%3BMyHomePage%26gt%3B%2520%7B%2520%2520String%2520_lastClick%2520%3D%2520%26%2339%3Bnone%26%2339%3B%3B%2520%2520void%2520_clickedOn(String%2520key)%2520%7B%2520%2520%2520%2520setState(()%2520%7B%2520%2520%2520%2520%2520%2520_lastClick%2520%3D%2520key%3B%2520%2520%2520%2520%7D)%3B%2520%2520%7D%2520%2520%40override%2520%2520void%2520initState()%2520%7B%2520%2520%2520%2520super.initState()%3B%2520%2520%2520%2520ui_web.platformViewRegistry.registerViewFactory(%2520%2520%2520%2520%2520%2520_htmlElementViewType%2C%2520%2520%2520%2520%2520%2520(int%2520viewId)%2520%3D%26gt%3B%2520_htmlElement%2C%2520%2520%2520%2520)%3B%2520%2520%7D%2520%2520%40override%2520%2520Widget%2520build(BuildContext%2520context)%2520%7B%2520%2520%2520%2520return%2520Scaffold(%2520%2520%2520%2520%2520%2520appBar%3A%2520AppBar(%2520%2520%2520%2520%2520%2520%2520%2520title%3A%2520const%2520Text(%26%2339%3BPointerInterceptor%2520demo%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520actions%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520PointerInterceptorPlatform.instance.buildWidget(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2347%3B%26%2347%3B%2520debug%3A%2520true%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520IconButton(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520icon%3A%2520const%2520Icon(Icons.add_alert)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520tooltip%3A%2520%26%2339%3BAppBar%2520Icon%26%2339%3B%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onPressed%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bappbar-icon%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520body%3A%2520Center(%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520Column(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520mainAxisAlignment%3A%2520MainAxisAlignment.center%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520children%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520Text(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2339%3BLast%2520click%2520on%3A%2520%24_lastClick%26%2339%3B%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520key%3A%2520const%2520Key(%26%2339%3Blast-clicked%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520Container(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520color%3A%2520Colors.black%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520width%3A%2520_containerWidth%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520height%3A%2520_containerHeight%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520Stack(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alignment%3A%2520Alignment.center%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520children%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520HtmlElement(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520key%3A%2520const%2520Key(%26%2339%3Bbackground-widget%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onClick%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bhtml-element%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520Row(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520mainAxisAlignment%3A%2520MainAxisAlignment.spaceEvenly%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520children%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520ElevatedButton(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520key%3A%2520const%2520Key(%26%2339%3Btransparent-button%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520const%2520Text(%26%2339%3BNever%2520calls%2520onPressed%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onPressed%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Btransparent-button%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520PointerInterceptorWeb().buildWidget(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520intercepting%3A%2520false%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520ElevatedButton(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520key%3A%2520const%2520Key(%26%2339%3Bwrapped-transparent-button%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520const%2520Text(%26%2339%3BNever%2520calls%2520onPressed%2520transparent%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onPressed%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bwrapped-transparent-button%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520))%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520PointerInterceptorPlatform.instance.buildWidget(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520ElevatedButton(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520key%3A%2520const%2520Key(%26%2339%3Bclickable-button%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520const%2520Text(%26%2339%3BWorks%2520As%2520Expected%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onPressed%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bclickable-button%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520floatingActionButton%3A%2520Row(%2520%2520%2520%2520%2520%2520%2520%2520mainAxisAlignment%3A%2520MainAxisAlignment.end%2C%2520%2520%2520%2520%2520%2520%2520%2520children%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520PointerInterceptorPlatform.instance.buildWidget(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2347%3B%26%2347%3B%2520debug%3A%2520true%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520FloatingActionButton(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520const%2520Icon(Icons.navigation)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onPressed%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bfab-1%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520drawer%3A%2520Drawer(%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520PointerInterceptorPlatform.instance.buildWidget(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%2347%3B%26%2347%3B%2520debug%3A%2520true%2C%2520%26%2347%3B%26%2347%3B%2520Enable%2520this%2520to%2520%26quot%3Bsee%26quot%3B%2520the%2520interceptor%2520covering%2520the%2520column.%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520child%3A%2520Column(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520mainAxisAlignment%3A%2520MainAxisAlignment.center%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520children%3A%2520%26lt%3BWidget%26gt%3B%5B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520ListTile(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520title%3A%2520const%2520Text(%26%2339%3BItem%25201%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onTap%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bdrawer-item-1%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520ListTile(%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520title%3A%2520const%2520Text(%26%2339%3BItem%25202%26%2339%3B)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520onTap%3A%2520()%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520_clickedOn(%26%2339%3Bdrawer-item-2%26%2339%3B)%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520%2520%2520)%2C%2520%2520%2520%2520)%3B%2520%2520%7D%7D%26%2347%3B%26%2347%3B%26%2347%3B%2520Initialize%2520the%2520videoPlayer%2C%2520then%2520render%2520the%2520corresponding%2520view...class%2520HtmlElement%2520extends%2520StatelessWidget%2520%7B%2520%2520%26%2347%3B%26%2347%3B%26%2347%3B%2520Constructor%2520%2520const%2520HtmlElement(%7Bsuper.key%2C%2520required%2520this.onClick%7D)%3B%2520%2520%26%2347%3B%26%2347%3B%26%2347%3B%2520A%2520function%2520to%2520run%2520when%2520the%2520element%2520is%2520clicked%2520%2520final%2520VoidCallback%2520onClick%3B%2520%2520%40override%2520%2520Widget%2520build(BuildContext%2520context)%2520%7B%2520%2520%2520%2520_htmlElement.addEventListener(%2520%2520%2520%2520%2520%2520%26%2339%3Bclick%26%2339%3B%2C%2520%2520%2520%2520%2520%2520(JSAny%3F%2520_)%2520%7B%2520%2520%2520%2520%2520%2520%2520%2520onClick()%3B%2520%2520%2520%2520%2520%2520%7D.toJS%2C%2520%2520%2520%2520)%3B%2520%2520%2520%2520return%2520const%2520HtmlElementView(%2520%2520%2520%2520%2520%2520viewType%3A%2520_htmlElementViewType%2C%2520%2520%2520%2520)%3B%2520%2520%7D%7D%253C%2Fcode">