fromMap static method

AttributedString? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible AttributedString instance from a Map value.

Implementation

static AttributedString? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = AttributedString(
    backgroundColor: map['backgroundColor'] != null
        ? UtilColor.fromStringRepresentation(map['backgroundColor'])
        : null,
    baselineOffset: map['baselineOffset'],
    expansion: map['expansion'],
    foregroundColor: map['foregroundColor'] != null
        ? UtilColor.fromStringRepresentation(map['foregroundColor'])
        : null,
    kern: map['kern'],
    ligature: map['ligature'],
    obliqueness: map['obliqueness'],
    strikethroughColor: map['strikethroughColor'] != null
        ? UtilColor.fromStringRepresentation(map['strikethroughColor'])
        : null,
    strikethroughStyle:
        UnderlineStyle.fromNativeValue(map['strikethroughStyle']),
    string: map['string'],
    strokeColor: map['strokeColor'] != null
        ? UtilColor.fromStringRepresentation(map['strokeColor'])
        : null,
    strokeWidth: map['strokeWidth'],
    textEffect:
        AttributedStringTextEffectStyle.fromNativeValue(map['textEffect']),
    underlineColor: map['underlineColor'] != null
        ? UtilColor.fromStringRepresentation(map['underlineColor'])
        : null,
    underlineStyle: UnderlineStyle.fromNativeValue(map['underlineStyle']),
  );
  return instance;
}