decodeIconFontDeclaration static method

HWIconFont? decodeIconFontDeclaration(
  1. DartObject? obj
)

The HWIconFont an HWIconFont(...) written in a schema holds, or null when obj is not one.

The counterpart of decodeIconFont for the font a schema names itself: it carries family and package, where a Flutter IconData carries fontFamily and fontPackage.

Implementation

static HWIconFont? decodeIconFontDeclaration(DartObject? obj) {
  if (obj == null || obj.isNull) return null;
  final family = getField(obj, 'family')?.toStringValue();
  if (family == null || family.isEmpty) return null;
  final package = getField(obj, 'package')?.toStringValue();
  return HWIconFont(
    family: family,
    package: package == null || package.isEmpty ? null : package,
  );
}