2021-11-11 22:48:23 -05:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
|
|
part 'stream.g.dart';
|
|
|
|
|
|
|
|
|
|
// Object for live Twitch streams.
|
|
|
|
|
@JsonSerializable(createToJson: false, fieldRename: FieldRename.snake)
|
2021-11-22 01:26:17 -05:00
|
|
|
class StreamTwitch {
|
2021-11-11 22:48:23 -05:00
|
|
|
final String id;
|
|
|
|
|
final String userId;
|
|
|
|
|
final String userLogin;
|
|
|
|
|
final String userName;
|
|
|
|
|
final String gameId;
|
|
|
|
|
final String gameName;
|
|
|
|
|
final String type;
|
|
|
|
|
final String title;
|
|
|
|
|
final int viewerCount;
|
|
|
|
|
final String startedAt;
|
|
|
|
|
final String language;
|
|
|
|
|
final String thumbnailUrl;
|
|
|
|
|
final List<String>? tagIds;
|
|
|
|
|
final bool isMature;
|
|
|
|
|
|
2021-11-22 01:26:17 -05:00
|
|
|
const StreamTwitch(
|
2021-11-18 22:13:01 -05:00
|
|
|
this.id,
|
|
|
|
|
this.userId,
|
|
|
|
|
this.userLogin,
|
|
|
|
|
this.userName,
|
|
|
|
|
this.gameId,
|
|
|
|
|
this.gameName,
|
|
|
|
|
this.type,
|
|
|
|
|
this.title,
|
|
|
|
|
this.viewerCount,
|
|
|
|
|
this.startedAt,
|
|
|
|
|
this.language,
|
|
|
|
|
this.thumbnailUrl,
|
|
|
|
|
this.tagIds,
|
|
|
|
|
this.isMature,
|
|
|
|
|
);
|
2021-11-11 22:48:23 -05:00
|
|
|
|
2021-11-22 01:26:17 -05:00
|
|
|
factory StreamTwitch.fromJson(Map<String, dynamic> json) => _$StreamTwitchFromJson(json);
|
2021-11-11 22:48:23 -05:00
|
|
|
}
|