resolve method

CountdownExpiredContent? resolve(
  1. VariableScope variables
)

Implementation

CountdownExpiredContent? resolve(VariableScope variables) {
  final resolvedHeader = header.resolve(variables);
  final resolvedBodyImageUrl = variables.resolve(bodyImageUrl ?? '').trim();
  final resolvedBodyText = variables.resolve(bodyText).trim();
  final resolvedCtaText = variables.resolve(ctaText).trim();

  if (resolvedHeader == null ||
      resolvedBodyText.isEmpty ||
      resolvedCtaText.isEmpty ||
      !_isOptionalHttpUrl(resolvedBodyImageUrl)) {
    return null;
  }

  return CountdownExpiredContent(
    header: resolvedHeader,
    bodyImageUrl: resolvedBodyImageUrl.isEmpty ? null : resolvedBodyImageUrl,
    bodyImagePlaceholder: bodyImagePlaceholder,
    bodyText: resolvedBodyText,
    ctaText: resolvedCtaText,
  );
}