getIconFromModel static method

Icon? getIconFromModel({
  1. IconModel? iconModel,
  2. RgbModel? color,
})

Implementation

static Icon? getIconFromModel({IconModel? iconModel, RgbModel? color}) {
  if (iconModel == null) {
    return null;
  }
  if (iconModel.fontFamily == null) {
    return Icon(IconData(iconModel.codePoint!, fontFamily: 'MaterialIcons'),
        color: color != null ? RgbHelper.color(rgbo: color) : null);
  }
  return Icon(
      IconData(iconModel.codePoint!, fontFamily: iconModel.fontFamily),
      color: color != null ? RgbHelper.color(rgbo: color) : null);
}