TextMethodProvider constructor

TextMethodProvider()

Implementation

TextMethodProvider() {
  pushMethodProp(
    NodeProps.kFontStyle,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.fontStyle(value);
      }
    }, "normal"),
  );
  pushMethodProp(
    NodeProps.kLetterSpacing,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is double) {
        consumer.letterSpacing(value);
      }
    }, -1.0),
  );
  pushMethodProp(
    NodeProps.kColor,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is int) {
        consumer.color(value);
      }
    }, Colors.transparent.value),
  );
  pushMethodProp(
    NodeProps.kFontSize,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is double) {
        consumer.fontSize(value);
      }
    }, NodeProps.kDefaultFontSizeSp),
  );
  pushMethodProp(
    NodeProps.kNumberOfLines,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is int) {
        consumer.setNumberOfLines(value);
      }
    }, kMaxLineCount),
  );
  pushMethodProp(
    NodeProps.kFontFamily,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.fontFamily(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kFontWeight,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.fontWeight(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kTextDecorationLine,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.textDecorationLine(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kTextDecorationStyle,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.textDecorationStyle(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kTextDecorationColor,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is int) {
        consumer.textDecorationColor(value);
      }
    }, Colors.black.value),
  );
  pushMethodProp(
    NodeProps.kPropShadowOffset,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is VoltronMap) {
        consumer.textShadowOffset(value);
      }
    }, null),
  );
  pushMethodProp(
    NodeProps.kPropShadowRadius,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is double) {
        consumer.textShadowRadius(value);
      }
    }, 0),
  );
  pushMethodProp(
    NodeProps.kPropShadowColor,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is int) {
        consumer.setTextShadowColor(value);
      }
    }, Colors.transparent.value),
  );
  pushMethodProp(
    NodeProps.kLineHeight,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is int) {
        consumer.lineHeight(value);
      }
    }, -1),
  );
  pushMethodProp(
    NodeProps.kTextAlign,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.setTextAlign(value);
      }
    }, "left"),
  );
  pushMethodProp(
    NodeProps.kText,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.text(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kEllipsizeMode,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is String) {
        consumer.setEllipsizeMode(value);
      }
    }, ""),
  );
  pushMethodProp(
    NodeProps.kPropEnableScale,
    StyleMethodProp((consumer, value) {
      if (consumer is TextVirtualNode && value is bool) {
        consumer.enableScale = value;
      }
    }, false),
  );
}