opt: image view

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-12 20:23:21 +08:00
parent 7905f51067
commit be371e002a
3 changed files with 38 additions and 38 deletions

View File

@@ -232,6 +232,8 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
itemCount: widget.sources.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
onDoubleTapDown: (TapDownDetails details) {
_doubleTapLocalPosition = details.localPosition;
},
@@ -351,36 +353,31 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
}
Widget _itemBuilder(sources, index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.back();
},
child: Center(
child: Hero(
tag: sources[index],
child: CachedNetworkImage(
fadeInDuration: const Duration(milliseconds: 0),
fadeOutDuration: const Duration(milliseconds: 0),
imageUrl: _thumbList[index] && _quality != 100
? '${sources[index]}@${_quality}q.webp'
: sources[index],
fit: BoxFit.contain,
progressIndicatorBuilder: (context, url, progress) {
return Container(
return Center(
child: Hero(
tag: sources[index],
child: CachedNetworkImage(
fadeInDuration: const Duration(milliseconds: 0),
fadeOutDuration: const Duration(milliseconds: 0),
imageUrl: _thumbList[index] && _quality != 100
? '${sources[index]}@${_quality}q.webp'
: sources[index],
fit: BoxFit.contain,
progressIndicatorBuilder: (context, url, progress) {
return Center(
child: SizedBox(
width: 150.0,
alignment: Alignment.center,
child: LinearProgressIndicator(value: progress.progress ?? 0),
);
},
errorListener: (value) {
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
_thumbList[index] = false;
});
),
);
},
errorListener: (value) {
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
_thumbList[index] = false;
});
},
),
});
},
),
),
);

View File

@@ -102,9 +102,10 @@ class _ActionPanelState extends State<ActionPanel> {
),
);
},
icon: const Icon(
icon: Icon(
FontAwesomeIcons.shareFromSquare,
size: 16,
color: color,
semanticLabel: "转发",
),
style: TextButton.styleFrom(
@@ -119,9 +120,10 @@ class _ActionPanelState extends State<ActionPanel> {
child: TextButton.icon(
onPressed: () => _dynamicsController.pushDetail(widget.item, 1,
action: 'comment'),
icon: const Icon(
icon: Icon(
FontAwesomeIcons.comment,
size: 16,
color: color,
semanticLabel: "评论",
),
style: TextButton.styleFrom(

View File

@@ -82,16 +82,17 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
double width = box.maxWidth;
return Stack(
children: [
Hero(
tag: content.bvid,
child: NetworkImgLayer(
type: null,
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
semanticsLabel: content.title,
),
// Hero(
// tag: content.bvid,
// child:
NetworkImgLayer(
type: null,
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
semanticsLabel: content.title,
),
// ),
if (content.badge != null && type == 'pgc')
PBadge(
text: content.badge['text'],