emitCustom method
Implementation
void emitCustom(String type, [Object? detail]) {
emitEvent(
CustomEvent(
type,
// Note de-reference.
// ignore: invalid_runtime_check_with_js_interop_types
CustomEventInit(detail: detail?.toJSBox),
),
);
}