getIconFromModelWithFlutterColor static method

Icon getIconFromModelWithFlutterColor({
  1. IconModel? iconModel,
  2. Color? color,
  3. String? semanticLabel,
})

Implementation

static Icon getIconFromModelWithFlutterColor(
    {IconModel? iconModel, Color? color, String? semanticLabel}) {
  if (iconModel == null) {
    return Icon(Icons.touch_app, color: color, semanticLabel: semanticLabel);
  }
  if (iconModel.fontFamily == null) {
    return Icon(IconData(iconModel.codePoint!, fontFamily: 'MaterialIcons'),
        color: color, semanticLabel: semanticLabel);
  }
  return Icon(
      IconData(iconModel.codePoint!, fontFamily: iconModel.fontFamily),
      color: color,
      semanticLabel: semanticLabel);
}