Click to zoom in sticker

This commit is contained in:
LittleSheep 2025-02-03 22:56:49 +08:00
parent 13e42429a9
commit 838ee4d55d
4 changed files with 52 additions and 13 deletions

View File

@ -12,9 +12,9 @@ post {
body:json { body:json {
{ {
"alias": "AteChip", "alias": "Meltdown",
"name": "Cat ate chips", "name": "Meltdown",
"attachment_id": "d0b692cc64054463", "attachment_id": "IpDPHEbWDDCbBofX",
"pack_id": 2 "pack_id": 4
} }
} }

View File

@ -0,0 +1,11 @@
meta {
name: Get Sticker Packs
type: http
seq: 3
}
get {
url: {{endpoint}}/cgi/uc/stickers/packs
body: none
auth: none
}

View File

@ -0,0 +1,15 @@
meta {
name: Get Stickers
type: http
seq: 4
}
get {
url: {{endpoint}}/cgi/uc/stickers?take=10
body: none
auth: none
}
params:query {
take: 10
}

View File

@ -129,14 +129,27 @@ class MarkdownTextContent extends StatelessWidget {
future: st.lookupSticker(alias), future: st.lookupSticker(alias),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
return UniversalImage( return GestureDetector(
child: UniversalImage(
sn.getAttachmentUrl(snapshot.data!.attachment.rid), sn.getAttachmentUrl(snapshot.data!.attachment.rid),
fit: BoxFit.cover, fit: BoxFit.cover,
width: size, width: size,
height: size, height: size,
cacheHeight: size, cacheHeight: size,
cacheWidth: size, cacheWidth: size,
),
onTap: () {
if (snapshot.data == null) return;
context.pushTransparentRoute(
AttachmentZoomView(
data: [snapshot.data!.attachment],
initialIndex: 0,
heroTags: [const Uuid().v4()],
),
backgroundColor: Colors.black.withOpacity(0.7),
rootNavigator: true,
); );
});
} }
return const SizedBox.shrink(); return const SizedBox.shrink();
}, },