135 lines
3.2 KiB
Dart
135 lines
3.2 KiB
Dart
import 'dart:convert';
|
|
|
|
LiveStreamsResponseModel liveStreamsResponseModelFromJson(String str) =>
|
|
LiveStreamsResponseModel.fromJson(json.decode(str));
|
|
|
|
String liveStreamsResponseModelToJson(LiveStreamsResponseModel data) =>
|
|
json.encode(data.toJson());
|
|
|
|
class LiveStreamsResponseModel {
|
|
bool? isSuccess;
|
|
int? statusCode;
|
|
String? message;
|
|
Data? data;
|
|
dynamic errors;
|
|
|
|
LiveStreamsResponseModel({
|
|
this.isSuccess,
|
|
this.statusCode,
|
|
this.message,
|
|
this.data,
|
|
this.errors,
|
|
});
|
|
|
|
factory LiveStreamsResponseModel.fromJson(Map<String, dynamic> json) =>
|
|
LiveStreamsResponseModel(
|
|
isSuccess: json["isSuccess"],
|
|
statusCode: json["statusCode"],
|
|
message: json["message"],
|
|
data: json["data"] == null ? null : Data.fromJson(json["data"]),
|
|
errors: json["errors"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"isSuccess": isSuccess,
|
|
"statusCode": statusCode,
|
|
"message": message,
|
|
"data": data?.toJson(),
|
|
"errors": errors,
|
|
};
|
|
}
|
|
|
|
class Data {
|
|
int? totalCount;
|
|
List<SingelStreamModel>? items;
|
|
|
|
Data({this.totalCount, this.items});
|
|
|
|
factory Data.fromJson(Map<String, dynamic> json) => Data(
|
|
totalCount: json["totalCount"],
|
|
items:
|
|
json["items"] == null
|
|
? []
|
|
: List<SingelStreamModel>.from(
|
|
json["items"]!.map((x) => SingelStreamModel.fromJson(x)),
|
|
),
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"totalCount": totalCount,
|
|
"items":
|
|
items == null ? [] : List<dynamic>.from(items!.map((x) => x.toJson())),
|
|
};
|
|
}
|
|
|
|
class SingelStreamModel {
|
|
String? userId;
|
|
String? firstName;
|
|
String? lastName;
|
|
String? fullName;
|
|
String? profilePicture;
|
|
int? streamId;
|
|
String? streamTitle;
|
|
String? streamDescription;
|
|
String? streamChatRoomId;
|
|
bool? isLive;
|
|
|
|
// New fields
|
|
String? tribeName;
|
|
bool? isTribe;
|
|
int? tribeId;
|
|
|
|
SingelStreamModel({
|
|
this.userId,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.fullName,
|
|
this.profilePicture,
|
|
this.streamId,
|
|
this.streamTitle,
|
|
this.streamDescription,
|
|
this.streamChatRoomId,
|
|
this.isLive,
|
|
this.tribeName,
|
|
this.isTribe,
|
|
this.tribeId,
|
|
});
|
|
|
|
factory SingelStreamModel.fromJson(Map<String, dynamic> json) =>
|
|
SingelStreamModel(
|
|
userId: json["userID"],
|
|
firstName: json["firstName"],
|
|
lastName: json["lastName"],
|
|
fullName: json["fullName"],
|
|
profilePicture: json["profilePicture"],
|
|
streamId: json["streamID"],
|
|
streamTitle: json["streamTitle"],
|
|
streamDescription: json["streamDescription"],
|
|
streamChatRoomId: json["streamChatRoomId"],
|
|
isLive: json["isLive"],
|
|
|
|
// New fields
|
|
tribeName: json["tribeName"],
|
|
isTribe: json["isTribe"],
|
|
tribeId: json["tribeID"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"userID": userId,
|
|
"firstName": firstName,
|
|
"lastName": lastName,
|
|
"fullName": fullName,
|
|
"profilePicture": profilePicture,
|
|
"streamID": streamId,
|
|
"streamTitle": streamTitle,
|
|
"streamDescription": streamDescription,
|
|
"streamChatRoomId": streamChatRoomId,
|
|
"isLive": isLive,
|
|
|
|
// New fields
|
|
"tribeName": tribeName,
|
|
"isTribe": isTribe,
|
|
"tribeID": tribeId,
|
|
};
|
|
}
|