mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: pm: share video
Closes #693 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -181,27 +181,38 @@ class ChatItem extends StatelessWidget {
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
dynamic aid = content['id'];
|
||||
if (aid is String) {
|
||||
aid = int.tryParse(aid);
|
||||
}
|
||||
dynamic bvid = content["bvid"];
|
||||
if (aid == null && bvid == null) {
|
||||
SmartDialog.showToast('null');
|
||||
if (content['source'] == 16) {
|
||||
PageUtils.viewBangumi(epId: content['id']);
|
||||
return;
|
||||
}
|
||||
bvid ??= IdUtils.av2bv(aid);
|
||||
SmartDialog.showLoading();
|
||||
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||
SmartDialog.dismiss<dynamic>().then(
|
||||
(e) => PageUtils.toVideoPage(
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: <String, String?>{
|
||||
'pic': content['thumb'],
|
||||
'heroTag': Utils.makeHeroTag(bvid),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (content['source'] == 5) {
|
||||
dynamic aid = content['id'];
|
||||
if (aid is String) {
|
||||
aid = int.tryParse(aid);
|
||||
}
|
||||
dynamic bvid = content["bvid"];
|
||||
if (aid == null && bvid == null) {
|
||||
SmartDialog.showToast('null');
|
||||
return;
|
||||
}
|
||||
bvid ??= IdUtils.av2bv(aid);
|
||||
SmartDialog.showLoading();
|
||||
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||
SmartDialog.dismiss<dynamic>().then(
|
||||
(e) => PageUtils.toVideoPage(
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: <String, String?>{
|
||||
'pic': content['thumb'],
|
||||
'heroTag': Utils.makeHeroTag(bvid),
|
||||
},
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
SmartDialog.showToast(
|
||||
'unsupported source type: ${content['source']}');
|
||||
},
|
||||
child: NetworkImgLayer(
|
||||
width: 220,
|
||||
|
||||
Reference in New Issue
Block a user