| 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import 'package:flutter/rendering.dart'; |
| 6 | |
| 7 | import 'framework.dart'; |
| 8 | import 'platform_view.dart'; |
| 9 | |
| 10 | /// The platform-specific implementation of [HtmlElementView]. |
| 11 | extension HtmlElementViewImpl on HtmlElementView { |
| 12 | /// Creates an [HtmlElementView] that renders a DOM element with the given |
| 13 | /// [tagName]. |
| 14 | static HtmlElementView createFromTagName({ |
| 15 | Key? key, |
| 16 | required String tagName, |
| 17 | bool isVisible = true, |
| 18 | ElementCreatedCallback? onElementCreated, |
| 19 | required PlatformViewHitTestBehavior hitTestBehavior, |
| 20 | }) { |
| 21 | throw UnimplementedError('HtmlElementView is only available on Flutter Web' ); |
| 22 | } |
| 23 | |
| 24 | /// Called from [HtmlElementView.build] to build the widget tree. |
| 25 | /// |
| 26 | /// This is not expected to be invoked in non-web environments. It throws if |
| 27 | /// that happens. |
| 28 | /// |
| 29 | /// The implementation on Flutter Web builds a platform view and handles its |
| 30 | /// lifecycle. |
| 31 | Widget buildImpl(BuildContext context) { |
| 32 | throw UnimplementedError('HtmlElementView is only available on Flutter Web' ); |
| 33 | } |
| 34 | } |
| 35 | |