ElementCreatedCallback typedef

ElementCreatedCallback = void Function(Object element)

The signature of the function that gets called when the HtmlElementView DOM element is created.

element is the DOM element that was created.

This callback is called before element is attached to the DOM, so it can be modified as needed by the Flutter web application.

See HtmlElementView.fromTagName that receives a callback of this type.

Flutter uses type Object so this API doesn't force any JS interop API implementation to Flutter users. This element can be cast to any compatible JS interop type as needed. For example: JSAny (from dart:js_interop), HTMLElement (from package:web) or any custom JS interop definition. See "Next-generation JS interop": https://dart.cn/interop/js-interop

Implementation

typedef ElementCreatedCallback = void Function(Object element);