From 48a9bea2f79190277061eae78e6f563c5937399a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Tue, 4 Jul 2023 00:20:46 +0200 Subject: [PATCH] fix(pagerenderer): :bug: re-add offline image to map rendering --- lib/util/render.dart | 11 +++++++++-- pubspec.lock | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/util/render.dart b/lib/util/render.dart index 1debe38..c38045b 100644 --- a/lib/util/render.dart +++ b/lib/util/render.dart @@ -465,8 +465,15 @@ class PageRenderer { width: width * 0.8, height: height * 0.3, child: WidgetZoom( - zoomWidget: - CachedNetworkImage(imageUrl: img.attributes["src"]!), + zoomWidget: CachedNetworkImage( + imageUrl: img.attributes["src"]!, + errorWidget: (context, url, error) => + (offlineImage != null) + ? Image.file(offlineImage) + : Flexible( + child: Text(loc.imageError), + ), + ), heroAnimationTag: 'tag', ), ), diff --git a/pubspec.lock b/pubspec.lock index 9f0ff98..74ae3d7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -318,6 +318,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_map: dependency: "direct main" description: @@ -409,13 +414,13 @@ packages: source: hosted version: "3.3.0" intl: - dependency: transitive + dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.18.0" io: dependency: transitive description: