mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: push dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart'
|
||||
show SourceModel;
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'network_img_layer.dart';
|
||||
@@ -43,16 +45,16 @@ Widget htmlRender({
|
||||
// width: isEmote ? 22 : null,
|
||||
// height: isEmote ? 22 : null,
|
||||
// );
|
||||
String? clazz = attributes['class'];
|
||||
String? height = RegExp(r'max-height:(\d+)px')
|
||||
.firstMatch('${attributes['style']}')
|
||||
?.group(1);
|
||||
if (height != null) {
|
||||
return NetworkImgLayer(
|
||||
if (clazz?.contains('cut-off') == true || height != null) {
|
||||
return CachedNetworkImage(
|
||||
width: constrainedWidth,
|
||||
height: double.parse(height),
|
||||
src: imgUrl,
|
||||
type: 'emote',
|
||||
boxFit: BoxFit.contain,
|
||||
height: height != null ? double.parse(height) : null,
|
||||
imageUrl: Utils.thumbnailImgUrl(imgUrl),
|
||||
fit: BoxFit.contain,
|
||||
);
|
||||
}
|
||||
return Hero(
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:get/get.dart';
|
||||
import '../../models/home/rcmd/result.dart';
|
||||
import '../../models/model_rec_video_item.dart';
|
||||
import 'stat/stat.dart';
|
||||
import '../../http/dynamics.dart';
|
||||
import '../../utils/id_utils.dart';
|
||||
import '../../utils/utils.dart';
|
||||
import '../constants.dart';
|
||||
@@ -67,20 +66,9 @@ class VideoCardV extends StatelessWidget {
|
||||
id = 'cv${videoItem.param}';
|
||||
}
|
||||
if (uri.startsWith('http')) {
|
||||
String path = Uri.parse(uri).path;
|
||||
if (isStringNumeric(path.split('/')[1])) {
|
||||
// 请求接口
|
||||
var res =
|
||||
await DynamicsHttp.dynamicDetail(id: path.split('/')[1]);
|
||||
if (res['status']) {
|
||||
Get.toNamed('/dynamicDetail', arguments: {
|
||||
'item': res['data'],
|
||||
'floor': 1,
|
||||
'action': 'detail'
|
||||
});
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
String id = Uri.parse(uri).path.split('/')[1];
|
||||
if (isStringNumeric(id)) {
|
||||
Utils.pushDynFromId(id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user