From 51a05ea372047ed6b8ecf6d0be0a9900ac04cdfa Mon Sep 17 00:00:00 2001 From: verboomp Date: Tue, 3 Feb 2026 15:23:57 +0100 Subject: [PATCH] Trying to fix image loading on dev --- .../lib/pages/customer/picture_fullscreen_dialog.dart | 9 ++++++++- .../lib/pages/customer/picture_widget.dart | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_fullscreen_dialog.dart b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_fullscreen_dialog.dart index e5b42ab..21896d3 100644 --- a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_fullscreen_dialog.dart +++ b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_fullscreen_dialog.dart @@ -54,9 +54,16 @@ class PictureFullscreenDialog extends StatelessWidget { child: Image.network( headers: {cred.name: cred.value}, dto.imageUrl, + frameBuilder: (context, child, frame, wasSynchronouslyLoaded) { + return child; + }, loadingBuilder: (context, child, loadingProgress) { if (loadingProgress == null) return child; - return Text("Loading..."); + return Center( + child: CircularProgressIndicator( + value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0, + ), + ); }, ), ), diff --git a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart index 3e93594..cb8dfbb 100644 --- a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart +++ b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart @@ -145,7 +145,7 @@ class _PictureWidgetState extends State { Widget _imageWidget(PictureDto dto) { Header cred = HeaderUtils().getAuthHeader(); - + return GestureDetector( key: const Key("image"), behavior: HitTestBehavior.opaque, @@ -158,13 +158,14 @@ class _PictureWidgetState extends State { headers: {cred.name: cred.value}, dto.normalSizeUrl, fit: BoxFit.contain, + frameBuilder: (context, child, frame, wasSynchronouslyLoaded) { + return child; + }, loadingBuilder: (context, child, loadingProgress) { if (loadingProgress == null) return child; return Center( child: CircularProgressIndicator( - value: loadingProgress.expectedTotalBytes != null - ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! - : 0, + value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0, ), ); },