matches method

  1. @override
bool matches(
  1. ExtensionContext context
)

This method is called to test whether or not this extension needs to do any work in this context.

By default returns true if supportedTags contains the element's name

Implementation

@override
bool matches(ExtensionContext context) {
  if (!supportedTags.contains(context.elementName)) {
    return false;
  }

  if (context.elementName == "svg") {
    return true;
  }

  return _matchesSvgNetworkSource(context) ||
      _matchesSvgAssetUri(context) ||
      _matchesSvgDataUri(context);
}