fromJson static method

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

Convert the body of the HTTP response into a OpenApiChannelUserFollowResponse instance

Implementation

static OpenApiChannelUserFollowResponse fromJson(Map<String, dynamic>? json) {
  List<dynamic>? data = json?['data'];

  final List<UserFollow> userFollowList = [];

  if (data != null) {
    for (var item in data) {
      final result = UserFollow.fromJson(item);
      if (result != null) {
        userFollowList.add(result);
      }
    }
  }

  return OpenApiChannelUserFollowResponse(
      userFollowList: userFollowList,
      message: json?['message'],
      status: json?['status'],
      pagination: json?['pagination']?['cursor'],
      total: json?['total']);
}