mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix parse dyn emoji
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1109,11 +1109,19 @@ class Emoji {
|
|||||||
late num size;
|
late num size;
|
||||||
|
|
||||||
Emoji.fromJson(Map<String, dynamic> json) {
|
Emoji.fromJson(Map<String, dynamic> json) {
|
||||||
url = json['webp_url'] ?? json['gif_url'] ?? json['icon_url'];
|
url =
|
||||||
|
_parseString(json['webp_url']) ??
|
||||||
|
_parseString(json['gif_url']) ??
|
||||||
|
_parseString(json['icon_url']);
|
||||||
size = json['size'] ?? 1;
|
size = json['size'] ?? 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String? _parseString(String? value) {
|
||||||
|
if (value == null || value.isEmpty) return null;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
class DynamicNoneModel {
|
class DynamicNoneModel {
|
||||||
DynamicNoneModel({
|
DynamicNoneModel({
|
||||||
this.tips,
|
this.tips,
|
||||||
|
|||||||
@@ -681,7 +681,11 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
spanChildren.add(
|
spanChildren.add(
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: emote.hasGifUrl() ? emote.gifUrl : emote.url,
|
src: emote.hasWebpUrl()
|
||||||
|
? emote.webpUrl
|
||||||
|
: emote.hasGifUrl()
|
||||||
|
? emote.gifUrl
|
||||||
|
: emote.url,
|
||||||
type: ImageType.emote,
|
type: ImageType.emote,
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
|
|||||||
Reference in New Issue
Block a user