opt: reply pic showing

This commit is contained in:
bggRGjQaUbCoE
2024-09-07 10:46:55 +08:00
parent 70cc762299
commit 72a59384b9
4 changed files with 26 additions and 12 deletions

View File

@@ -50,7 +50,7 @@ class PBadge extends StatelessWidget {
}
EdgeInsets paddingStyle =
const EdgeInsets.symmetric(vertical: 1, horizontal: 6);
const EdgeInsets.symmetric(vertical: 1, horizontal: 3);
double fontSize = 11;
BorderRadius br = BorderRadius.circular(4);

View File

@@ -1,5 +1,6 @@
import 'dart:math';
import 'package:PiliPalaX/common/widgets/badge.dart';
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
import 'package:PiliPalaX/common/widgets/nine_grid_view.dart';
import 'package:PiliPalaX/pages/preview/view.dart';
@@ -23,6 +24,8 @@ Widget image(
? 2 * imageWidth
: imageWidth;
imageHeight = imageWidth * min(ratioHW, maxRatio);
} else if (picArr.length == 2) {
imageWidth = imageHeight = 2 * imageWidth;
}
return NineGridView(
type: NineGridType.weiBo,
@@ -46,16 +49,26 @@ Widget image(
},
);
},
child: ClipRRect(
child: Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12),
child: NetworkImgLayer(
src: picArr[index]['img_src'],
width: imageWidth,
height: imageWidth,
height: imageHeight,
origAspectRatio:
picArr[index]['img_width'] / picArr[index]['img_height'],
),
),
if (picArr[index]['img_height'] / picArr[index]['img_width'] > 22 / 9)
const PBadge(
text: '长图',
right: 8,
bottom: 8,
),
],
),
),
);
}

View File

@@ -140,7 +140,8 @@ class _NineGridViewState extends State<NineGridView> {
double space = widget.space;
double itemW;
if (widget.type == NineGridType.weiBo &&
(itemCount == 1 || itemCount == 2 || itemCount == 4)) {
(itemCount == 1 || itemCount == 2)) {
// || itemCount == 4
itemW = (width - space) / 2;
} else {
itemW = (width - space * 2) / 3;

View File

@@ -659,7 +659,7 @@ class VideoIntroController extends GetxController {
final res = await VideoHttp.aiConclusion(
bvid: bvid,
cid: lastPlayCid.value,
upMid: videoDetail.value.owner!.mid!,
upMid: videoDetail.value.owner?.mid,
);
SmartDialog.dismiss();
if (res['status']) {