maybeParse static method

FontFamilyValue? maybeParse(
  1. dynamic value
)

Returns a FontFamilyValue if the value is a valid font family. Otherwise returns null.

Implementation

static FontFamilyValue? maybeParse(dynamic value) {
  if (value is List) {
    return FontFamilyValue(value.first as String);
  } else if (value is String) {
    return FontFamilyValue(value);
  }
  return null;
}