mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
fix download
This commit is contained in:
@@ -74,11 +74,6 @@ class _IllustPageState extends State<IllustPage> {
|
||||
}
|
||||
|
||||
Widget buildImage(double width, double height, int index) {
|
||||
File? downloadFile;
|
||||
if(widget.illust.downloaded) {
|
||||
downloadFile = DownloadManager().getImage(widget.illust.id, index);
|
||||
}
|
||||
|
||||
if (index == 0) {
|
||||
return Text(
|
||||
widget.illust.title,
|
||||
@@ -86,6 +81,10 @@ class _IllustPageState extends State<IllustPage> {
|
||||
).paddingVertical(8).paddingHorizontal(12);
|
||||
}
|
||||
index--;
|
||||
File? downloadFile;
|
||||
if(widget.illust.downloaded) {
|
||||
downloadFile = DownloadManager().getImage(widget.illust.id, index);
|
||||
}
|
||||
if (index == widget.illust.images.length) {
|
||||
return const SizedBox(
|
||||
height: _kBottomBarHeight,
|
||||
@@ -107,6 +106,7 @@ class _IllustPageState extends State<IllustPage> {
|
||||
? widget.illust.images[index].original
|
||||
: "file://${downloadFile.path}"),
|
||||
child: Image(
|
||||
key: ValueKey(index),
|
||||
image: downloadFile == null
|
||||
? CachedImageProvider(widget.illust.images[index].large) as ImageProvider
|
||||
: FileImage(downloadFile) as ImageProvider,
|
||||
|
@@ -53,9 +53,9 @@ class _ImagePageState extends State<ImagePage> with WindowListener{
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ColoredBox(
|
||||
color: FluentTheme.of(context).micaBackgroundColor.withOpacity(1),
|
||||
child: Stack(
|
||||
return ScaffoldPage(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
content: Stack(
|
||||
children: [
|
||||
Positioned.fill(child: PhotoView(
|
||||
backgroundDecoration: const BoxDecoration(
|
||||
@@ -82,7 +82,8 @@ class _ImagePageState extends State<ImagePage> with WindowListener{
|
||||
const Expanded(
|
||||
child: DragToMoveArea(child: SizedBox.expand(),),
|
||||
),
|
||||
WindowButtons(key: ValueKey(windowButtonKey),),
|
||||
if(App.isDesktop)
|
||||
WindowButtons(key: ValueKey(windowButtonKey),),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user