From 9e2d14f0e79775750eaa2cd8e27a14e8c79074fe Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 3 Aug 2023 20:59:25 +0200 Subject: [PATCH] fix(neon): Fix svg loading for web Signed-off-by: jld3103 --- packages/neon/neon/lib/src/utils/push_utils.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index 13a8a808..4e2982c4 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -7,7 +7,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:flutter_svg/flutter_svg.dart' show SvgFileLoader, vg; +import 'package:flutter_svg/flutter_svg.dart' show SvgStringLoader, vg; import 'package:image/image.dart' as img; import 'package:meta/meta.dart'; import 'package:neon/src/blocs/accounts.dart'; @@ -106,7 +106,7 @@ class PushUtils { final cacheManager = DefaultCacheManager(); final file = await cacheManager.getSingleFile(notification.icon!); - final pictureInfo = await vg.loadPicture(SvgFileLoader(file), null); + final pictureInfo = await vg.loadPicture(SvgStringLoader(file.readAsStringSync()), null); const largeIconSize = 256; final scale = largeIconSize / pictureInfo.size.longestSide;