Add twitch (default) user model
This commit is contained in:
parent
a9053430ba
commit
f269503f34
2 changed files with 45 additions and 0 deletions
23
lib/models/user.dart
Normal file
23
lib/models/user.dart
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user.g.dart';
|
||||
|
||||
// Twitch (default) user
|
||||
@JsonSerializable(createToJson: false, fieldRename: FieldRename.snake)
|
||||
class UserTwitch {
|
||||
final String id;
|
||||
final String login;
|
||||
final String displayName;
|
||||
final String type;
|
||||
final String broadcasterType;
|
||||
final String description;
|
||||
final String profileImageUrl;
|
||||
final String offlineImageUrl;
|
||||
final String viewCount;
|
||||
final String createdAt;
|
||||
|
||||
UserTwitch(this.id, this.login, this.displayName, this.type, this.broadcasterType, this.description, this.profileImageUrl, this.offlineImageUrl,
|
||||
this.viewCount, this.createdAt);
|
||||
|
||||
factory UserTwitch.fromJson(Map<String, dynamic> json) => _$UserTwitchFromJson(json);
|
||||
}
|
||||
22
lib/models/user.g.dart
Normal file
22
lib/models/user.g.dart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
UserTwitch _$UserTwitchFromJson(Map<String, dynamic> json) {
|
||||
return UserTwitch(
|
||||
json['id'] as String,
|
||||
json['login'] as String,
|
||||
json['display_name'] as String,
|
||||
json['type'] as String,
|
||||
json['broadcaster_type'] as String,
|
||||
json['description'] as String,
|
||||
json['profile_image_url'] as String,
|
||||
json['offline_image_url'] as String,
|
||||
json['view_count'] as String,
|
||||
json['created_at'] as String,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue