HtmlElementView.fromTagName currently has the following example in its dartdoc:
import 'package:flutter/widgets.dart';
import 'package:web/web.dart' as web;
// ...
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return HtmlElementView.fromTagName(
tagName: 'div',
onElementCreated: (Object element) {
element as web.HTMLElement;
element.style
..backgroundColor = 'blue'
..border = '1px solid red';
},
);
}
}
|
/// Creates a platform view that creates a DOM element specified by [tagName]. |
#139696 is planning on removing the dependency to package:web in Flutter, so while the above code example is valid, it does not pass analysis as Flutter no longer depends on package:web. This example should now instead move to flutter.dev once that PR removes it from the dartdoc.
HtmlElementView.fromTagNamecurrently has the following example in its dartdoc:flutter/packages/flutter/lib/src/widgets/platform_view.dart
Line 413 in 3da9bc1
#139696 is planning on removing the dependency to
package:webin Flutter, so while the above code example is valid, it does not pass analysis as Flutter no longer depends onpackage:web. This example should now instead move to flutter.dev once that PR removes it from the dartdoc.