flutter_svg icon indicating copy to clipboard operation
flutter_svg copied to clipboard

Preloading is not real.

Open martinezinsua opened this issue 2 years ago • 1 comments

When attempting to precache an image using the code provided in the documentation, the images are not actually precached. There is a constant flickering observed when displaying them. This issue occurs starting from version 1.1.6. New preloading method (1.1.6 and above) static Future<ByteData> preCacheImage(String svgFilePath) async { try { final loader = SvgAssetLoader(svgFilePath); return await svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); } on Exception { rethrow; } catch (err) { rethrow; } } Old way <1.1.6 (actually working) static Future<void> preCacheImage(String svgFilePath) async { try { return await precachePicture( ExactAssetPicture( SvgPicture.svgStringDecoderOutsideViewBoxBuilder, svgFilePath), null, ); } on Exception { rethrow; } catch (err) { rethrow; } }

martinezinsua avatar Jul 04 '23 05:07 martinezinsua

Please share a complete eample that results in flickering.

dnfield avatar Jul 05 '23 16:07 dnfield