TextSpan.fromJson constructor

TextSpan.fromJson(
  1. Object? j
)

Implementation

factory TextSpan.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return TextSpan(
    content: switch (json['content']) {
      null => '',
      Object $1 => decodeString($1),
    },
    beginOffset: switch (json['beginOffset']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
  );
}