Metadata.fromJson constructor

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

Creates a new Metadata object from a JSON map.

Implementation

factory Metadata.fromJson(Map<String, dynamic> json) => Metadata(
      banner: json['banner'] as String?,
      lud06: json['lud06'] as String?,
      lud16: json['lud16'] as String?,
      website: json['website'] as String?,
      picture: json['picture'] as String?,
      display_name: json['display_name'] as String?,
      name: json['name'] as String?,
      about: json['about'] as String?,
      username: json['username'] as String?,
      displayName: json['displayName'] as String?,
      nip05: json['nip05'] as String?,
      followingCount: json['followingCount'] is String
          ? int.parse(json['followingCount'] as String)
          : json['followingCount'] as int?,
      followersCount: json['followersCount'] is String
          ? int.parse(json['followersCount'] as String)
          : json['followersCount'] as int?,
      nip05valid: json['nip05valid'] is String
          ? json['nip05valid'] == 'true'
          : json['nip05valid'] as bool?,
      zapService: json['zapService'] as String?,
    );