getIsContent static method

bool getIsContent(
  1. Object source
)

Determines whether a given source should be treated as inline content.

  • Runs through all registered AssetResourceContentDetector functions.
  • If any return true, the source is considered inline content.
  • Falls back to _AssetResource.getIsContent(source) if none match.

Example

final isContent = AssetResource.getIsContent('{"key": "value"}');
print(isContent); // true

Implementation

static bool getIsContent(Object source) {
  for (final d in _contentDetectors) {
    try {
      if (d(source)) return true;
    } catch (_) {
      // ignore detector errors
    }
  }

  return _AssetResource.getIsContent(source);
}