toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'count': count,
      'data': List<T>.from(data.map(
        (x) {
          if (T is Listing) {
            return (x as Listing).toJson();
          } else if (T is NativeAppData) {
            return (x as NativeAppData).toJson();
          } else {
            throw Exception('Invalid Type');
          }
        },
      )),
    };