Add emote models
This commit is contained in:
parent
7cec28d839
commit
c4eb59f3a5
4 changed files with 514 additions and 0 deletions
118
lib/models/emotes.dart
Normal file
118
lib/models/emotes.dart
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
// Twitch Emotes
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'emotes.g.dart';
|
||||
|
||||
// Twitch Emotes
|
||||
@JsonSerializable(createToJson: false, fieldRename: FieldRename.snake)
|
||||
class ImagesTwitch {
|
||||
final String url1x;
|
||||
final String url2x;
|
||||
final String url4x;
|
||||
|
||||
ImagesTwitch(this.url1x, this.url2x, this.url4x);
|
||||
|
||||
factory ImagesTwitch.fromJson(Map<String, dynamic> json) => _$ImagesTwitchFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class EmoteTwitch {
|
||||
final String id;
|
||||
final String name;
|
||||
final ImagesTwitch images;
|
||||
final String? tier;
|
||||
final String? emoteType;
|
||||
final String? emoteSetId;
|
||||
|
||||
EmoteTwitch(this.id, this.name, this.images, this.tier, this.emoteType, this.emoteSetId);
|
||||
|
||||
factory EmoteTwitch.fromJson(Map<String, dynamic> json) => _$EmoteTwitchFromJson(json);
|
||||
}
|
||||
|
||||
// BTTV Emotes
|
||||
@JsonSerializable(createToJson: false)
|
||||
class EmoteBTTVGlobal {
|
||||
final String id;
|
||||
final String code;
|
||||
final String imageType;
|
||||
final String userId;
|
||||
|
||||
EmoteBTTVGlobal(this.id, this.code, this.imageType, this.userId);
|
||||
|
||||
factory EmoteBTTVGlobal.fromJson(Map<String, dynamic> json) => _$EmoteBTTVGlobalFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class UserBTTV {
|
||||
final String id;
|
||||
final String name;
|
||||
final String displayName;
|
||||
final String providerId;
|
||||
|
||||
UserBTTV(this.id, this.name, this.displayName, this.providerId);
|
||||
|
||||
factory UserBTTV.fromJson(Map<String, dynamic> json) => _$UserBTTVFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class EmoteBTTVShared {
|
||||
final String id;
|
||||
final String code;
|
||||
final String imageType;
|
||||
final UserBTTV user;
|
||||
|
||||
EmoteBTTVShared(this.id, this.code, this.imageType, this.user);
|
||||
|
||||
factory EmoteBTTVShared.fromJson(Map<String, dynamic> json) => _$EmoteBTTVSharedFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class EmoteBTTVChannel {
|
||||
final String id;
|
||||
final List<String> bots;
|
||||
final List<EmoteBTTVGlobal> channelEmotes;
|
||||
final List<EmoteBTTVShared> sharedEmotes;
|
||||
|
||||
EmoteBTTVChannel(this.id, this.bots, this.channelEmotes, this.sharedEmotes);
|
||||
|
||||
factory EmoteBTTVChannel.fromJson(Map<String, dynamic> json) => _$EmoteBTTVChannelFromJson(json);
|
||||
}
|
||||
|
||||
// FFZ Emotes
|
||||
@JsonSerializable(createToJson: false)
|
||||
class UserFFZ {
|
||||
final int id;
|
||||
final String name;
|
||||
final String displayName;
|
||||
|
||||
UserFFZ(this.id, this.name, this.displayName);
|
||||
|
||||
factory UserFFZ.fromJson(Map<String, dynamic> json) => _$UserFFZFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class ImagesFFZ {
|
||||
@JsonKey(name: '1x')
|
||||
final String url1x;
|
||||
@JsonKey(name: '2x')
|
||||
final String? url2x;
|
||||
@JsonKey(name: '4x')
|
||||
final String? url4x;
|
||||
|
||||
ImagesFFZ(this.url1x, this.url2x, this.url4x);
|
||||
|
||||
factory ImagesFFZ.fromJson(Map<String, dynamic> json) => _$ImagesFFZFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: false)
|
||||
class EmoteFFZ {
|
||||
final int id;
|
||||
final UserFFZ user;
|
||||
final String code;
|
||||
final ImagesFFZ images;
|
||||
final String imageType;
|
||||
|
||||
EmoteFFZ(this.id, this.user, this.code, this.images, this.imageType);
|
||||
|
||||
factory EmoteFFZ.fromJson(Map<String, dynamic> json) => _$EmoteFFZFromJson(json);
|
||||
}
|
||||
92
lib/models/emotes.g.dart
Normal file
92
lib/models/emotes.g.dart
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'emotes.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImagesTwitch _$ImagesTwitchFromJson(Map<String, dynamic> json) {
|
||||
return ImagesTwitch(
|
||||
json['url1x'] as String,
|
||||
json['url2x'] as String,
|
||||
json['url4x'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
EmoteTwitch _$EmoteTwitchFromJson(Map<String, dynamic> json) {
|
||||
return EmoteTwitch(
|
||||
json['id'] as String,
|
||||
json['name'] as String,
|
||||
ImagesTwitch.fromJson(json['images'] as Map<String, dynamic>),
|
||||
json['tier'] as String?,
|
||||
json['emoteType'] as String?,
|
||||
json['emoteSetId'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
EmoteBTTVGlobal _$EmoteBTTVGlobalFromJson(Map<String, dynamic> json) {
|
||||
return EmoteBTTVGlobal(
|
||||
json['id'] as String,
|
||||
json['code'] as String,
|
||||
json['imageType'] as String,
|
||||
json['userId'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
UserBTTV _$UserBTTVFromJson(Map<String, dynamic> json) {
|
||||
return UserBTTV(
|
||||
json['id'] as String,
|
||||
json['name'] as String,
|
||||
json['displayName'] as String,
|
||||
json['providerId'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
EmoteBTTVShared _$EmoteBTTVSharedFromJson(Map<String, dynamic> json) {
|
||||
return EmoteBTTVShared(
|
||||
json['id'] as String,
|
||||
json['code'] as String,
|
||||
json['imageType'] as String,
|
||||
UserBTTV.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
|
||||
EmoteBTTVChannel _$EmoteBTTVChannelFromJson(Map<String, dynamic> json) {
|
||||
return EmoteBTTVChannel(
|
||||
json['id'] as String,
|
||||
(json['bots'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
(json['channelEmotes'] as List<dynamic>)
|
||||
.map((e) => EmoteBTTVGlobal.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
(json['sharedEmotes'] as List<dynamic>)
|
||||
.map((e) => EmoteBTTVShared.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
UserFFZ _$UserFFZFromJson(Map<String, dynamic> json) {
|
||||
return UserFFZ(
|
||||
json['id'] as int,
|
||||
json['name'] as String,
|
||||
json['displayName'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
ImagesFFZ _$ImagesFFZFromJson(Map<String, dynamic> json) {
|
||||
return ImagesFFZ(
|
||||
json['1x'] as String,
|
||||
json['2x'] as String?,
|
||||
json['4x'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
EmoteFFZ _$EmoteFFZFromJson(Map<String, dynamic> json) {
|
||||
return EmoteFFZ(
|
||||
json['id'] as int,
|
||||
UserFFZ.fromJson(json['user'] as Map<String, dynamic>),
|
||||
json['code'] as String,
|
||||
ImagesFFZ.fromJson(json['images'] as Map<String, dynamic>),
|
||||
json['imageType'] as String,
|
||||
);
|
||||
}
|
||||
301
pubspec.lock
301
pubspec.lock
|
|
@ -1,6 +1,27 @@
|
|||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
_fe_analyzer_shared:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "22.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.7.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -15,6 +36,62 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.1.0"
|
||||
built_value:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -29,6 +106,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: checked_yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -36,6 +127,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -43,6 +141,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -50,6 +162,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -57,6 +176,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
|
@ -67,6 +200,76 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: frontend_server_client
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_multi_server
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.3"
|
||||
json_annotation:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: json_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
json_serializable:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: json_serializable
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.4"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -81,6 +284,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -88,11 +305,60 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -114,6 +380,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_transform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -135,6 +408,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timing
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -149,5 +429,26 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
sdks:
|
||||
dart: ">=2.12.0 <3.0.0"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ environment:
|
|||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
json_annotation: ^4.0.1
|
||||
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
|
|
@ -32,6 +33,8 @@ dependencies:
|
|||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
build_runner: ^2.1.1
|
||||
json_serializable: ^4.1.4
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue