Как запретить flutter web htmlelementview улавливать касания от объектов над ним? - PullRequest
1 голос
/ 18 июня 2020

Я использую представление элемента HTML из dart: html для отображения веб-страницы в моем веб-приложении Flutter. Он улавливает все штрихи в своей области, в том числе те, что на FAB над ним, а также те, что находятся на ящике строительных лесов в контексте. Мне даже не нужен сенсорный ввод в веб-просмотре, я просто хочу отобразить его. Также обратите внимание, что AbsorPointer и ignorepointer не решают проблему. Вот код, отображающий веб-страницу внутри каркаса.

final IFrameElement _iframeElement = IFrameElement();
_iframeElement.src = "webpageurl";
_iframeElement.style.border = 'none';
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
  'iframeElement',
  (int viewId) => _iframeElement,
);
Widget _iframeWidget;
_iframeWidget = HtmlElementView(
  key: UniqueKey(),
  viewType: 'iframeElement',
);
return Center(child: IgnorePointer(child: _iframeWidget));

enter image description here enter image description here

Edit:

final IFrameElement _iframeElement = IFrameElement();
_iframeElement.src = "https://index.hu/";
_iframeElement.style.border = 'none';
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
  'iframeElement',
  (int viewId) => _iframeElement,
);
Widget _iframeWidget;
_iframeWidget = HtmlElementView(
  key: UniqueKey(),
  viewType: 'iframeElement',
);
return Stack(
  children: <Widget>[
    IgnorePointer(
      ignoring: true,
      child: Center(
        child: _iframeWidget,
      ),
    ),
    Container(
      color: Colors.transparent,
    ),
  ],
);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...