Skip to content

Commit fe7bdec

Browse files
committed
fix: changed download url to action.php
1 parent 19441f7 commit fe7bdec

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

lib/components/lists/image_grid_view.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@ class _ImageGridViewState extends State<ImageGridView> {
3131
void _onTapImage(ImageModel image) {
3232
final bool selected = widget.selectedList.contains(image);
3333
if (widget.selectedList.isNotEmpty && !selected) {
34-
if (widget.onSelectImage != null) widget.onSelectImage!(image);
34+
widget.onSelectImage?.call(image);
3535
} else if (selected) {
36-
if (widget.onDeselectImage != null) widget.onDeselectImage!(image);
36+
widget.onDeselectImage?.call(image);
3737
} else {
38-
if (widget.onTapImage != null) widget.onTapImage!(image);
38+
widget.onTapImage?.call(image);
3939
}
4040
}
4141

4242
void _onLongPressImage(ImageModel image) {
4343
if (widget.selectedList.isEmpty) {
4444
HapticFeedback.mediumImpact();
4545
}
46+
if (widget.selectedList.contains(image)) return;
4647
setState(() {
47-
if (widget.onSelectImage != null) widget.onSelectImage!(image);
48+
widget.onSelectImage?.call(image);
4849
});
4950
}
5051

@@ -69,8 +70,7 @@ class _ImageGridViewState extends State<ImageGridView> {
6970
return ClipRRect(
7071
borderRadius: index == widget.imageList.length - 1
7172
? BorderRadius.only(
72-
topRight: widget.imageList.length <
73-
Settings.getImageCrossAxisCount(context)
73+
topRight: widget.imageList.length < Settings.getImageCrossAxisCount(context)
7474
? Radius.circular(10.0)
7575
: Radius.zero,
7676
bottomRight: Radius.circular(10.0),

lib/network/images.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ Future<XFile?> downloadImage(
295295
if (!await askMediaPermission()) return null;
296296
try {
297297
await ApiClient.download(
298-
path: image.elementUrl,
298+
path: 'action.php',
299+
queryParameters: {
300+
'id': image.id,
301+
'part': 'e',
302+
},
299303
outputPath: localPath,
300304
);
301305
await ImageGallerySaver.saveFile(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies:
5050
# Device
5151
device_info_plus: ^10.1.0 # Get device info (version)
5252
flutter_local_notifications: ^17.2.0 # Throws notifications on download or upload
53-
open_filex: ^4.3.2 # Open files with devices apps
53+
open_filex: ^4.4.0 # Open files with devices apps
5454
workmanager: ^0.5.0 # Background processes (auto upload)
5555
image_gallery_saver: ^2.0.3 # Download images
5656

0 commit comments

Comments
 (0)