FollowerModel.fromJson constructor

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

Implementation

factory FollowerModel.fromJson(Map<String, dynamic> json) {
  return FollowerModel(
    id: json['id'],
    phoneNumber: json['phoneNumber'],
    password: json['password'],
    name: json['name'],
    photo: json['photo'],
    apiKey: json['apiKey'],
    location:
        json['location'] != null ? Location.fromJson(json['location']) : null,
    notificationToken: json['notificationToken'],
    country:
        json['country'] != null ? Country.fromValue(json['country']) : null,
    createdAt: DateTime.parse(json['createdAt']),
  );
}