build method

  1. @override
dynamic build(
  1. Object? context, {
  2. bool asElement = true,
  3. bool resolveDSX = true,
  4. QueryElementProvider? elementProvider,
  5. IntlMessageResolver? intlMessageResolver,
})
override

Implementation

@override
dynamic build(Object? context,
    {bool asElement = true,
    bool resolveDSX = true,
    QueryElementProvider? elementProvider,
    IntlMessageResolver? intlMessageResolver}) {
  if (evaluate(context)) {
    return buildContent(context,
        asElement: asElement,
        resolveDSX: resolveDSX,
        elementProvider: elementProvider);
  } else {
    var elseCondition = this.elseCondition;

    while (elseCondition != null) {
      if (elseCondition.evaluate(context)) {
        return elseCondition.build(context,
            asElement: asElement,
            resolveDSX: resolveDSX,
            elementProvider: elementProvider);
      }
      elseCondition = elseCondition.elseCondition;
    }

    return null;
  }
}