setElementSRC function

bool setElementSRC(
  1. Element element,
  2. String src
)

Sets the element src depending of the identified type.

Implementation

bool setElementSRC(Element element, String src) {
  if (element is ImageElement) {
    // ignore: unsafe_html
    element.src = src;
    return true;
  } else if (element is ScriptElement) {
    // ignore: unsafe_html
    element.src = src;
    return true;
  } else if (element is InputElement) {
    element.src = src;
    return true;
  } else if (element is MediaElement) {
    element.src = src;
    return true;
  } else if (element is EmbedElement) {
    // ignore: unsafe_html
    element.src = src;
    return true;
  } else if (element is IFrameElement) {
    // ignore: unsafe_html
    element.src = src;
    return true;
  } else if (element is SourceElement) {
    element.src = src;
    return true;
  } else if (element is TrackElement) {
    element.src = src;
    return true;
  } else if (element is ImageButtonInputElement) {
    element.src = src;
    return true;
  } else {
    return false;
  }
}