StatusUpdate.fromJson constructor

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

Constructs a StatusUpdate instance from a JSON map.

json is a map containing the key-value pairs for the status update properties.

Implementation

StatusUpdate.fromJson(Map<String, dynamic> json)
    : this.description = Convert.toStr(json['description'], ''),
      this.category = Convert.toStr(json['category'], ''),
      this.createdAt =
          Convert.toDateTime(json['created_at'], Helpers.defaultDateTime()),
      this.user = Convert.toStr(json['user'], ''),
      this.userTitle = Convert.toStr(json['user_title'], ''),
      this.pin = Convert.toBooleanN(json['pin']),
      this.project = json.containsKey('project')
          ? StatusUpdateProject.fromJson(json['project'])
          : null;