getStyleOfItem_Card method

TextStyle getStyleOfItem_Card(
  1. Object? item,
  2. Color foreColorDefaultForItem
)
inherited

Implementation

TextStyle getStyleOfItem_Card(Object? item, Color foreColorDefaultForItem) {
  if (item is XEnumDef) {
    if (widget.item_TextStyle != null) {
      return widget.item_TextStyle!(item as T)!;
    } else {
      return XStyles.xStyTextForDescr(textColor: item.textColor);
    }
  }
  var backResolved = getBackColorOfItem_Card(item);
  if (backResolved != null) {
    if (ThemeData.estimateBrightnessForColor(backResolved) == Brightness.dark) {
      return XStyles.xStyTextForDescr(textColor: XColors.foregroundLight);
    } else {
      return XStyles.xStyTextForDescr(textColor: XColors.foregroundDark);
    }
  } else if (widget.item_TextStyle == null) {
    return XStyles.xStyTextForDescr(textColor: XColors.foregroundLight);
  } else {
    if (item != null) {
      return widget.item_TextStyle!(((item as T)))!;
    } else {
      return XStyles.xStyTextForDescr(textColor: XColors.foregroundLight);
    }
  }
}