fromJson static method

TPMessageFile? fromJson(
  1. dynamic json
)

Implementation

static TPMessageFile? fromJson(dynamic json) {
  try {
    final map = json as Map<String, dynamic>;
    return TPMessageFile(
      url: map["url"] as String,
      size: (map["size"] as num).toInt(),
      contentType: map["contentType"] as String,
    );
  } catch (e) {
    return null;
  }
}