Announcement.fromJson constructor Null safety

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

Implementation

factory Announcement.fromJson(Map<String, dynamic> json) => Announcement(
      title: json['title'] as String,
      id: json['id'] as int,
      nextId: json['nextId'] as int,
      lastId: json['lastId'] as int,
      weight: json['weight'] as int,
      imgUrl: json['imgUrl'] as String,
      url: json['url'] as String,
      description: json['description'] as String,
      publishedTime: json['publishedTime'] as String,
      expireTime: json['expireTime'] as String,
      applicant: json['applicant'] as String,
      applicationId: json['application_id'] as String,
      reviewStatus: json['reviewStatus'] as bool,
      reviewDescription: json['reviewDescription'] as String,
      tags: List<String>.from(
        (json['tag'] as List<dynamic>).map(
          (dynamic x) => x,
        ),
      ),
    );