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 userId;
|
|
|
|
|
final String userLogin;
|
|
|
|
|
final String userName;
|
|
|
|
|
final String gameId;
|
|
|
|
|
final String gameName;
|
|
|
|
|
final String title;
|
|
|
|
|
final int viewerCount;
|
|
|
|
|
final String startedAt;
|
|
|
|
|
final String thumbnailUrl;
|
|
|
|
|
|
2021-11-22 01:26:17 -05:00
|
|
|
const StreamTwitch(
|
2021-11-18 22:13:01 -05:00
|
|
|
this.userId,
|
|
|
|
|
this.userLogin,
|
|
|
|
|
this.userName,
|
|
|
|
|
this.gameId,
|
|
|
|
|
this.gameName,
|
|
|
|
|
this.title,
|
|
|
|
|
this.viewerCount,
|
|
|
|
|
this.startedAt,
|
|
|
|
|
this.thumbnailUrl,
|
|
|
|
|
);
|
2021-11-11 22:48:23 -05:00
|
|
|
|
2023-04-29 11:34:28 -04:00
|
|
|
factory StreamTwitch.fromJson(Map<String, dynamic> json) =>
|
|
|
|
|
_$StreamTwitchFromJson(json);
|
2021-11-11 22:48:23 -05:00
|
|
|
}
|
2021-11-26 01:14:47 -05:00
|
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false, fieldRename: FieldRename.snake)
|
|
|
|
|
class StreamsTwitch {
|
|
|
|
|
final List<StreamTwitch> data;
|
|
|
|
|
final Map<String, String> pagination;
|
|
|
|
|
|
|
|
|
|
const StreamsTwitch(
|
|
|
|
|
this.data,
|
|
|
|
|
this.pagination,
|
|
|
|
|
);
|
|
|
|
|
|
2023-04-29 11:34:28 -04:00
|
|
|
factory StreamsTwitch.fromJson(Map<String, dynamic> json) =>
|
|
|
|
|
_$StreamsTwitchFromJson(json);
|
2021-11-26 01:14:47 -05:00
|
|
|
}
|