mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-02 16:19:44 +08:00
13
lib/models_new/emote/data.dart
Normal file
13
lib/models_new/emote/data.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/emote/package.dart';
|
||||
|
||||
class EmoteModelData {
|
||||
List<Package>? packages;
|
||||
|
||||
EmoteModelData({this.packages});
|
||||
|
||||
factory EmoteModelData.fromJson(Map<String, dynamic> json) => EmoteModelData(
|
||||
packages: (json['packages'] as List<dynamic>?)
|
||||
?.map((e) => Package.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
21
lib/models_new/emote/emote.dart
Normal file
21
lib/models_new/emote/emote.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:PiliPlus/models_new/emote/meta.dart';
|
||||
|
||||
class Emote {
|
||||
String? text;
|
||||
String? url;
|
||||
Meta? meta;
|
||||
|
||||
Emote({
|
||||
this.text,
|
||||
this.url,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
factory Emote.fromJson(Map<String, dynamic> json) => Emote(
|
||||
text: json['text'] as String?,
|
||||
url: json['url'] as String?,
|
||||
meta: json['meta'] == null
|
||||
? null
|
||||
: Meta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
9
lib/models_new/emote/meta.dart
Normal file
9
lib/models_new/emote/meta.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
class Meta {
|
||||
int? size;
|
||||
|
||||
Meta({this.size});
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
size: json['size'] as int?,
|
||||
);
|
||||
}
|
||||
21
lib/models_new/emote/package.dart
Normal file
21
lib/models_new/emote/package.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:PiliPlus/models_new/emote/emote.dart';
|
||||
|
||||
class Package {
|
||||
String? url;
|
||||
int? type;
|
||||
List<Emote>? emote;
|
||||
|
||||
Package({
|
||||
this.url,
|
||||
this.type,
|
||||
this.emote,
|
||||
});
|
||||
|
||||
factory Package.fromJson(Map<String, dynamic> json) => Package(
|
||||
url: json['url'] as String?,
|
||||
type: json['type'] as int?,
|
||||
emote: (json['emote'] as List<dynamic>?)
|
||||
?.map((e) => Emote.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user