InputStoryContent.fromJson constructor

InputStoryContent.fromJson(
  1. Map<String, dynamic> json
)

Parses whichever InputStoryContent subtype the JSON describes.

Implementation

factory InputStoryContent.fromJson(Map<String, dynamic> json) {
  final object = tdObjectFactories[json['@type']]?.call(json);
  return object is InputStoryContent
      ? object
      : UndecodedInputStoryContent(json);
}