mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-26 19:18:43 +00: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;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
String? _parseString(String? value) {
|
||||
if (value == null || value.isEmpty) return null;
|
||||
return value;
|
||||
}
|
||||
|
||||
class DynamicNoneModel {
|
||||
DynamicNoneModel({
|
||||
this.tips,
|
||||
|
||||
@@ -681,7 +681,11 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: NetworkImgLayer(
|
||||
src: emote.hasGifUrl() ? emote.gifUrl : emote.url,
|
||||
src: emote.hasWebpUrl()
|
||||
? emote.webpUrl
|
||||
: emote.hasGifUrl()
|
||||
? emote.gifUrl
|
||||
: emote.url,
|
||||
type: ImageType.emote,
|
||||
width: size,
|
||||
height: size,
|
||||
|
||||
Reference in New Issue
Block a user