feature: zoom in media viewer

This commit is contained in:
otsmr 2026-02-12 23:28:24 +01:00
parent b59687c5ca
commit 15ae2b5669
5 changed files with 19 additions and 15 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## 0.0.92
- Adds option to zoom in received images / videos
- Fixes issue with "reuploaded requested" not working
- Fixes race condition while writing to the log file
## 0.0.91
- Fixes link preview on iOS

View file

@ -218,20 +218,11 @@ Future<void> startDownloadMedia(MediaFile media, bool force) async {
}
}
int failCounter = 0;
Future<void> downloadFileFast(
MediaFile media,
String apiUrl,
File filePath,
) async {
if (failCounter < 2) {
failCounter += 1;
await requestMediaReupload(media.mediaId);
return;
}
failCounter = 0;
final response =
await http.get(Uri.parse(apiUrl)).timeout(const Duration(seconds: 10));

View file

@ -378,7 +378,7 @@ Future<void> uploadFileFastOrEnqueue(
try {
Log.info('Uploading fast: ${task.taskId}');
final response =
await requestMultipart.send().timeout(const Duration(seconds: 4));
await requestMultipart.send().timeout(const Duration(seconds: 8));
var status = TaskStatus.failed;
if (response.statusCode == 200) {
status = TaskStatus.complete;

View file

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:lottie/lottie.dart';
import 'package:no_screenshot/no_screenshot.dart';
import 'package:photo_view/photo_view.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/src/database/daos/contacts.dao.dart';
import 'package:twonly/src/database/tables/mediafiles.table.dart'
@ -536,15 +537,22 @@ class _MediaViewerViewState extends State<MediaViewerView> {
children: [
if (videoController != null)
Positioned.fill(
child: VideoPlayer(videoController!),
child: PhotoView.customChild(
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained,
child: VideoPlayer(videoController!),
),
)
else if (currentMedia != null &&
currentMedia!.mediaFile.type == MediaType.image ||
currentMedia!.mediaFile.type == MediaType.gif)
Positioned.fill(
child: Image.file(
currentMedia!.tempPath,
fit: BoxFit.contain,
child: PhotoView(
imageProvider: FileImage(
currentMedia!.tempPath,
),
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained,
),
),
],

View file

@ -242,7 +242,6 @@ class _MemoriesPhotoSliderViewState extends State<MemoriesPhotoSliderView> {
child: VideoPlayerWrapper(
videoPath: filePath,
),
// childSize: const Size(300, 300),
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.covered * 4.1,