id
int64
393k
2.82B
repo
stringclasses
68 values
title
stringlengths
1
936
body
stringlengths
0
256k
labels
stringlengths
2
508
priority
stringclasses
3 values
severity
stringclasses
3 values
2,655,962,998
flutter
[flutter_svg] Unable to load asset: resources/icons/mouse.svg;
_Imported from https://github.com/dnfield/flutter_svg/issues/604_ Original report by @krll-kov on Oct 1, 2021 ``` Unable to load asset: resources/icons/mouse.svg; #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:224)<asynchronous suspension>#1 AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:68)<asynchronous suspension>#2 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:462)<asynchronous suspension> ``` ``` Bad state: Invalid SVG data; #0 SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:823)#1 SvgParser.parse (package:flutter_svg/parser.dart:25)#2 Svg.fromSvgString (package:flutter_svg/svg.dart:119)#3 Svg.svgPictureStringDecoder (package:flutter_svg/svg.dart:80)#4 SvgPicture.svgStringDecoder.<anonymous closure> (package:flutter_svg/svg.dart:571)#5 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:473)<asynchronous suspension> ``` Maybe it'll be good to add some onError widget alternative for cases when package can not load some asset to avoid unhandled exceptions. This can happen in release mode if user deletes resources folder or if image downloads broken. --- Comment by @dnfield on Oct 1, 2021 Does the error builder not work in this case? --- Comment by @krll-kov on Oct 1, 2021 > Does the error builder not work in this case? Isn't it global? What if i want something specific for error on this svg and something other for others? And the main goal is to avoid any unhandled exceptions in application --- Comment by @dnfield on Oct 1, 2021 Ah! haha I was imagining API that doesn't exist. This should be easy to fix. --- Comment by @krll-kov on Oct 2, 2021 > Ah! haha I was imagining API that doesn't exist. This should be easy to fix. I thought you were talking about this https://flutter.dev/docs/testing/errors#define-a-custom-error-widget-for-build-phase-errors --- Comment by @dnfield on Oct 13, 2021 I could have sworn there was a PR at some point to add an `errorBuilder` property to `SvgPicture`. I would be in support of this. The patch just needs a test to be landed. I can get to this eventually but I'm not sure when right now - if you're interested in writing it I'd be happy to review. --- Comment by @Taosif7 on Jan 13, 2022 > ``` > Unable to load asset: resources/icons/mouse.svg; #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:224)<asynchronous suspension>#1 AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:68)<asynchronous suspension>#2 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:462)<asynchronous suspension> > ``` > > ``` > Bad state: Invalid SVG data; #0 SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:823)#1 SvgParser.parse (package:flutter_svg/parser.dart:25)#2 Svg.fromSvgString (package:flutter_svg/svg.dart:119)#3 Svg.svgPictureStringDecoder (package:flutter_svg/svg.dart:80)#4 SvgPicture.svgStringDecoder.<anonymous closure> (package:flutter_svg/svg.dart:571)#5 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:473)<asynchronous suspension> > ``` > > Maybe it'll be good to add some onError widget alternative for cases when package can not load some asset to avoid unhandled exceptions. This can happen in release mode if user deletes resources folder or if image downloads broken. Please make sure that the path to your file is included in pubspec.yaml --- Comment by @krll-kov on Jan 14, 2022 > > ``` > > Unable to load asset: resources/icons/mouse.svg; #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:224)<asynchronous suspension>#1 AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:68)<asynchronous suspension>#2 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:462)<asynchronous suspension> > > ``` > > > > > > > > > > > > > > > > > > > > > > > > ``` > > Bad state: Invalid SVG data; #0 SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:823)#1 SvgParser.parse (package:flutter_svg/parser.dart:25)#2 Svg.fromSvgString (package:flutter_svg/svg.dart:119)#3 Svg.svgPictureStringDecoder (package:flutter_svg/svg.dart:80)#4 SvgPicture.svgStringDecoder.<anonymous closure> (package:flutter_svg/svg.dart:571)#5 AssetBundlePictureProvider._loadAsync (package:flutter_svg/src/picture_provider.dart:473)<asynchronous suspension> > > ``` > > > > > > > > > > > > > > > > > > > > > > > > Maybe it'll be good to add some onError widget alternative for cases when package can not load some asset to avoid unhandled exceptions. This can happen in release mode if user deletes resources folder or if image downloads broken. > > Please make sure that the path to your file is included in pubspec.yaml Ahahahahaha, do you think i did not do that and posted an issue?) This problem happens in release mode on a small percentage of devices. While almost everyone do not face this bug and have all svgs loaded correctly, there's a little amount of users who can not use the app properly because of this issue --- Comment by @Taosif7 on Jan 14, 2022 > Ahahahahaha, do you think i did not do that and posted an issue?) This problem happens in release mode on a small percentage of devices. While almost everyone do not face this bug and have all svgs loaded correctly, there's a little amount of users who can not use the app properly because of this issue sorry for doubting you, I actually made this mistake a while ago so I thought. anyways. --- Comment by @ferdinaand on Dec 5, 2022 so what's the solution? I encountered this bug today. --- Comment by @acoutts on Feb 2, 2023 Today after upgrading to 2.0 from 1.1.1+1, I'm unable to load svg assets from other packages which previously worked. Could it be related? ```dart SvgPicture.asset( 'assets/images/scan-bar.svg' package: 'componentlib', width: 20, height: 20, ), ``` If I take the same svg file and put it in my own package, then it works. --- Comment by @dnfield on Feb 2, 2023 > Today after upgrading to 2.0 from 1.1.1+1, I'm unable to load svg assets from other packages which previously worked. Could it be related? > > ```dart > SvgPicture.asset( > 'assets/images/scan-bar.svg' > package: 'componentlib', > width: 20, > height: 20, > ), > ``` > > If I take the same svg file and put it in my own package, then it works. There's a bug in the package loading logic in 2.0, sorry about that. --- Comment by @acoutts on Feb 2, 2023 Ah phew!! Glad it's not me. I was going crazy trying different settings on my end, glad to know it's identified. --- Comment by @JaredS129 on Sep 29, 2023 For anyone still experiencing this issue, here's something that worked for me: I discovered that the SVG filenames are case sensitive once you run your app in release mode, hence why this error only appears in production. Check that your SVG filename and the path in your SvgPicture.asset() widget have identical casing. In my case my file was named 'Icon.svg', but the path was 'icon.svg'. This caused the "Bad state: Invalid SVG data" error in release mode only. The SVG was still visible in debug mode. --- Comment by @krll-kov on Sep 30, 2023 My names are lowercase as files, but issue is present
package,p: flutter_svg
low
Critical
2,655,963,135
flutter
[flutter_svg] A valid SVG is throwing exception: Flutter SVG only supports the following formats for `width` and `height`
_Imported from https://github.com/dnfield/flutter_svg/issues/607_ Original report by @prolificcoder on Oct 11, 2021 I have an SVG file that is exported from figma (cannot add the file here on github) google drive link: https://drive.google.com/file/d/1Q0zZQo8hxkHlQOIrF1-FLTGYnlAMigK6/view?usp=sharing it looks like this: ``` <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="#F2F2F2"/> <g clip-path="url(#clip0)"> <path d="M23.8965 8.1416C23.8465 8.09069 23.7823 8.05608 23.7123 8.04231C23.6422 8.02853 23.5697 8.03623 23.5041 8.06439L7.21246 15.0762C7.15133 15.1027 7.09893 15.1459 7.06127 15.2009C7.0236 15.2559 7.00221 15.3203 6.99955 15.3869C6.99689 15.4535 7.01306 15.5195 7.04621 15.5773C7.07936 15.6351 7.12814 15.6824 7.18696 15.7137L11.9115 18.2148C11.9419 18.232 11.9767 18.2397 12.0115 18.237C12.0463 18.2344 12.0796 18.2215 12.107 18.1999L19.3958 12.3208C19.4298 12.2926 19.473 12.2782 19.517 12.2803C19.5611 12.2823 19.6028 12.3008 19.6339 12.3319C19.6651 12.3631 19.6836 12.4048 19.6856 12.4489C19.6877 12.4929 19.6732 12.5361 19.6451 12.5701L13.766 19.8589C13.7441 19.8858 13.7308 19.9186 13.7275 19.9531C13.7242 19.9876 13.7312 20.0224 13.7475 20.0529L16.2487 24.7775C16.2788 24.8344 16.3239 24.882 16.379 24.9152C16.4342 24.9484 16.4974 24.966 16.5617 24.9659H16.5752C16.6418 24.9633 16.7063 24.942 16.7613 24.9044C16.8163 24.8669 16.8596 24.8145 16.8862 24.7534L23.9695 8.5326C23.9979 8.46762 24.0061 8.3956 23.9931 8.32589C23.9801 8.25618 23.9464 8.19198 23.8965 8.1416V8.1416Z" fill="#121212"/> </g> <defs> <clipPath id="clip0"> <rect width="17" height="17" fill="white" transform="translate(7 8)"/> </clipPath> </defs> </svg> ``` When I am loading this I get the following error ``` Another exception was thrown: Unable to load asset: packages/sofi_x_package/lib/icons/p2p_135degree.svg I/flutter (15078): Warning: Flutter SVG only supports the following formats for `width` and `height` on the SVG root: I/flutter (15078): width="100%" I/flutter (15078): width="100px" I/flutter (15078): width="100" (where the number will be treated as pixels). I/flutter (15078): The supplied value (3em) will be discarded and treated as if it had not been specified. I/flutter (15078): Warning: Flutter SVG only supports the following formats for `width` and `height` on the SVG root: I/flutter (15078): width="100%" I/flutter (15078): width="100px" I/flutter (15078): width="100" (where the number will be treated as pixels). I/flutter (15078): The supplied value (3em) will be discarded and treated as if it had not been specified. ``` I tried added px to the width but that doesn't seem to help. This SVG loads fine in chrome or in finder. --- Comment by @dnfield on Oct 12, 2021 I think your error is coming from a different svg. See #605 for fix though.
package,p: flutter_svg
low
Critical
2,655,963,300
flutter
[flutter_svg] Error: 'AssetBundle' isn't a type. AssetBundle? bundle,
_Imported from https://github.com/dnfield/flutter_svg/issues/610_ Original report by @abhilash007 on Oct 19, 2021 ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.23.0+1/lib/svg.dart:325:5: Error: 'AssetBundle' isn't a type. AssetBundle? bundle, --- Comment by @daohoangson on Oct 19, 2021 If you are on stable channel, make sure Flutter version is at least `2.5.0`. You need at least 2.4.0 pre for the latest version of this package. See #611. --- Comment by @AramSemerjyan on Nov 1, 2021 Same for me. Haven't tried it on android yet. But getting error: ``` ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.23.0+1/lib/svg.dart:325:5: Error: Type 'AssetBundle' not found. AssetBundle? bundle, ^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.23.0+1/lib/svg.dart:325:5: Error: 'AssetBundle' isn't a type. AssetBundle? bundle ``` when building on iOS. Here is my `flutter doctor -v` result: ``` [✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-x64, locale en-US) • Flutter version 2.5.3 at /Users/aram/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 18116933e7 (2 weeks ago), 2021-10-15 10:46:35 -0700 • Engine revision d3ea636dc5 • Dart version 2.14.4 [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/aram/Library/Android/sdk ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.0, Build version 13A233 • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.56.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (3 available) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • iPhone 12 Pro Max (mobile) • 41C5B2F0-9B55-49DC-BC3A-13881C97AEE2 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.54 ! Doctor found issues in 1 category. ``` --- Comment by @anglesen1120 on Nov 4, 2021 > Same for me. Haven't tried it on android yet. But getting error: > > ``` > ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.23.0+1/lib/svg.dart:325:5: Error: Type 'AssetBundle' not found. > AssetBundle? bundle, > ^^^^^^^^^^^ > ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.23.0+1/lib/svg.dart:325:5: Error: 'AssetBundle' isn't a type. > AssetBundle? bundle > ``` > > when building on iOS. > > Here is my `flutter doctor -v` result: > > ``` > [✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-x64, locale en-US) > • Flutter version 2.5.3 at /Users/aram/Documents/flutter > • Upstream repository https://github.com/flutter/flutter.git > • Framework revision 18116933e7 (2 weeks ago), 2021-10-15 10:46:35 -0700 > • Engine revision d3ea636dc5 > • Dart version 2.14.4 > > [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) > • Android SDK at /Users/aram/Library/Android/sdk > ✗ cmdline-tools component is missing > Run `path/to/sdkmanager --install "cmdline-tools;latest"` > See https://developer.android.com/studio/command-line for more details. > ✗ Android license status unknown. > Run `flutter doctor --android-licenses` to accept the SDK licenses. > See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. > > [✓] Xcode - develop for iOS and macOS > • Xcode at /Applications/Xcode.app/Contents/Developer > • Xcode 13.0, Build version 13A233 > • CocoaPods version 1.11.2 > > [✓] Chrome - develop for the web > • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome > > [✓] Android Studio (version 4.1) > • Android Studio at /Applications/Android Studio.app/Contents > • Flutter plugin can be installed from: > 🔨 https://plugins.jetbrains.com/plugin/9212-flutter > • Dart plugin can be installed from: > 🔨 https://plugins.jetbrains.com/plugin/6351-dart > • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) > > [✓] VS Code (version 1.56.2) > • VS Code at /Applications/Visual Studio Code.app/Contents > • Flutter extension can be installed from: > 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter > > [✓] Connected device (3 available) > • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) > • iPhone 12 Pro Max (mobile) • 41C5B2F0-9B55-49DC-BC3A-13881C97AEE2 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) > • Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.54 > > ! Doctor found issues in 1 category. > ``` You should be try again with flutter 2.5.3! clean and run again ^^ --- Comment by @pdsliuzhen on Nov 8, 2021 Same for me --- Comment by @cristian1980 on Nov 10, 2021 I had the same issue but, upgrading to 2.5.3 and restarting Android Studio, fixed it. --- Comment by @pdsliuzhen on Nov 15, 2021 my flutter version is 2.2.3 is not ok, upgrade to 2.5 is ok, but i have to use verison 2.2.3 --- Comment by @baguskto on Nov 20, 2021 I use flutter version 2.2.2, and use flutter_svg version 0.22.0. its works like a charm --- Comment by @nizarmasri-rockspoon on Dec 7, 2021 Running on Flutter 2.5.3 stable, cleaned the project and restarted android studio, still getting this error --- Comment by @kannel-outis on Dec 7, 2021 is there any fix for this without upgrading flutter.... the latest flutter version keeps deleting my .gradle folder so it is not an option for me ATM . --- Comment by @shinayser on Jan 19, 2022 I'm having this project right now. Using flutter 2.2.3 and can't upgrade it to 2.8 (or 2.5) yet =( And I dont have direct dependnecy of flutter_svg, it is coming as a transitive dependency from the `flutter_html` package. --- Comment by @dnfield on Jan 19, 2022 Ahh so it sounds like I missed updating a lower bound constraint on the package. That's unfortunate. I don't have a great way to fix that. If you're seeing this issue, you need to either upgrade your flutter SDK or downgrade your flutter_svg... --- Comment by @shinayser on Jan 20, 2022 I was able to fix that by placing: ``` dependency_overrides: flutter_svg: 0.22.0 ``` on my apps's `pubpec.yaml`. --- Comment by @moradnajem on Feb 25, 2022 +1
package,p: flutter_svg
low
Critical
2,655,963,453
flutter
[flutter_svg] Avoid saveLayer with colorFilter when a single path/shape is drawn
_Imported from https://github.com/dnfield/flutter_svg/issues/615_ Original report by @goderbauer on Nov 2, 2021 From discussion it seems like the saveLayer call is unnecessary when the drawn content is just a single path/shape. The saveLayer call should be omitted in that case. Related: https://github.com/flutter/flutter/issues/92874 Internal: b/204888249 --- Comment by @dnfield on Nov 2, 2021 We can probably even do better if flutter_svg keeps an RTree to track overlapping draws. --- Comment by @flar on Nov 2, 2021 Doing this here when the Picture is generated amortizes the cost well. It would be even better if there was an off-line tool that could optimize an SVG file. --- Comment by @dnfield on Nov 2, 2021 Yes. Something to render optimize svg would be really cool.
package,p: flutter_svg
low
Minor
2,655,963,560
flutter
[flutter_svg] Transparent problem in SVG pictures
_Imported from https://github.com/dnfield/flutter_svg/issues/616_ Original report by @MuhmdHsn313 on Nov 11, 2021 I have svg picture with transparent, when I used this package for showing my svg pictures, the transparent not appeared! The actual svg: ![weather_night](https://user-images.githubusercontent.com/33749659/141257538-cf9987cb-a48b-44f1-94c1-1130d96ff026.png) Flutter svg ![Screenshot from 2021-11-11 10-37-57](https://user-images.githubusercontent.com/33749659/141257687-a821ea2d-daf7-42d4-82f7-e104415c9fd1.png) : --- Comment by @dnfield on Nov 11, 2021 Please share the source SVG and if applicable anything else needed to reproduce tihis. However, based on your screenshot I'm going to guess that this is using unsupported filter effects.
package,p: flutter_svg
low
Minor
2,655,963,707
flutter
[flutter_svg] `currentColor` opacity ignored
_Imported from https://github.com/dnfield/flutter_svg/issues/617_ Original report by @FaFre on Nov 15, 2021 The recently added support for `currentColor` in `ThemeData` ignores the colors opacity. For example this will render the icon with full opacity, despite it should be fully invisible: ```dart final icon = svg.fromSvgBytes(iconData, iconKey, theme: SvgTheme(currentColor: Colors.blue.withOpacity(0))); icon ..scaleCanvasToViewBox(canvas, iconSize) ..clipCanvasToViewBox(canvas) ..draw(canvas, Rect.zero); ``` --- Comment by @dnfield on Nov 15, 2021 This really depends on the source of the SVG you are trying to render. If `currentColor` is not used anywhere in the svg source, setting the current color will have no effect. I'll re-open this if there is a reproducible case you can share that shows this, including the SVG. --- Comment by @FaFre on Nov 15, 2021 I threw together a working sample: https://github.com/FaFre/flutter_svg_color_opacity_bug `currentColor` is working for the SVG, it's just that opacity has no effect. --- Comment by @dnfield on Nov 15, 2021 There's no `currentColor` in that SVG, which is: ```svg <?xml version="1.0" encoding="UTF-8"?> <svg version="1.1" id="aerialway" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"> <path d="M13,5H8V2.6c0.1854-0.1047,0.3325-0.2659,0.42-0.46L13.5,1.5C13.7761,1.5,14,1.2761,14,1s-0.2239-0.5-0.5-0.5L8.28,1.15&#xA;&#x9;C8.0954,0.9037,7.8077,0.7562,7.5,0.75C7.0963,0.752,6.7334,0.9966,6.58,1.37L1.5,2C1.2239,2,1,2.2239,1,2.5S1.2239,3,1.5,3&#xA;&#x9;l5.22-0.65C6.7967,2.4503,6.8917,2.5351,7,2.6V5H2C1.4477,5,1,5.4477,1,6v7c0,0.5523,0.4477,1,1,1h11c0.5523,0,1-0.4477,1-1V6&#xA;&#x9;C14,5.4477,13.5523,5,13,5z M7,11H3V7h4V11z M12,11H8V7h4V11z"/> </svg> ``` --- Comment by @dnfield on Nov 15, 2021 Hmm! There seems to be a different bug here - we should not be using the `currentColor` at all in this case. --- Comment by @dnfield on Nov 15, 2021 /cc @bselwe --- Comment by @dnfield on Nov 15, 2021 The other problem is that `color` in the SVG spec doesn't include alpha, so it will just get ignored here. But Chrome and Firefox support it, so this library probably should too - I support rgba values elsewhere where the spec doesn't require it. --- Comment by @bselwe on Nov 17, 2021 @dnfield The `color` property is currently parsed on [`svg`](https://github.com/dnfield/flutter_svg/blob/d2ca8bdc35ec4aac33a878852715b4a27e36851c/lib/src/svg/parser_state.dart#L88), [`g`](https://github.com/dnfield/flutter_svg/blob/d2ca8bdc35ec4aac33a878852715b4a27e36851c/lib/src/svg/parser_state.dart#L155) and [`symbol`](https://github.com/dnfield/flutter_svg/blob/d2ca8bdc35ec4aac33a878852715b4a27e36851c/lib/src/svg/parser_state.dart#L182) elements using [`parseColor`](https://github.com/dnfield/flutter_svg/blob/3ffb3bc511e1fea42723b042a7d6a190df23dade/lib/src/svg/colors.dart#L9) method which seems to include alpha values. Is there something I'm missing here? 🤔 --- Comment by @dnfield on Nov 17, 2021 There's other logic that's kind of a mess that separately parses opacity. I'd have to double check again, but I'm pretty sure there are paths that ignore alpha because it's not part of the spec. --- Comment by @Chralu on Sep 13, 2023 Hello, are there any updates on this issue ? thanks :)
package,p: flutter_svg
low
Critical
2,655,963,834
flutter
[flutter_svg] Add tracing to parsing
_Imported from https://github.com/dnfield/flutter_svg/issues/623_ Original report by @dnfield on Dec 2, 2021 Make it easier for developers to see how long SVG parsing is taking. /cc @jiahaog
package,team-engine,p: flutter_svg
low
Minor
2,655,963,944
flutter
[flutter_svg] After version 1.0.0 colorBlendMode: BlendMode.luminosity does not grey out svgs
_Imported from https://github.com/dnfield/flutter_svg/issues/628_ Original report by @aytunch on Dec 9, 2021 I haven't changed my code just upgraded the package and previously my colored svg was rendering as grey and now it renders with full color. Is there another way to accomplish single color effect? Thanks ``` SvgPicture.asset( "assets/svg/cart.svg", colorBlendMode: BlendMode.luminosity, fit: BoxFit.scaleDown, ), ``` --- Comment by @dnfield on Dec 10, 2021 Can you share a complete reproduction? The implementation around color filtering changed for sure. I would not expect it to have broken this way though.
package,p: flutter_svg
low
Critical
2,655,964,051
flutter
[flutter_svg] Strange result when rendering complex svg
_Imported from https://github.com/dnfield/flutter_svg/issues/630_ Original report by @Ionaru on Dec 10, 2021 Hi, I am not sure if this is the correct place to discuss my issue, because I am not sure it is flutter_svg related. **Description** I'm trying to display an SVG in my application, but the result is not correct. The SVG contains a series of `<defs>` and `<use>` elements where I think the problem lies. The original SVG: https://evemaps.dotlan.net/svg/Solitude.svg I am aware this SVG contains `<style>` , `<script>`, which are not supported by flutter_svg. So I used [svgo](https://github.com/svg/svgo) to clean up the file and got rid of elements I do not need, this is the result: https://gist.github.com/Ionaru/52f1c321c4587c05e512fabe8d0bb26d. The cleaned up SVG seems to render correctly in browsers and GitHub, but when I pass that file to flutter_svg, it renders like this: ![image](https://user-images.githubusercontent.com/3472373/145636563-f18151b3-20d1-4c6a-a0e8-6442f9c6a663.png) My flutter code for this widget is extremely simple, with the file hosted on a local webserver. ```dart Center( child: SvgPicture.network( 'http://127.0.0.1:8080/Solitude.min.svg', ), ), ``` What's going wrong here? Is the modified SVG not valid or is there something in it that flutter_svg cannot parse? **Additional info** Flutter doctor output: ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 10.0.19044.1387], locale en-NL) [✓] Chrome - develop for the web [✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.10.3) [✓] IntelliJ IDEA Ultimate Edition (version 2021.2) [✓] IntelliJ IDEA Ultimate Edition (version 2021.3) [✓] VS Code (version 1.63.0) [✓] Connected device (3 available) • No issues found! ``` flutter_svg version: 1.0.0 --- Comment by @dnfield on Dec 19, 2021 This one is relatively complicated and I'm sure there are bugs here. There are likely issues in the way the `use` and `symbol` are getting processed. --- Comment by @Ionaru on Dec 22, 2021 I'm going to open some separate issues with reproducible behaviour, I'll attempt to make the SVG code as small as possible. --- Comment by @zaif-bsol on Jan 5, 2022 is my issue #641 related to this? Sorry I don't know much about how SVGs work. --- Comment by @Ionaru on Jan 5, 2022 I don't think so, see my comment on your issue. --- Comment by @dnfield on Jan 11, 2022 Looks like there's still one more issue with the way fonts are rendered. I don't know when I'll be able to get back to that, but if you can create a smaller repro again it helps. --- Comment by @Ionaru on Jan 13, 2022 I'll see if I can isolate the issue.
package,p: flutter_svg
low
Critical
2,655,964,168
flutter
[flutter_svg] No fit BoxFit prevent an error "A RenderFlex overflowed by 854 pixels on the right." if specific height is not specified
_Imported from https://github.com/dnfield/flutter_svg/issues/651_ Original report by @VladimirSrednikh on Jan 15, 2022 https://github.com/VladimirSrednikh/flutter_test I have a Container with specific height and a Row inside it when i put an SvgPicture inside that Row without specifing height, i got an error > The following assertion was thrown during layout: > A RenderFlex overflowed by 818 pixels on the right. ``` return new Material( child: new Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ new Container( decoration: const BoxDecoration( color: Colors.grey, border: Border( bottom: BorderSide(width: 1.0, color: Color(0xFFFFFFFF)), ), ), height: 27, child: Row(children: <Widget>[ SvgPicture.asset('assets/images/logo.svg', fit: BoxFit.fitHeight, //height: 27 ), ``` but it gone if i specify exact height of the container and none value of fit parameter can fix it I believe, there must be some way to not specify height and allow image to fit it container without an error be it fitHeight or fitWidth
package,p: flutter_svg
low
Critical
2,655,964,266
flutter
[flutter_svg] Default font colour is white instead of black
_Imported from https://github.com/dnfield/flutter_svg/issues/653_ Original report by @Ionaru on Jan 20, 2022 **Description** Any `<text>` element without a `fill` attribute displays white text instead of black. **SVG code** ```svg <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> <path fill="#999" d="M0,0 L200,0 L200,200 L0,200 Z" /> <text x="100" y="100">Test text</text> </svg> ``` **Expected result (Chrome)** ![image](https://user-images.githubusercontent.com/3472373/150393523-cfa5fc5c-ccc6-499c-b87f-0ad800fcf728.png) **Actual result (Flutter)**, ignore image size differences. ![image](https://user-images.githubusercontent.com/3472373/150393539-5427b77e-d2bf-4781-9dbd-b252153d0818.png) **Version info** - flutter_svg 1.0.1 - Flutter 2.8.0 - Dart 2.15.0 - Chrome 97 - Windows 10 **Additional info** https://www.w3.org/TR/SVG2/painting.html#FillProperties
package,p: flutter_svg
low
Minor
2,655,964,539
flutter
[flutter_svg] Wrong render SVG (use symbol)
_Imported from https://github.com/dnfield/flutter_svg/issues/657_ Original report by @sytungan on Jan 24, 2022 Hi Dan, I get some wrong renders in my app when I try to render an SVG: ```dart SvgPicture.asset('images/test_svg.svg') ``` **Output:** ![Screenshot_2](https://user-images.githubusercontent.com/43126874/150758748-e5ffc64d-64c9-46b5-9bba-e679f1933baf.png) **Expected:** ![Screenshot_1](https://user-images.githubusercontent.com/43126874/150758806-0856c89b-cffe-436f-99c4-9131a2b3e998.png) ------------------ ### The SVG source: ```xml <svg width="240" height="240" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <symbol id="svg_1" viewBox="0 0 105 105"> <path d="M104.613 50.8914C105.019 51.8715 105.019 52.9728 104.613 53.9529L90.4677 88.1017C90.0618 89.0819 89.2831 89.8605 88.3029 90.2665L54.1541 104.411C53.174 104.817 52.0727 104.817 51.0926 104.411L16.9438 90.2665C15.9637 89.8605 15.185 89.0819 14.779 88.1017L0.634084 53.9529C0.228109 52.9728 0.228109 51.8715 0.634084 50.8914L14.779 16.7426C15.185 15.7625 15.9637 14.9838 16.9438 14.5778L51.0926 0.432876C52.0728 0.0269005 53.174 0.0269008 54.1541 0.432877L88.303 14.5778C89.2831 14.9838 90.0618 15.7625 90.4677 16.7426L104.613 50.8914Z" fill="#C4C4C4"/> </symbol> </defs> <rect x="120" y="120" width="60" height="60" fill="#C4C4C4" transform="rotate(51.82871827259324, 150.0, 150.0)"/> <g> <use x="100" y="50" width="60" height="60" xlink:href="#svg_1"/> </g> </svg> ``` ### Version info: - flutter_svg `1.0.3` - Flutter `2.8.1` - Dart `2.15.1` - On mobile devices (both Android and iOS)
package,p: flutter_svg
low
Minor
2,655,964,789
flutter
[flutter_svg] svg not rendering well
_Imported from https://github.com/dnfield/flutter_svg/issues/659_ Original report by @gbbest15 on Jan 28, 2022 i have a problem rending svg to my project... I have already post question in stackoverflow which i will be paste the link here [https://stackoverflow.com/questions/70894249/flutter-svg-not-rendering-properly](link to the stackoverflow)
package,p: flutter_svg
low
Minor
2,655,964,917
flutter
[flutter_svg] Images pixelated (CanvasKit)
_Imported from https://github.com/dnfield/flutter_svg/issues/668_ Original report by @KevMCarp on Feb 18, 2022 When running on web using the canvaskit renderer images are pixelated. canvaskit ![canvaskit](https://user-images.githubusercontent.com/88255595/154757349-e85a87a5-1b3f-41e1-a035-e4d54b6de0d9.png) html ![html](https://user-images.githubusercontent.com/88255595/154757354-76fed787-75a7-4287-94fb-82b3153adb37.png) ```dart void main() { runApp(const TestApp()); } class TestApp extends StatelessWidget { const TestApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: SvgPicture.asset( 'tick.svg', height: 100, ), ), ), ); } } ``` ![tick](https://user-images.githubusercontent.com/88255595/154758685-36be9f3b-f6f6-451d-ac8c-ae430a2632fa.svg) --- Comment by @philqc on Feb 19, 2022 I also get the same issue using Flutter Web with canvaskit. Here is how the SVG is rendered: ![qd_web_rendering](https://user-images.githubusercontent.com/19807706/154806835-be568577-f218-4756-8e5a-2188c23e29c7.png) And here is the SVG file: ![Qd](https://user-images.githubusercontent.com/19807706/154806833-5b63d3c3-632a-4ad4-b186-fbca57cfc01e.svg) Code: ```dart SizedBox( child: Align( alignment: Alignment.center, child: SvgPicture.asset( "assets/svgs/playing-cards/Qd.svg", width: 96, ), ), ), ``` --- Comment by @jonbhanson on Apr 26, 2022 I'm seeing the same thing in my app: slightly aliasing when rendered in canvaskit. --- Comment by @doppio on Jun 3, 2022 Same issue here with my brand logo. Unfortunately, I'll need to use a PNG instead since the loss of quality isn't worth the file size reduction. Could this be related to https://github.com/flutter/flutter/issues/77485? --- Comment by @MarcAnProv on Jun 3, 2022 Same thing is happening for me. --- Comment by @dom3lek on Nov 9, 2022 Any progress of this problem? --- Comment by @LeonardoRosaa on May 19, 2023 Same problem here 😢 --- Comment by @curt-weber on Jun 9, 2023 For CanvasKit - we use a supersampling technique that improves quality: ``` Transform.scale( filterQuality: FilterQuality.medium, scale: 0.5, child: Transform.scale( scale: 2, child: SvgPicture(...), ), ) ``` Keep in mind this is rendering the icon at 2X, so probably only suitable for smaller icons... --- Comment by @RobertApikyan on Jun 30, 2023 > For CanvasKit - we use a supersampling technique that improves quality: > > ``` > Transform.scale( > filterQuality: FilterQuality.medium, > scale: 0.5, > child: Transform.scale( > scale: 2, > child: SvgPicture(...), > ), > ) > ``` > > Keep in mind this is rendering the icon at 2X, so probably only suitable for smaller icons... Fixed for iOS, I had the same pixelated image for iOS devices, Flutter 3.12.0, now it is fixed, thanks a lot! --- Comment by @aytunch on Jun 30, 2023 @RobertApikyan I am confused. Is this issue fixed with the latest Flutter & flutter_svg or with the above workaround? --- Comment by @RobertApikyan on Jul 1, 2023 > @RobertApikyan I am confused. Is this issue fixed with the latest Flutter & flutter_svg or with the above workaround? @aytunch the issue is fixed with the workaround. --- Comment by @blingkonnerth on Oct 11, 2023 any updates on this? Still experiencing this issue on iOS. @curt-weber fix is working for some icons, however it is cutting of images, unless I specifically set `height` and `width` together `Boxfit.contain`. --- Comment by @curt-weber on Oct 11, 2023 If the clipping is only happening on iOS, it could very likely be a bug related to Impeller. You should probably open a flutter issue showing a difference between skia/impeller. It's usually best to set a specific height and/or width so the icon has size (before it's fully loaded, or use placeholder). We found that was the cause of test flakes, attempting to tap an icon that has yet to be encountered (random test order) and thus having no size. cc @dnfield --- Comment by @Adam-Langley on Oct 23, 2023 @curt-weber thanks for the super-sampling suggestion. In cases where the upscale causes partial rendering off-screen, the upscaled image is clipped before it's downscaled again resulting in effects like this: (note the bottom grey icon is clipped because the pre-scaled (2x) version would bleed off-screen. I've put a red square behind the svg to demonstrate the region where the SVG should be) <img width="141" alt="image" src="https://github.com/dnfield/flutter_svg/assets/16373742/4eb8d91f-410f-4888-b596-6adeff2991cd"> Is there a way to force flutter to render the entire widget even when the pixels aren't visible? Or another way to resolve this issue with super sampling? --- Comment by @curt-weber on Oct 24, 2023 There is likely an ancestor widget that is adding clipping (such as a scrollview). You can't pop that clip using `OverflowBox`, but you could perform this same supersampling strategy using `CustomPaint` (or a custom RenderObject) since it doesn't add clipping until you ask it to. You could use [PictureInfo](https://pub.dev/documentation/flutter_svg/latest/svg/Svg-class.html) to obtain a picture for drawing. --- Comment by @hunterwilhelm on Oct 30, 2023 I am running into the clipping issue too when using the transform on iOS. I will have to resort to using png's until this issue is fixed. --- Comment by @curt-weber on Oct 30, 2023 Does this only reproduce on iOS(Impeller)? Testing with a parent clip (scrollview) doesn't reproduce on web (canvaskit) for me. FWIW this technique isn't needed for iOS and you could create a wrapper widget that performs the supersampling just on web, but passes through to the regular SvgPicture elsewhere. There is also a parameter [clipViewbox](https://pub.dev/documentation/vector_graphics/latest/vector_graphics_compat/VectorGraphic/clipViewbox.html) that is available to the lower-level `VectorGraphic` but not exposed to `SvgPicture` - all you would have to do to test is switch to using `VectorGraphic` (clipViewbox=false) and report back your findings. --- Comment by @gabrielginter on Mar 14, 2024 Supersampling workaround doesn't seem to be working anymore on the new Flutter version (issue https://github.com/dnfield/flutter_svg/issues/1013). Is there another way to solve this? --- Comment by @curt-weber on Mar 14, 2024 This is captured within the flutter repo and you can follow for updates here: [#139028](https://github.com/flutter/flutter/issues/139028) --- Comment by @lilran14 on Aug 30, 2024 has anyone been successful in resolving this issue? 🤔
package,p: flutter_svg
low
Critical
2,655,965,067
flutter
[flutter_svg] If we upload svg files in our domain or aws s3 bucket it's not working.
_Imported from https://github.com/dnfield/flutter_svg/issues/672_ Original report by @Sunsiha on Mar 2, 2022 The following code am using for to load the image, SvgPicture.network( 'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/AJ_Digital_Camera.svg', placeholderBuilder: (context) => const CircularProgressIndicator( color: AppColors.primaryPurple, ), height: 50.0, ) The above link is not working. Then i have tried with different url([working svg link](https://www.svgrepo.com/show/2046/dog.svg)) this worked. Why it is behaving like this. How can I sort this? ``` Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 18116933e7 (5 months ago) • 2021-10-15 10:46:35 -0700 Engine • revision d3ea636dc5 Tools • Dart 2.14.4 ``` flutter_svg: ^1.0.0 ======== Exception caught by SVG =================================================================== The following assertion was thrown while parsing PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 16.0, xHeight: 8.0)) in _getDefinitionPaint: Failed to find definition for url(#pattern0) This library only supports <defs> and xlink:href references that are defined ahead of their references. --- Comment by @sahhill on Jul 22, 2022 @Sunsiha Did you find any solution, we are facing the same issue. --- Comment by @umitmutluu on Dec 9, 2022 > The following code am using for to load the image, > > ``` > SvgPicture.network( > 'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/AJ_Digital_Camera.svg', > placeholderBuilder: (context) => > const CircularProgressIndicator( > color: AppColors.primaryPurple, > ), > height: 50.0, > ) > ``` > > The above link is not working. Then i have tried with different url([working svg link](https://www.svgrepo.com/show/2046/dog.svg)) this worked. > > Why it is behaving like this. How can I sort this? > > ``` > Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git > Framework • revision 18116933e7 (5 months ago) • 2021-10-15 10:46:35 -0700 > Engine • revision d3ea636dc5 > Tools • Dart 2.14.4 > ``` > > flutter_svg: ^1.0.0 > > ======== Exception caught by SVG =================================================================== The following assertion was thrown while parsing PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 16.0, xHeight: 8.0)) in _getDefinitionPaint: Failed to find definition for url(#pattern0) > > This library only supports and xlink:href references that are defined ahead of their references. I Recieved same bug --- Comment by @nileshrathore on Dec 8, 2023 having the same issue!
package,p: flutter_svg
low
Critical
2,655,965,226
flutter
[flutter_svg] No response from precachePicture when restart app
_Imported from https://github.com/dnfield/flutter_svg/issues/677_ Original report by @Adrek on Mar 10, 2022 Hello everyone, I will appreciate your help on how the precachePicture works. I have a future function that waits for the preload of an SVG. It then performs another action like sending to a route containing the svg for example. But something happens that I can't understand. ``` Future<void> _preloadImages() async { await precachePicture( ExactAssetPicture( SvgPicture.svgStringDecoderBuilder, 'assets/icons/car_driving.svg'), context); // The first time, the next line is executed correctly. // But, when I press Restart app, the following line is not executed. The app is waiting for the future. print('Go to page that contains svg key'); } ``` - When the app is stopped, I start debugging with F5 in VSCode. The precachePicture function preloads the SVG and executes the next line that sends to another page and displays the widget with the svg. So far so good. - With the application running, I press Restart in VSCode ![dato](https://i.imgur.com/RFxJDqT.png), the precachePicture function is called and it stays there. I get no response from the future, so the next line is not executed. Why is this behavior? It only fixes itself if I stop the app and run it again. I know that in the build release this would not be a problem because the user does not have an option to restart. However, in the development environment it is frustrating to be stopping the application and running again. Thank you very much in advance --- Comment by @dnfield on Mar 10, 2022 Hmm. Perhaps we need to clear the cache when `reassemble` is called. --- Comment by @dnfield on Mar 13, 2022 I don't have a lot of time to do a test case for this - can yo do a small test that calls `PicturerProvider.cache.clear()` when reassemble is called? You can see an example of how to listen to reassemble in https://stackoverflow.com/questions/55281077/how-to-detect-hot-reload-inside-the-code-of-a-flutter-app I'm relatively confident that that is the problem. If you can verify, there's an easy fix for it. --- Comment by @Adrek on Mar 21, 2022 > I don't have a lot of time to do a test case for this - can yo do a small test that calls `PicturerProvider.cache.clear()` when reassemble is called? You can see an example of how to listen to reassemble in https://stackoverflow.com/questions/55281077/how-to-detect-hot-reload-inside-the-code-of-a-flutter-app > > I'm relatively confident that that is the problem. If you can verify, there's an easy fix for it. Thank you very much for answering. I did it according to the link you sent but reassemble is called when it is hot reload but not in hot restart. For another way, I'm calling PicturerProvider.cache.clear() and it doesn't fix the problem when I do Hot restart. Is there another way to attack this issue? Thank you very much for your help. --- Comment by @mekhribonu-s-codexoptimus on Jun 2, 2022 Cant catch exception or any response from precache. Is there any solution?
package,p: flutter_svg
low
Critical
2,655,979,711
flutter
[flutter_svg] Flutter - how add custom font for svg image?
_Imported from https://github.com/dnfield/flutter_svg/issues/680_ Original report by @FetFrumos on Mar 11, 2022 I have svg image(export from Adobe Xd). For the correct display of this file, I need to install an additional font in the system(MAC or Windows) - then the picture is displayed correctly, without this font it is incorrect. but I need to display this drawing in application. I using [flutter_svg](https://pub.dev/packages/flutter_svg) plugin. I download ttf of font, add in assets and pubspec. But after that it doesn't work either. how add custom font for svg image(with flutter_svg)? --- Comment by @dnfield on Mar 13, 2022 I'd find it helpful if you shared a small but complete example of the issue. Some places where this could possibly go wrong: - The font isn't getting included in the pubspec correctly (see https://docs.flutter.dev/cookbook/design/fonts). - The font is getting included as a plain asset and you need to use font loading API to load it (https://api.flutter.dev/flutter/dart-ui/loadFontFromList.html). - For some reason the SVG is getting parsed and rendered to a picture before the font is loaded. - The SVG is not specifying the correct font family information to resolve to your custom font. - The flutter_svg package is not making the right use of font rendering attributes to get the custom font to be used. Obviously if it's that last point, there's a bug in this package. A reproduction case would be able to narrow this down. --- Comment by @L4hibYoussef on Mar 15, 2023 Is there any updates on this. I am appearing to have the same issue. Font is loaded before image is rendered and font is available for use in the app. I am building the app for web using canvaskit. --- Comment by @devalev on Jul 12, 2023 > Is there any updates on this. I am appearing to have the same issue. Font is loaded before image is rendered and font is available for use in the app. I am building the app for web using canvaskit. You need to load the font when executing the application. ``` void main() async { runApp(const MyApp()); } void loadFont() async { var fontLoader = FontLoader("FontName"); fontLoader.addFont(rootBundle.load('fonts/FontName.ttf')); await fontLoader.load(); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { loadFont(); return Container(); } } ``` Please note that sometimes the font-family is specified in extra quotes in the svg file ``` font-family="FontName" ``` and ``` font-family="'FontName'" ``` these are different things, and, accordingly, you need to import different fonts ``` var fontLoader = FontLoader("FontName"); var fontLoader = FontLoader("'FontName'"); ```
package,p: flutter_svg
low
Critical
2,655,979,827
flutter
[flutter_svg] SVG Images from network once fails never load again
_Imported from https://github.com/dnfield/flutter_svg/issues/682_ Original report by @Khushboo141 on Mar 16, 2022 SvgPicture.network(..) if its once fails when you try with making internet off, it will never load again, Even if you on the network. Anyone knows how to fix it? --- Comment by @dupovalo on Aug 11, 2022 In case it helps someone, here is a fix for the issue: https://github.com/dupovalo/flutter_svg/commit/d128fa5d065eb730a2ba1c5d23084da0bbcf8fe5 Take it as a reference since I'm not sure that is 100% correct solution. The main idea is to remove a failed image from pictures cache. This way the image will be reloaded from network, not from cache, on the next widget rebuild. --- Comment by @Wahab-Khan on Jul 28, 2024 @dupovalo I tried your solution ... it reloads the image every single time regardless of whether the network once fails or it successfully loads the image. that causes glitching every time...
package,p: flutter_svg
low
Critical
2,655,979,937
flutter
[flutter_svg] Flutter Web on iOS: Icons randomly turning into blot
_Imported from https://github.com/dnfield/flutter_svg/issues/684_ Original report by @PawlikMichal25 on Mar 18, 2022 In the screen below all green tiles should display exactly same icon, but after a moment of using the page (it's a memory game) some icons randomly render into "blot": ![bug](https://user-images.githubusercontent.com/15315707/158966683-120e9732-370d-4662-85ed-4b6164c75e0c.jpg) Also even the simple back icon in top-left corner turned into blot, even though I'm not rebuilding it as user plays the game and AppBar is not scrollable. I'm using: ``` flutter_svg: 1.0.3 Flutter: 2.10.3 iOS: 15.4, happens on both Safari and Chrome ``` Here are the raw SVG icons, but it also happens with other ones: ![ic_done_circle](https://user-images.githubusercontent.com/15315707/158967201-abab5419-80db-4142-bd83-c1ec0c76c4cb.svg) ![ic_back](https://user-images.githubusercontent.com/15315707/158967210-a2c9f949-b991-498e-83a1-4392cce46796.svg) I wasn't able to extract minimal reproducible code :( Perhaps it's related to https://github.com/dnfield/flutter_svg/issues/603 ? --- Comment by @dnfield on Mar 18, 2022 Does this still happen on the head commit of this repository? There've been a few bug fixes I don't think I've released yet but I should :) --- Comment by @bigparksh on Apr 8, 2022 I am facing the same issue on the iOS. Android works well. So, as your advice, I tested against the head commit of the repository. Unfortunately, the issue still happen. --- Comment by @crimsonvspurple on May 16, 2022 Hi. We are facing the same issue. SVG that looks fine and works totally OK in all browsers (desktop, phone, windows, linux etc), get corrupted randomly in _safari_ for MacOS only. Have not noticed this issue on Chrome on MacOS. --- Comment by @niklaesAtMonta on Jan 26, 2023 ~~We are facing the same issues, any updates @dnfield? 🙂~~ ~~Only on iOS btw.~~ **Update** I actually found [this issue report](https://github.com/dnfield/flutter_svg/issues/809) more in line with what we are experiencing. Sorry for tagging you **dnfield**.
package,p: flutter_svg
low
Critical
2,655,980,049
flutter
[flutter_svg] CERTIFICATE_VERIFY_FAILED
_Imported from https://github.com/dnfield/flutter_svg/issues/685_ Original report by @xiaomaxuetu on Mar 21, 2022 Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:359))
package,p: flutter_svg
low
Critical
2,655,980,174
flutter
[flutter_svg] FEATURE REQUEST: Some way to set ParagraphStyle default
_Imported from https://github.com/dnfield/flutter_svg/issues/688_ Original report by @espresso3389 on Apr 1, 2022 We have several SVG files that have Japanese texts. And, on Android, the current implementation renders the text with incorrect locale. The Japanese text is rendered with Chinese locale/glyphs. The ultimate cause of it is that [lib/src/svg/parsers.dart(195)](https://github.com/dnfield/flutter_svg/blob/1e923a3a04be1c5ea71bcdcfcf10b4e02d96751e/lib/src/svg/parsers.dart#L195) always uses the default `ParagraphStyle` constructor. So, the fix is very easy for my case, I should add a locale for the constructor like the following fragment: ```dart final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(locale: const Locale('ja'))) ```` And, with the modification, the rendering result is correct: ![font-j](https://user-images.githubusercontent.com/1311400/161180629-f26838b7-47c5-41eb-8c50-3c90a07cd2c0.png) So, there should be some mechanism to set the `ParagraphStyle` for such cases. For the testing purpose, I attached the SVG file: ![dp-evacuation](https://user-images.githubusercontent.com/1311400/161180132-28ffdafb-4ebb-4261-8cb9-cc97ac050076.svg) --- Comment by @espresso3389 on Apr 1, 2022 One more note, basically, the font specified for the text may be missing on the viewer's machine and it may be the cause of this. But it should safely fallback to some appropriate font with the specified locale anyway. --- Comment by @dnfield on Apr 1, 2022 Thanks for the detailed report. I'm not sure about the right way to resolve this. We could add something like `locale` to `SvgTheme`, which I think would make sense. I'm just not sure how it would sensibly be set - I guess the application could set it in a way that it knows makes sense? But there's no `DefaultLocale.of` or anything in Flutter. /cc @jonahwilliams who might find this interesting /cc @goderbauer we were talking recently about the framework/text system not having a good way to control this in a widget tree. --- Comment by @dnfield on Apr 1, 2022 I guess I could just read `PlatofrmDispatcher.instance.locale` and rebuild if it changes? --- Comment by @jonahwilliams on Apr 1, 2022 Maybe we should add `DefaultLocale.of`? I think the problem with local is that the dart intl package actually uses global state which makes it hard/impossible to override at the subtree level. Requires more research --- Comment by @jonahwilliams on Apr 1, 2022 What about `Localizations.localeOf`? --- Comment by @espresso3389 on Apr 1, 2022 I've created PR #689 to discuss how to support such cases. The PR implementation is enough for my purpose but I may not the optimum solution for other cases. --- Comment by @goderbauer on Apr 1, 2022 > What about Localizations.localeOf? +1 to that. This sounds like the right hook for the issue.
package,p: flutter_svg
low
Minor
2,655,980,293
flutter
[flutter_svg] Opacity not support
_Imported from https://github.com/dnfield/flutter_svg/issues/691_ Original report by @conall1995 on Apr 7, 2022 hey i am trying to use a svg file have opacity its loaded but without opacity simple svg for test ```xml <svg xmlns="http://www.w3.org/2000/svg" width="237" height="70" fill="none" viewBox="0 0 237 70"> <g opacity=".3"> <path fill="#1F0987" d="M232.04-2.308L237-7.275v9.927l-4.96-4.96zM232.04 12.556l4.96-4.96v9.927l-4.96-4.967zM232.04 27.427l4.96-4.96v9.92l-4.96-4.96zM232.04 42.298l4.96-4.96v9.92l-4.96-4.96zM232.04 57.17l4.96-4.96v9.919l-4.96-4.96zM232.04 72.04l4.96-4.96V77l-4.96-4.96z"/> <g> <path fill="#1F0987" d="M216.851 12.556l4.96-4.96v9.927l-4.96-4.967zM216.851 27.427l4.96-4.96v9.92l-4.96-4.96zM216.851 42.298l4.96-4.96v9.92l-4.96-4.96zM216.851 57.17l4.96-4.96v9.919l-4.96-4.96z"/> </g> <g> <path fill="#1F0987" d="M201.661 27.427l4.967-4.96v9.92l-4.967-4.96zM201.661 42.298l4.967-4.96v9.92l-4.967-4.96z"/> </g> <g> <path fill="#1F0987" d="M224.01 5.124l4.959-4.96v9.92l-4.959-4.96zM224.01 19.995l4.959-4.96v9.92l-4.959-4.96zM224.01 34.866l4.959-4.96v9.92l-4.959-4.96zM224.01 49.737l4.959-4.96v9.92l-4.959-4.96zM224.01 64.609l4.959-4.96v9.92l-4.959-4.96z"/> </g> <g> <path fill="#1F0987" d="M209.26 19.995l4.959-4.96v9.92l-4.959-4.96zM209.26 34.866l4.959-4.96v9.92l-4.959-4.96zM209.26 49.737l4.959-4.96v9.92l-4.959-4.96z"/> </g> <g> <path fill="#1F0987" d="M193.547 34.866l4.959-4.96v9.92l-4.959-4.96z"/> </g> </g> <path fill="#1F0987" d="M85.176 34.525a3 3 0 00-4.231 0l-12.21 12.15a3 3 0 01-4.231 0l-12.218-12.15a3 3 0 00-4.232 0l-12.208 12.15a3 3 0 01-4.232 0L19.407 34.526a3 3 0 00-4.233 0L1.78 47.864a1.283 1.283 0 101.81 1.818l11.584-11.535a3 3 0 014.233 0l12.207 12.147a3 3 0 004.232 0l12.209-12.149a3 3 0 014.231 0l12.218 12.15a3 3 0 004.232 0l12.209-12.15a3 3 0 014.231 0l11.484 11.42a1.283 1.283 0 101.81-1.82l-13.294-13.22z"/> </svg> ``` i cant use .with opacity for this file flutter ver: Channel stable, 2.10.3, on Mac OS X 10.15.7 svg_flutter ver: ^1.0.3 --- Comment by @dnfield on Apr 7, 2022 I can't reproduce this. What platform are you using?
package,p: flutter_svg
low
Minor
2,655,980,383
flutter
[flutter_svg] [Web][iOS] Animation and SVG rendering issues
_Imported from https://github.com/dnfield/flutter_svg/issues/695_ Original report by @RootSoft on Apr 13, 2022 Thanks for this great package. I've been porting my app to Flutter web and have been having some animation and SVG rendering issues on Flutter Web on iOS. ## Steps to Reproduce 1. Pull the [sample repository](https://github.com/RootSoft/safari-canvaskit) 2. Execute `flutter run -d web-server --web-renderer canvaskit --web-port 8080 --web-hostname 0.0.0.0 --release` on the sample repository 3. Open up the simulator or physical iphone and open up safari/chrome 4. Navigate to `http://{ip-address):8080` 5. Fiddle around the app **Devices** Issue tested & occurs on: Iphone SE 2020 - iOS 15.4 Simulator iPhone SE & 13 - iOS 15.4 Happens on both Chrome and Safari (webkit issue?) No issues found on Chrome on Android, Chrome/Safari (15.1) on Mac **Expected results:** App works like on Android or Flutter Web on Desktop. **Actual results:** Janky behaviour, after some time all animations in the app stop working. svg icons disappearing and appearing again `RefreshIndicator` has some weird issues after some time, see the video below. **Additional notes:** When I remove the `hero_icons` package, (which has a dependency on flutter_svg) and use the flutter `Icon` and `IconData` class, the issue does not happen anymore hence why I think it's a `flutter_svg` problem. Note that I've also tried the [latest master branch](https://github.com/RootSoft/heroicons) of `flutter_svg` with the same results. Icons can be found [here](https://github.com/vaetas/heroicons/tree/master/assets). **Video example:** <details> https://user-images.githubusercontent.com/7756836/163213449-b8208b19-392e-4f99-b9f9-cec12ff37da4.mov </details> **Logs:** <details> ``` [✓] Flutter (Channel stable, 2.10.4, on macOS 12.0.1 21A559 darwin-arm, locale en-BE) • Flutter version 2.10.4 at /Users/tomas/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/tomas/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • Java binary at: /Applications/Android Studio 2.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer https://user-images.githubusercontent.com/7756836/163213017-6a0f8b79-5a6e-429c-914f-11334c8d4602.mov • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.1) • Android Studio at /Applications/Android Studio 2.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) [✓] IntelliJ IDEA Community Edition (version 2021.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.66.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (2 available) • iPhone SE (3rd generation) (mobile) • 1BD476CB-B0F3-4A10-A20C-7E48F30E88F0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ``` </details> <!-- Consider also attaching screenshots and/or videos to better illustrate the issue. You can upload them directly on GitHub. Beware that video file size is limited to 10MB. --> ## Related issues https://github.com/dnfield/flutter_svg/issues/603 https://github.com/dnfield/flutter_svg/issues/684 --- Comment by @tamasapps on Apr 22, 2022 Same issue. Images flashing while scrolling and partly or completely disappearing.
package,p: flutter_svg
low
Minor
2,655,980,504
flutter
[flutter_svg] [Bug] RenderBox was not laid out with SvgPicture
_Imported from https://github.com/dnfield/flutter_svg/issues/697_ Original report by @eximius313 on Apr 21, 2022 When `SvgPicture` is placed inside `FittedBox` like that: ```dart @override Widget build(final BuildContext context) => Scaffold( appBar: AppBar( title: Text("Test"), ), body: Container( padding: EdgeInsets.all(20), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 2, child: FittedBox( child: SvgPicture.network('https://raw.githubusercontent.com/lipis/flag-icons/main/flags/4x3/gb.svg', width: 200,), ), ) ] ))); ``` then when you `Hot Reload` the app, everything is rendered just fine, without any errors **but** when you perform a `Restart`, then app shows you a lot of errors: ```dart ═══════ Exception caught by rendering library ═════════════════════════════════ The following assertion was thrown during performLayout(): 'package:flutter/src/rendering/box.dart': Failed assertion: line 319 pos 12: 'height > 0.0': is not true. package:flutter/…/rendering/box.dart:319 2 Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.md The relevant error-causing widget was FittedBox lib\…\screens\screen.dart:284 When the exception was thrown, this was the stack #2 BoxConstraints.constrainSizeAndAttemptToPreserveAspectRatio package:flutter/…/rendering/box.dart:319 #3 RenderFittedBox.performLayout package:flutter/…/rendering/proxy_box.dart:2588 #4 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #5 ChildLayoutHelper.layoutChild package:flutter/…/rendering/layout_helper.dart:56 #6 RenderFlex._computeSizes package:flutter/…/rendering/flex.dart:896 #7 RenderFlex.performLayout package:flutter/…/rendering/flex.dart:931 #8 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #9 RenderPadding.performLayout package:flutter/…/rendering/shifted_box.dart:233 #10 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #11 MultiChildLayoutDelegate.layoutChild package:flutter/…/rendering/custom_layout.dart:171 #12 _ScaffoldLayout.performLayout package:flutter/…/material/scaffold.dart:1005 #13 MultiChildLayoutDelegate._callPerformLayout package:flutter/…/rendering/custom_layout.dart:240 #14 RenderCustomMultiChildLayoutBox.performLayout package:flutter/…/rendering/custom_layout.dart:403 #15 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #16 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #17 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #18 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #19 _RenderCustomClip.performLayout package:flutter/…/rendering/proxy_box.dart:1376 #20 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #21 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #22 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #23 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #24 RenderObject.layout #25 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #26 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #27 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #28 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #29 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #30 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #31 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #32 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #33 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #34 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #35 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #36 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #37 RenderOffstage.performLayout package:flutter/…/rendering/proxy_box.dart:3426 #38 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #39 RenderProxyBoxMixin.performLayout package:flutter/…/rendering/proxy_box.dart:116 #40 RenderObject.layout package:flutter/…/rendering/object.dart:1852 #41 _RenderTheatre.performLayout package:flutter/…/widgets/overlay.dart:751 #42 RenderObject._layoutWithoutResize package:flutter/…/rendering/object.dart:1707 #43 PipelineOwner.flushLayout package:flutter/…/rendering/object.dart:879 #44 RendererBinding.drawFrame package:flutter/…/rendering/binding.dart:497 #45 WidgetsBinding.drawFrame package:flutter/…/widgets/binding.dart:883 #46 RendererBinding._handlePersistentFrameCallback package:flutter/…/rendering/binding.dart:363 #47 SchedulerBinding._invokeFrameCallback package:flutter/…/scheduler/binding.dart:1145 #48 SchedulerBinding.handleDrawFrame package:flutter/…/scheduler/binding.dart:1082 #49 SchedulerBinding._handleDrawFrame package:flutter/…/scheduler/binding.dart:996 #53 _invoke (dart:ui/hooks.dart:150:10) #54 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5) #55 _drawFrame (dart:ui/hooks.dart:114:31) (elided 5 frames from class _AssertionError and dart:async) The following RenderObject was being processed when the exception was fired: RenderFittedBox#99089 relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE RenderObject: RenderFittedBox#99089 relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: offset=Offset(0.0, 0.0); flex=2; fit=FlexFit.tight (can use size) constraints: BoxConstraints(w=920.0, 0.0<=h<=444.0) size: MISSING fit: contain alignment: Alignment.center textDirection: ltr child: RenderSemanticsAnnotations#4bc4d relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: <none> (can use size) constraints: BoxConstraints(unconstrained) size: Size(200.0, 0.0) child: RenderConstrainedBox#cb093 relayoutBoundary=up5 NEEDS-PAINT parentData: <none> (can use size) constraints: BoxConstraints(unconstrained) size: Size(200.0, 0.0) additionalConstraints: BoxConstraints(w=200.0, 0.0<=h<=Infinity) ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFittedBox#99089 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1927 pos 12: 'hasSize' The relevant error-causing widget was Row lib\…\screens\screen.dart:279 ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFlex#820de relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1927 pos 12: 'hasSize' The relevant error-causing widget was Container ═══════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPadding#eea56 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1927 pos 12: 'hasSize' The relevant error-causing widget was Scaffold lib\…\screens\screen.dart:272 ════════════════════════════════════════════════════════════════════════════════ D/EGL_emulation( 7459): app_time_stats: avg=5602.10ms min=747.92ms max=10456.29ms count=2 ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFittedBox#99089 relayoutBoundary=up3 'package:flutter/src/rendering/box.dart': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1927 pos 12: 'hasSize' The relevant error-causing widget was FittedBox lib\…\screens\screen.dart:284 ════════════════════════════════════════════════════════════════════════════════ ``` I think it's a bug with `SvgPicture` because when I use `Text("Foo")` instead of `SvgPicture` - no error happen either with `HotReload` nor `Restart`. --- Comment by @gabcarneiro on Sep 1, 2022 Same issue here, the layout of the app im working on also has a SvgPicture inside a FittedBox --- Comment by @gabcarneiro on Sep 1, 2022 > Same issue here, the layout of the app im working on also has a SvgPicture inside a FittedBox Fixed it by instead of wrapping the SvgPicture inside a FittedBox, i used the `SvgPicture.fit` property. From: ```dart child: FittedBox( fit: BoxFit.scaleDown, child: SvgPicture.asset('my.svg'), ), ``` To: ```dart child: SvgPicture.asset( 'my.svg', fit: BoxFit.scaleDown, ), ``` --- Comment by @PiotrKedra on Jan 11, 2024 Have same problem
package,p: flutter_svg
low
Critical
2,655,980,642
flutter
[flutter_svg] Shadows, layer blur aren't rendered.
_Imported from https://github.com/dnfield/flutter_svg/issues/705_ Original report by @SulabhShrestha on May 8, 2022 When I preview this svg inside vscode, shadow and layer blur are shown but not in flutter. link to svg: https://pastebin.com/c3DkgiA9 link to screenshot that flutter_svg rendered: https://imgur.com/a/hpkRsZ2 --- Comment by @jlyonsmith on May 13, 2022 I just discovered this too. [It looks like Skia supports Gaussian blur](https://api.skia.org/classSkSVGFeGaussianBlur.html). I definitely +1 support for this in the library. Blur is really useful for adding depth effects to layered SVG's.
package,p: flutter_svg
low
Minor
2,655,980,785
flutter
[flutter_svg] SVG widget is not render in a proper position while paint using paintChild method in PaintingContext
_Imported from https://github.com/dnfield/flutter_svg/issues/711_ Original report by @Yuvaraj-Gajaraj on May 19, 2022 ## Steps to Reproduce <!-- Please include full steps to reproduce so that we can reproduce the problem. --> 1. Run the attached sample below 2. When I paint the image widget with the help of paintChild method in the PaintingContext it renders in a proper position but when it comes to the SVG image widget it didn't render properly. 3. In the attached sample I have added both Image and SVG widgets. Sample: [custom_widget_painter.zip](https://github.com/flutter/flutter/files/8716148/customer_widget_painter.zip) **Expected results:** <!-- what did you want to see? --> ![image](https://user-images.githubusercontent.com/61863686/169038913-d7e047a9-1aac-416c-bbd8-816ec71d0c0a.png) **Actual results:** <!-- what did you see? --> ![image](https://user-images.githubusercontent.com/61863686/169039699-602a24e6-398c-46e1-84d6-915fcbedf4cd.png) </details> <details> <summary>Logs</summary> <!-- Run `flutter analyze` and attach any output of that command below. If there are any analysis errors, try resolving them before filing this issue. --> ``` PS E:\customer_widget_painter> flutter analyze Analyzing customer_widget_painter... No issues found! (ran in 115.9s) ``` <!-- Finally, paste the output of running `flutter doctor -v` here. --> ``` [√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19042.1706], locale en-US) • Flutter version 2.10.5 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (4 weeks ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Users\YuvarajGajaraj\AppData\Local\Android\sdk • Platform android-31, build-tools 30.0.3 • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio1 • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) [!] Android Studio (version 4.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart X Unable to determine bundled Java version. • Try updating or re-installing Android Studio. [√] VS Code (version 1.67.1) • VS Code at C:\Users\YuvarajGajaraj\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.40.0 [√] Connected device (4 available) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.1706] • Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.54 • Edge (web) • edge • web-javascript • Microsoft Edge 99.0.1150.46 [√] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 2 categories. ``` </details> --- Comment by @dnfield on May 19, 2022 Can you share the source in a non-zip form please? I suspect you're missing the offset. --- Comment by @Yuvaraj-Gajaraj on May 20, 2022 Hi @dnfield, Here is the complete code which I have used to reproduce the issue. ```dart import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_svg/flutter_svg.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return Scaffold( body: MyExample(children: [ SizedBox(child: // Image(image: AssetImage('assets/maps_twitter.png')) SvgPicture.asset( 'assets/map.svg', ) ) ]), ); } } class MyExample extends MultiChildRenderObjectWidget { MyExample({ Key? key, required List<Widget> children, }) : super(key: key, children: children); @override RenderMyExample createRenderObject(BuildContext context) { return RenderMyExample(); } } class MyExampleParentData extends ContainerBoxParentData<RenderBox> {} class RenderMyExample extends RenderBox with ContainerRenderObjectMixin<RenderBox, MyExampleParentData> { @override void setupParentData(RenderObject child) { if (child.parentData is! MyExampleParentData) { child.parentData = MyExampleParentData(); } } @override void performLayout() { size = constraints.biggest; for (var child = firstChild; child != null; child = childAfter(child)) { child.layout( constraints.copyWith(maxHeight: 50), ); } } @override void paint(PaintingContext context, Offset offset) { final Path path = Path(); path.moveTo(100, 100); path.lineTo(200, 100); path.lineTo(200, 200); path.lineTo(100, 200); path.lineTo(100, 100); context.canvas.save(); context.canvas.translate(150, 150 - 10 - 64); context.canvas.scale(1.0); context.canvas.drawPath( path, Paint() ..color = Colors.white ..style = PaintingStyle.fill); context.canvas.drawPath( path, Paint() ..color = Colors.black ..style = PaintingStyle.stroke); context.canvas.clipPath(path); for (var child = firstChild; child != null; child = childAfter(child)) { context.paintChild(child, Offset(114, 114)); context.canvas.restore(); } } } ``` It is working fine with Image widget. --- Comment by @dnfield on May 20, 2022 Ahh ok. this is likely a bug in flutter_svg then not respecting the offset. If you change `context.paintChild(child, Offset(114, 114))` to use `Offset.zero` does it paint consistently with the image? --- Comment by @dnfield on May 23, 2022 I have definitely introduce da bug in flutter_svg related to this - @jonahwilliams noticed something similar recently. Argh. --- Comment by @Yuvaraj-Gajaraj on May 25, 2022 Hi @dnfield, Thanks for confirming it as a bug. I have given Offset.zero and its output can be found below, Image: | SVG | Image | | --- | --- | | <img src="https://user-images.githubusercontent.com/61863686/170175947-64a0067d-7df6-4591-bb64-1c9959946a92.png" width="300" height="600" /> | <img src="https://user-images.githubusercontent.com/61863686/170175992-ce7507bb-c020-482b-b059-3a82730ed73b.png" width="300" height="600" /> | For your reference, I have attached the project here Project: [custom_widget_painter.zip](https://github.com/dnfield/flutter_svg/files/8767806/custom_widget_painter.zip) Thanks, Yuvaraj.
package,p: flutter_svg
low
Critical
2,655,980,892
flutter
[flutter_svg] Svg seems to overlap when scrolling (Safari only)
_Imported from https://github.com/dnfield/flutter_svg/issues/716_ Original report by @Velliane on May 31, 2022 Hi there, I don't really know if the problem is really here, but with Safari(debug and release), when scrolling, the svg seems to overlap. https://user-images.githubusercontent.com/44947503/171196682-0a4d775c-c073-4270-a040-9c8dace0d7ab.mov https://user-images.githubusercontent.com/44947503/171196760-3661c16d-552d-4347-8b2c-689671ffd098.mov I use `canvaskit` with `flutter_svg 1.1.0 `and `flutter 3.0.0` Do you have any idea why this is happening? Thanks in advance --- Comment by @mminhlequang on Aug 20, 2022 same prob
package,p: flutter_svg
low
Critical
2,655,981,030
flutter
[flutter_svg] Svg text imports a custom TTF font library, using Svgpicture.network load exception
_Imported from https://github.com/dnfield/flutter_svg/issues/718_ Original report by @yk81708090 on Jun 8, 2022 ════════ Exception caught by SVG ═══════════════════════════════════════════════ The following UnsupportedError was thrown in _Element.svg: Unsupported operation: Unsupported nested <svg> element. The root <svg> element contained an unsupported nested SVG element. Picture key: NetworkPicture("http://101.35.7.174:88/html/ceshi.svg", headers: null, colorFilter: null) ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by SVG ═══════════════════════════════════════════════ Unsupported operation: Unsupported nested <svg> element. ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by SVG ═══════════════════════════════════════════════ The <style> element is not implemented in this library. ════════════════════════════════════════════════════════════════════════════════ svg link: http://101.35.7.174:88/html/ceshi.svg How to solve this problem? thanks! --- Comment by @dnfield on Jun 8, 2022 That SVG would need to be preprocessed to remove the style element. --- Comment by @yk81708090 on Jun 10, 2022 `<svg> <defs> <font id="iconfont" horiz-adv-x="1502" vert-adv-y="1502" > <font-face font-family="iconfont" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="1457" descent="-980" /> <missing-glyph /> <glyph glyph-name="uni22" unicode="&#x22;" d="M296 507L42 0L14 0L268 507L296 507M451 507L197 0L169 0L423 507L451 507Z" horiz-adv-x="451" vert-adv-y="1000" /> </font> </defs> <svg> import font-family </svg> </svg>` Whether the SVG format is correct? --- Comment by @Mohdx on Jun 15, 2022 > ════════ Exception caught by SVG ═══════════════════════════════════════════════ The following UnsupportedError was thrown in _Element.svg: Unsupported operation: Unsupported nested element. > > The root element contained an unsupported nested SVG element. > > Picture key: NetworkPicture("http://101.35.7.174:88/html/ceshi.svg", headers: null, colorFilter: null) ════════════════════════════════════════════════════════════════════════════════ > > ════════ Exception caught by SVG ═══════════════════════════════════════════════ Unsupported operation: Unsupported nested element. ════════════════════════════════════════════════════════════════════════════════ > > ════════ Exception caught by SVG ═══════════════════════════════════════════════ The <style> element is not implemented in this library. ════════════════════════════════════════════════════════════════════════════════ > > svg link: http://101.35.7.174:88/html/ceshi.svg > > How to solve this problem? > > thanks! ![svgcleaner](https://user-images.githubusercontent.com/51845593/173755286-0bfd891b-9cf6-40a4-b4a8-c6ee1e4b4c16.png) To remove style element. --- Comment by @yk81708090 on Jun 15, 2022 If delete the style element, the notes will not display correctly --- Comment by @Mohdx on Jun 15, 2022 Well that's unfortunate, for me it was vice versa. svg was just all black until I used svg cleaner --- Comment by @yk81708090 on Jun 15, 2022 Displaying notes by drawing path, like this: `<path fill="rgb(180,120,190)" transform="translate(5.55, 15.38),scale(0.0205),rotate(180)" d="M466-252Q438-257 406.50-258Q375-259 345-256.50Q315-254 289.50-249.50Q264-245 248-237Q171-200 123.50-158.50Q76-117 50-72Q24-27 13.50 20.50Q3 68 0 116Q-4 168 9.50 220Q23 272 46.50 319.50Q70 367 100.50 407Q131 447 162 477Q198 511 237.50 544.50Q277 578 324 613Q323 626 321.50 636Q320 646 318 656.50Q316 667 313.50 680Q311 693 310 712Q310 720 308 741.50Q306 763 305.50 793.50Q305 824 307 863Q309 902 317 944Q322 969 338.50 1007.50Q355 1046 377.50 1082Q400 1118 425 1144Q450 1170 472 1170Q483 1170 496 1156.50Q509 1143 521.50 1120.50Q534 1098 546 1069.50Q558 1041 567 1011Q576 981 581.50 952Q587 923 588 901Q589 849 584 809.50Q579 770 569 738.50Q559 707 545.50 680.50Q532 654 517 627Q501 600 484.50 579.50Q468 559 451 538Q433 516 413.50 501.50Q394 487 375 470Q384 419 391 378Q394 360 397 343Q400 326 402 311.50Q404 297 406 287.50Q408 278 408 276Q432 279 457.50 276.50Q483 274 506.50 269Q530 264 548.50 256Q567 248 578 241Q632 201 654.50 149.50Q677 98 681 44Q684 2 674-40.50Q664-83 640.50-121.50Q617-160 579.50-192Q542-224 491-245Q497-286 502-321Q507-351 511-379.50Q515-408 517-419Q526-479 524-517.50Q522-556 509-580Q498-600 483.50-619Q469-638 449-653Q429-668 402.50-678Q376-688 342-690Q316-692 280-685.50Q244-679 211-662.50Q178-646 154-618Q130-590 127-549Q125-525 130-500.50Q135-476 147.50-456.50Q160-437 180.50-424Q201-411 231-409Q249-408 267.50-414.50Q286-421 302-433Q318-445 328-463Q338-481 340-502Q343-539 317-573.50Q291-608 229-625Q239-639 267-651.50Q295-664 337-664Q381-664 421.50-638Q462-612 484-573Q498-547 498-505.50Q498-464 493-422Q491-415 487-387.50Q483-360 478-330Q473-295 466-252M487 1015Q448 1015 418.50 978.50Q389 942 370.50 886Q352 830 346 763Q340 696 349 634Q382 659 418 694.50Q454 730 483.50 770Q513 810 531.50 851Q550 892 547 929Q546 941 543 956Q540 971 533 984Q526 997 515 1006Q504 1015 487 1015M485-211Q528-196 552-172Q576-148 587.50-120Q599-92 600.50-64Q602-36 601-14Q599 4 592.50 31Q586 58 568 83Q550 108 517 124.50Q484 141 429 138L485-211M403 136Q362 134 335.50 119.50Q309 105 293.50 84.50Q278 64 272.50 41Q267 18 268 0Q269-18 276-37Q283-56 294.50-72.50Q306-89 319.50-102.50Q333-116 347-123Q345-125 343.50-126.50Q342-128 340-130Q338-132 337-134Q306-119 282.50-98.50Q259-78 252-69Q241-54 233-42Q225-30 220-16.50Q215-3 211.50 13Q208 29 207 51Q205 72 210 95.50Q215 119 226.50 143Q238 167 256.50 189.50Q275 212 300 232Q313 242 323.50 248Q334 254 343 258.50Q352 263 361.50 265.50Q371 268 382 271L352 452Q340 445 313 424Q286 403 254 374Q222 345 190.50 311.50Q159 278 139 247Q103 190 83 142Q63 94 68 38Q72-25 106.50-79.50Q141-134 195-171Q249-208 318-222.50Q387-237 461-219Q445-120 432-42Q426-9 421 23Q416 55 411.50 80Q407 105 405 120.50Q403 136 403 136Z"/>` Flip Y not resolved
package,p: flutter_svg
low
Critical
2,655,981,139
flutter
[flutter_svg] svg render issues
_Imported from https://github.com/dnfield/flutter_svg/issues/733_ Original report by @AkhilSajiCodzoc on Jul 6, 2022 Svg doesnt renders on flutter version 3.0.3.It doesnt shows errors but have some warning about the height and width.here is my code ``` SvgPicture.asset( color: Colors.black, height: 20.0, width: 20.0, allowDrawingOutsideViewBox: true, semanticsLabel: 'My SVG Picture', "assets/images/call.svg") ``` --- Comment by @dnfield on Jul 6, 2022 Please share the actual SVG
package,p: flutter_svg
low
Critical
2,655,981,268
flutter
[flutter_svg] Gradient colors cannot be displayed
_Imported from https://github.com/dnfield/flutter_svg/issues/734_ Original report by @AllLuckly on Jul 8, 2022 ``` <?xml version="1.0" encoding="UTF-8"?> <svg width="128px" height="128px" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>椭圆形备份</title> <defs> <linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="linearGradient-1"> <stop stop-color="#A67EFF" offset="0%"></stop> <stop stop-color="#8792FF" offset="56.3986185%"></stop> <stop stop-color="#44FF35" offset="100%"></stop> </linearGradient> </defs> <g id="头像" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="Apple-TV" transform="translate(-1116.000000, -1637.000000)" stroke="url(#linearGradient-1)" stroke-width="2"> <circle id="椭圆形备份" cx="1180" cy="1701" r="63"></circle> </g> </g> </svg> ``` flutter_svg: ^1.1.0 flutter_svg: ^1.1.0 + 1 expected result : <img width="291" alt="截屏2022-07-08 18 03 23" src="https://user-images.githubusercontent.com/10387295/177969218-2327a371-2623-4213-b7d9-589b7495fd6c.png"> actual effect : <img width="103" alt="截屏2022-07-08 18 04 21" src="https://user-images.githubusercontent.com/10387295/177969586-881e4c9c-afb7-4acd-9afb-f462595bf24d.png"> --- Comment by @dnfield on Jul 8, 2022 The bug here is that when a gradient is specified on a group it's not getting inherited down to the shape(s). You can work around this by putting the gradient directly on the `circle` element in the example. --- Comment by @dnfield on Jul 8, 2022 If it helps, this graphic should render correctly in the `vector_graphics` package. --- Comment by @hey-nicolasklein on Aug 2, 2022 I'm not really understanding what you mean @dnfield :/ For me, the package also does not render colors. I'm not using basic SVG shapes, but paths. How could I modify my SVG to render the colors inside of Flutter? ````` <svg width="284" height="203" viewBox="0 0 284 203" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M114.603 63.8157C111.864 56.1167 109.109 48.3743 108.263 38.2513C108.089 36.8586 108 35.4398 108 34C108 33.7131 108.003 33.4272 108.01 33.1421C108.003 32.7097 108 32.2729 108 31.8318C108 30.4235 108.193 29.0903 108.558 27.832C111.46 11.999 125.329 7.57458e-07 142 1.48619e-06C158.671 2.21492e-06 172.54 11.999 175.442 27.832C175.807 29.0903 176 30.4235 176 31.8318C176 32.273 175.997 32.7097 175.989 33.1421C175.993 33.2969 175.996 33.4518 175.998 33.6069C175.999 33.7378 176 33.8688 176 34C176 35.4398 175.911 36.8586 175.737 38.2513C174.891 48.3743 172.136 56.1167 169.397 63.8157L169.396 63.8179C166.206 72.7852 163.036 81.6936 162.927 94.2356C162.811 107.706 166.251 117.93 169.631 127.975C172.254 135.77 174.841 143.458 175.701 152.471C175.898 153.953 176 155.464 176 157C176 157.246 175.997 157.491 175.992 157.736C175.997 158.073 176 158.413 176 158.755C176 159.671 175.904 160.552 175.718 161.4C173.561 178.099 159.287 191 142 191C124.713 191 110.439 178.099 108.282 161.4C108.096 160.552 108 159.671 108 158.755C108 158.413 108.003 158.073 108.008 157.736C108.003 157.491 108 157.246 108 157C108 155.464 108.102 153.953 108.299 152.471C109.159 143.458 111.746 135.77 114.369 127.975C117.749 117.93 121.189 107.706 121.072 94.2356C120.964 81.6936 117.794 72.7852 114.603 63.8179L114.603 63.8157Z" fill="url(#paint0_linear_15_89)"> </path> <path d="M146.13 114.811C138.471 117.661 130.77 120.528 122.471 126.387C121.293 127.149 120.148 127.992 119.045 128.918C118.826 129.102 118.609 129.288 118.395 129.477C118.059 129.75 117.722 130.028 117.385 130.311C116.306 131.217 115.408 132.221 114.679 133.31C104.416 145.71 104.139 164.047 114.855 176.818C125.571 189.589 143.677 192.5 157.671 184.546C158.87 184.017 160.015 183.308 161.094 182.402C161.432 182.119 161.764 181.835 162.091 181.552C162.212 181.456 162.333 181.358 162.453 181.26C162.554 181.177 162.655 181.093 162.755 181.009C163.858 180.083 164.887 179.103 165.843 178.074C173.053 170.919 177.214 163.833 181.351 156.786L181.352 156.784C186.171 148.575 190.958 140.421 200.495 132.276C210.739 123.528 220.783 119.591 230.65 115.724C238.308 112.723 245.859 109.763 253.317 104.628C254.579 103.827 255.802 102.933 256.979 101.946C257.167 101.788 257.353 101.628 257.537 101.467C257.799 101.254 258.061 101.038 258.323 100.818C259.025 100.229 259.638 99.5885 260.168 98.9018C271.573 86.5149 272.281 67.2879 261.169 54.0455C250.058 40.8032 231 38.1614 216.821 47.2428C216.052 47.6452 215.315 48.138 214.613 48.7269C214.351 48.9466 214.093 49.1669 213.837 49.388C213.647 49.5413 213.457 49.6968 213.269 49.8548C212.093 50.8419 211 51.8915 209.992 52.995C203.64 59.4476 199.414 66.3705 195.128 73.3906C189.606 82.4367 183.985 91.6439 173.591 100.213C163.914 108.192 155.052 111.49 146.132 114.81L146.13 114.811Z" fill="url(#paint1_linear_15_89)" /> <path d="M101.673 155.786C105.81 162.833 109.971 169.919 117.181 177.074C118.137 178.103 119.166 179.083 120.269 180.009C120.489 180.193 120.71 180.374 120.933 180.552C121.26 180.836 121.592 181.119 121.93 181.402C123.009 182.308 124.154 183.017 125.353 183.546C139.347 191.5 157.453 188.589 168.169 175.818C178.885 163.047 178.608 144.71 168.345 132.31C167.616 131.221 166.718 130.217 165.639 129.311C165.302 129.028 164.965 128.75 164.629 128.477C164.513 128.375 164.396 128.273 164.278 128.172C164.179 128.087 164.079 128.002 163.979 127.918C162.876 126.992 161.731 126.149 160.553 125.387C152.254 119.528 144.553 116.661 136.894 113.811L136.892 113.81C127.972 110.49 119.11 107.192 109.433 99.2132C99.0387 90.644 93.4179 81.4368 87.8957 72.3906C83.6102 65.3705 79.3839 58.4476 73.0322 51.9951C72.0239 50.8916 70.9314 49.8419 69.7551 48.8548C69.5667 48.6968 69.3772 48.5413 69.1865 48.388C68.9311 48.167 68.6727 47.9466 68.4108 47.7269C67.709 47.138 66.9717 46.6452 66.2035 46.2428C52.0242 37.1614 32.9664 39.8033 21.8548 53.0456C10.7431 66.2879 11.4508 85.515 22.8564 97.9018C23.3861 98.5885 23.9995 99.229 24.7013 99.8179C24.9631 100.038 25.225 100.254 25.487 100.467C25.6711 100.628 25.8572 100.788 26.0455 100.946C27.2219 101.933 28.4453 102.827 29.7071 103.628C37.1646 108.763 44.7162 111.723 52.3738 114.724C62.2415 118.591 72.2848 122.528 82.5287 131.276C92.0664 139.421 96.8532 147.576 101.672 155.784L101.673 155.786Z" fill="url(#paint2_linear_15_89)" /> <defs> <linearGradient id="paint0_linear_15_89" x1="141.922" y1="11.5123" x2="141.922" y2="116.17" gradientUnits="userSpaceOnUse"> <stop stop-color="#495BFF" /> <stop offset="0.864583" stop-color="#495BFF" stop-opacity="0" /> </linearGradient> <linearGradient id="paint1_linear_15_89" x1="259.015" y1="56.0751" x2="174.656" y2="132.941" gradientUnits="userSpaceOnUse"> <stop stop-color="#FFF279" /> <stop offset="0.833333" stop-color="#FFF279" stop-opacity="0" /> </linearGradient> <linearGradient id="paint2_linear_15_89" x1="26.6938" y1="52.7789" x2="115.72" y2="128.729" gradientUnits="userSpaceOnUse"> <stop stop-color="#1ABB77" /> <stop offset="0.859375" stop-color="#1ABB77" stop-opacity="0" /> </linearGradient> </defs> </svg> `````` --- Comment by @raulmabe on Aug 5, 2022 @hey-nicolasklein I have solved it by setting the defs before the paths. Hope it helps!
package,p: flutter_svg
low
Critical
2,655,981,407
flutter
[flutter_svg] Using flutter_svg in tests
_Imported from https://github.com/dnfield/flutter_svg/issues/738_ Original report by @rgjurgens on Jul 21, 2022 I'm using `flutter_svg` throughout our project and it works just fine. However, if I'm running the app in an integration test, the app crashes on assets that cannot be found. The error message is as follows, I'm using the latest `flutter_svg` version: ``` ══╡ EXCEPTION CAUGHT BY SVG ╞═══════════════════════════════════════════════════════════════════════ The following assertion was thrown resolving a single-frame picture stream: Unable to load asset: assets/buttons/close_button.svg ``` This is the code in my test: ``` import '../main.dart' as app; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('end-to-end test', () { testWidgets('tap on the floating action button, verify counter', (tester) async { app.main(); await tester.pumpAndSettle(); ``` --- Comment by @rgjurgens on Jul 25, 2022 Any thoughts, remarks? Do I need to provide more information? --- Comment by @Momy93 on Jul 30, 2022 I had the [same issue](https://github.com/dnfield/flutter_svg/issues/676) SvgPicture.network, and I solved with [HttpOverrides](https://api.flutter.dev/flutter/dart-io/HttpOverrides-class.html). In your case, you could [mock the AssetBundle](https://stackoverflow.com/questions/68653117/unable-to-load-asset-svg-during-widget-testing). Another solution that I used in my code, is to convert the svg icons to a font pack. That way I can use them as `Icon` like I would do with a material icon, instead of Svg. --- Comment by @HelenaSewell on Jan 26, 2023 Realise this was a long time ago, but what folders do you have added to your pubspec.yaml? I saw this issue when I forgot to add the path to the containing folder, as well as the overall folder. ie ``` assets: - assets/ - assets/buttons/ ``` How the assets loaded was actually not consistent between running the app and running the tests. Adding the subfolders made it work for both.
package,p: flutter_svg
low
Critical
2,655,981,528
flutter
[flutter_svg] providing DefaultSvgTheme doesn't work
_Imported from https://github.com/dnfield/flutter_svg/issues/739_ Original report by @IlyaMax on Jul 27, 2022 https://github.com/IlyaMax/flutter_playground/tree/flutter_svg_issue_default_svg_theme expected that svg icon is green, actual: that's black --- Comment by @Handelika on Aug 17, 2022 I also have the same problem. SvgTheme current color not working anymore. --- Comment by @barisatakanelbasan on Aug 17, 2022 I have the same issue. --- Comment by @sayyedmuzammil on Oct 6, 2022 yes, it's a common issue, my logo has different sets of colors but it's showing only one color. --- Comment by @vadimlukutin on Sep 19, 2023 also have this issue, but color is working
package,p: flutter_svg
low
Minor
2,655,981,664
flutter
[flutter_svg] Flutter SVG Render Issue on web
_Imported from https://github.com/dnfield/flutter_svg/issues/740_ Original report by @stevensalex299 on Jul 28, 2022 We are using the Flutter SVG package to render SVGs throughout our project. The images looks perfectly fine on Flutter version 2.10.5, but on version 3 some of them render badly. There seems to be an issue between the two versions. ![NormalIcon](https://user-images.githubusercontent.com/67330039/181628546-b29eefd7-7be4-41cb-8d12-ea749006886e.png) ![BrokenIcon](https://user-images.githubusercontent.com/67330039/181628564-bc3fd87b-0831-42cf-b6a3-5d41ca3c5587.png) Source SVG: ![analytics_with_icon](https://user-images.githubusercontent.com/67330039/181636084-21f4911e-d8be-47e6-839a-afb0edb185e5.svg) --- Comment by @dnfield on Jul 28, 2022 Please include the source SVG for this. --- Comment by @stevensalex299 on Jul 28, 2022 I added the svg above --- Comment by @dnfield on Jul 28, 2022 I'm not able to reproduce this on a recent flutter commit and the latest version of flutter_svg. What platform? --- Comment by @stevensalex299 on Jul 29, 2022 We are building this for Flutter web. --- Comment by @dnfield on Nov 17, 2022 What rendering backend? Which browser/os?
package,p: flutter_svg
low
Critical
2,655,981,812
flutter
[flutter_svg] Resize of widget in constrained conditions not working as expected
_Imported from https://github.com/dnfield/flutter_svg/issues/759_ Original report by @matecode on Aug 29, 2022 I want the SvgPicture widget to automatically resize its height. Here is a code example: The starting code is a an easy example of an SvgPicture with the original width an height of the svg image. To see better what happens there is a red background on the container. ``` Container( color: Colors.red, child: IntrinsicHeight( child: SvgPicture.asset( Assets.diningplan.images.basket.path, fit: BoxFit.scaleDown, ), ), ), ``` results to ![image](https://user-images.githubusercontent.com/3225274/187167704-8565cd2b-38e3-47b5-b3d1-0ccb15c24b3e.png) if i add `constraints: BoxConstraints(maxWidth: 20),` to the container, the result is: ![image](https://user-images.githubusercontent.com/3225274/187168200-1ee9cd52-4719-4eb7-98cc-cab75811599c.png) I would expect that SvgImage resize its own height. --- Comment by @gabrielgarciagava on Aug 29, 2022 I have faced the same issue recently. I've created a simple project to show the issue, and I also have a suggestion of how to fix. Example: https://github.com/gabrielgarciagava/flutter_svg_aspect_ratio_issue Snippet: ``` class ImageVsSvgPicture extends StatelessWidget { const ImageVsSvgPicture({ Key? key, }) : super(key: key); @override Widget build(BuildContext context) { return Column( mainAxisSize: MainAxisSize.min, children: [ Container( color: Colors.green, child: Image.asset("images/cube.png"), ), Container( color: Colors.red, child: SvgPicture.asset("images/logo.svg"), ), ], ); } } ``` <img width="1053" alt="Screenshot 2022-08-29 at 12 23 01" src="https://user-images.githubusercontent.com/1520279/187184425-611347eb-81ac-4e15-9b8e-24451e0df7ef.png"> Image and SvgPitcure behaves differently. SvgPicture behaves as the issue you described. Image behaves as you expected. The issue is caused by this part of the code: ``` double? width = widget.width; double? height = widget.height; if (width == null && height == null) { width = viewport.width; height = viewport.height; } else if (height != null) { width = height / viewport.height * viewport.width; } else if (width != null) { height = width / viewport.width * viewport.height; } ``` In case width and height are not defined, the image is forced to have the dimensions specified by the svg file. This code was injected to deal with this issue: https://github.com/dnfield/flutter_svg/issues/57# I suggest using AspectRatio widget instead of setting the width and height. --- Comment by @gabrielgarciagava on Aug 29, 2022 The code I wrote on my fork fixed the problem that I was facing. https://github.com/dnfield/flutter_svg/compare/master...gabrielgarciagava:flutter_svg:master I did not create a PR because I'm not confident if this is correct. All tests are passing though. I should also probably write a test to describe the behavior we expect. @matecode You can test my fork of the project if you want. Let me know if it works for you. --- Comment by @Lilian-C on Jul 18, 2023 I am still able to reproduce this error in the latest flutter_svg version (2.0.8). Are there any fixes coming up soon, or is there any workaround to avoid this problem?
package,p: flutter_svg
low
Critical
2,655,981,915
flutter
[flutter_svg] SvgPicture.network does not redownload the image after failing
_Imported from https://github.com/dnfield/flutter_svg/issues/765_ Original report by @srolemberg on Sep 5, 2022 SvgPicture library does not redownload the asset from network after a failure. I'm trying to apply this code with a very simplified 2 screen application. Page One ``` class PageOne extends StatefulWidget { const PageOne({Key? key}) : super(key: key); @override State createState() => _PageOneState(); } class _PageOneState extends State<PageOne> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Page One"), ), body: Center( child: MaterialButton( color: Theme.of(context).primaryColor, onPressed: () { setState(() { Navigator.push(context, MaterialPageRoute(builder: (context) => const PageTwo())); }); }, child: const Text("new page")), ), ); } } ``` Page two ``` import 'package:flutter_svg/svg.dart'; class PageTwo extends StatefulWidget { const PageTwo({Key? key}) : super(key: key); @override State createState() => _PageTwoState(); } class _PageTwoState extends State<PageTwo> { static const String svglink = "https://uxwing.com/wp-content/themes/uxwing/download/web-app-development/embed-code-icon.svg"; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Page Two"), ), body: Center( child: Container( width: 150, height: 150, padding: const EdgeInsets.all(8), color: Colors.grey, child: SvgPicture.network( svglink, color: Colors.pink, placeholderBuilder: (context) => const Center( child: Text("my fancy placeholder"), ), ), ), ), ); } } ``` In the first example, with the system operating with everything online, both the cache and the download occur normally. [svg-ok.webm](https://user-images.githubusercontent.com/8094865/188498387-41ccb597-ebca-4901-9068-3b2985b7510e.webm) However, if the page starts offline, the library is not able to re-download it if the system comes back online. Nor does it retrieve the existing cache of the same image that was previously saved. [svg-not-ok.webm](https://user-images.githubusercontent.com/8094865/188498401-5d03a0d6-9874-4b41-b47a-51402d02d346.webm) ``` ➜ ~ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.3.0, on macOS 12.3.1 21E258 darwin-x64, locale pt-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 4.2) [✓] IntelliJ IDEA Community Edition (version 2022.1.4) [✓] Connected device (2 available) [✓] HTTP Host Availability flutter_svg: ^1.1.4 ``` For this example, I used the latest version of both the library and the sdk, however, it also occurs in older versions, which is where I initially encountered the problem. ``` flutter: 2.2.3 flutter_svg: ^0.22.0 ```
package,p: flutter_svg
low
Critical
2,655,982,031
flutter
[flutter_svg] SVG not rendered correctly on different screen size width
_Imported from https://github.com/dnfield/flutter_svg/issues/766_ Original report by @thomasaldershof on Sep 6, 2022 Hello, I'm having this issue on Windows, Chrome and Edge. It does not seem to happen on Android at least. But resizing is harder there. Here is an example of my issue on Windows: ![image](https://user-images.githubusercontent.com/28623044/188617991-17e6068e-f1ee-4aa1-882e-2f2ea61facbb.png) and after resizing the window 1px it looks like this ![image](https://user-images.githubusercontent.com/28623044/188618094-490f2522-d527-4777-bc51-26cdc88b02e0.png). This switches on every window resize. On Edge it's a bit harder to see, but the lines appear thinner: ![image](https://user-images.githubusercontent.com/28623044/188618478-8087e6a9-729d-4e2c-a634-41116a31aa28.png) ![image](https://user-images.githubusercontent.com/28623044/188618551-86afc5d5-068a-45c5-a981-ae0d5fc58a97.png) Here is my flutter doctor -v: [√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22622.590], locale en-NL) • Flutter version 3.3.0 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ffccd96b62 (7 days ago), 2022-08-29 17:28:57 -0700 • Engine revision 5e9e0e0aa8 • Dart version 2.18.0 • DevTools version 2.15.0 [√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2) • Android SDK at C:\Users\dxzds\AppData\Local\Android\sdk • Platform android-31, build-tools 33.0.0-rc2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.1.32407.343 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) [√] VS Code (version 1.71.0) • VS Code at C:\Users\dxzds\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.48.0 [√] Connected device (4 available) • IN2023 (mobile) • 192.168.0.225:42091 • android-arm64 • Android 12 (API 31) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22622.590] • Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.52 • Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.27 [√] HTTP Host Availability • All required HTTP hosts are available Also here are the SVG files, in case you want to try them: ![ic_ero](https://user-images.githubusercontent.com/28623044/188618985-ac540767-a3ab-46ea-b26f-e8257d9664aa.svg) ![ic_info](https://user-images.githubusercontent.com/28623044/188618996-20e37ca3-94ac-4819-9709-378350e44679.svg) I hope you can help me! Thanks for reading this far, Thomas --- Comment by @dbacic on Oct 11, 2022 I'm facing the same issue on Windows and macOS. Moving the app from the MacBook to the external monitor messes up the image quality (same for windows lap top). Not sure if it has to do something with Flutter or this package? --- Comment by @jkaae93 on Jul 13, 2023 I have same issue on iOS. any other solution? or update? <details><summary>Flutter doctor -v</summary> <p> [✓] Flutter (Channel stable, 3.10.1, on macOS 13.5 22G5059d darwin-arm64, locale ko-KR) • Flutter version 3.10.1 on channel stable at /Users/--/Library/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision d3d8effc68 (8 weeks ago), 2023-05-16 17:59:05 -0700 • Engine revision b4fb11214d • Dart version 3.0.1 • DevTools version 2.23.1 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/--/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/--//Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.12.1 [✓] Android Studio (version 2022.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.80.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.54.0 </p> </details> [Image](https://imgproxy.holix.com/aHR0cHM6Ly9zdG9yYWdlLmVkdWNhc3QuY29tL2NoYXQtcm9vbS9jb21tb24vZDI2NmYxNWQtYmY0OS00N2ZiLTllOGItYzMyMDkyYmYyMjVlL0lNR19EMkJCQzEzOTY3M0UtMS5qcGVn.webp)
package,p: flutter_svg
low
Minor
2,655,988,858
flutter
[flutter_svg] FittedBox and BoxFit.contain doesn't work as expected (PoC included)
_Imported from https://github.com/dnfield/flutter_svg/issues/768_ Original report by @eximius313 on Sep 6, 2022 Having such code: ```dart import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class TestFittedBox extends StatelessWidget { const TestFittedBox({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar(), body: Container( child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 2, child: Container(), ), Expanded( flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 1, child: PoC(), ), Expanded( flex: 6, child: Container(), ), ], ), ), ], ), ), ), ); } } class PoC extends StatelessWidget { @override Widget build(final BuildContext context) => Container( decoration: BoxDecoration(border: Border.all(color: Colors.black,),), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, children: [ Flag(), Flag(), Flag(), Flag(), ], ), ), ); } class Flag extends StatelessWidget { @override Widget build(BuildContext context) => GestureDetector( onTapDown: null, child: Container( padding: EdgeInsets.only(left: 10, right: 10,), child: ClipRRect( borderRadius: BorderRadius.circular(5), child: Image.asset("assets/flags/gb.png", fit: BoxFit.contain,), //works fine // child: FittedBox(child: SvgPicture.asset('assets/flags/gb.svg')), //looks fine, but throws exception // child: SvgPicture.asset('assets/flags/gb.svg', fit: BoxFit.contain,) //doesn't throw exception, but looks terrible ), ), ); } ``` 1. Flag in PNG looks good and works fine (no exceptions) ![image](https://user-images.githubusercontent.com/5578017/188744258-157a15d7-1506-4260-9326-443ac06c27d8.png) 2. Flag in SvgPicture inside FittedBox looks good with hot-reload ![image](https://user-images.githubusercontent.com/5578017/188744532-a9e2ba8d-e119-4de2-ae91-d4d58990275f.png) , but when you restart - it throws exception: ``` ════════ Exception caught by rendering library ═════════════════════════════════ The following assertion was thrown during performLayout(): 'package:flutter/src/rendering/box.dart': Failed assertion: line 319 pos 12: 'width > 0.0': is not true. Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.md The relevant error-causing widget was FittedBox When the exception was thrown, this was the stack #2 BoxConstraints.constrainSizeAndAttemptToPreserveAspectRatio #3 RenderFittedBox.performLayout #4 RenderObject.layout #5 RenderProxyBoxMixin.performLayout #6 _RenderCustomClip.performLayout #7 RenderObject.layout #8 RenderPadding.performLayout #9 RenderObject.layout #10 RenderProxyBoxMixin.performLayout #11 RenderObject.layout #12 RenderProxyBoxMixin.performLayout #13 RenderObject.layout #14 ChildLayoutHelper.layoutChild #15 RenderFlex._computeSizes #16 RenderFlex.performLayout #17 RenderObject.layout #18 _RenderSingleChildViewport.performLayout #19 RenderObject.layout #20 RenderProxyBoxMixin.performLayout #21 RenderObject.layout #22 RenderProxyBoxMixin.performLayout #23 RenderObject.layout #24 RenderProxyBoxMixin.performLayout #25 RenderObject.layout #26 RenderProxyBoxMixin.performLayout #27 RenderObject.layout #28 RenderProxyBoxMixin.performLayout #29 RenderObject.layout #30 RenderProxyBoxMixin.performLayout #31 RenderObject.layout #32 RenderProxyBoxMixin.performLayout #33 RenderObject.layout #34 RenderProxyBoxMixin.performLayout #35 RenderCustomPaint.performLayout #36 RenderObject.layout #37 RenderProxyBoxMixin.performLayout #38 RenderObject.layout #39 RenderPadding.performLayout #40 RenderObject.layout #41 RenderProxyBoxMixin.performLayout #42 RenderObject.layout #43 ChildLayoutHelper.layoutChild #44 RenderFlex._computeSizes #45 RenderFlex.performLayout #46 RenderObject.layout #47 ChildLayoutHelper.layoutChild #48 RenderFlex._computeSizes #49 RenderFlex.performLayout #50 RenderObject.layout #51 MultiChildLayoutDelegate.layoutChild #52 _ScaffoldLayout.performLayout #53 MultiChildLayoutDelegate._callPerformLayout #54 RenderCustomMultiChildLayoutBox.performLayout #55 RenderObject.layout #56 RenderProxyBoxMixin.performLayout #57 RenderObject.layout #58 RenderProxyBoxMixin.performLayout #59 _RenderCustomClip.performLayout #60 RenderObject.layout #61 RenderProxyBoxMixin.performLayout #62 RenderObject.layout #63 RenderProxyBoxMixin.performLayout #64 RenderObject.layout #65 RenderProxyBoxMixin.performLayout #66 RenderObject.layout #67 RenderProxyBoxMixin.performLayout #68 RenderObject.layout #69 RenderProxyBoxMixin.performLayout #70 RenderObject.layout #71 RenderProxyBoxMixin.performLayout #72 RenderObject.layout #73 RenderProxyBoxMixin.performLayout #74 RenderObject.layout #75 RenderProxyBoxMixin.performLayout #76 RenderObject.layout #77 RenderProxyBoxMixin.performLayout #78 RenderObject.layout #79 RenderProxyBoxMixin.performLayout #80 RenderObject.layout #81 RenderProxyBoxMixin.performLayout #82 RenderObject.layout #83 RenderProxyBoxMixin.performLayout #84 RenderObject.layout #85 RenderProxyBoxMixin.performLayout #86 RenderObject.layout #87 RenderProxyBoxMixin.performLayout #88 RenderObject.layout #89 RenderProxyBoxMixin.performLayout #90 RenderObject.layout #91 RenderProxyBoxMixin.performLayout #92 RenderObject.layout #93 RenderProxyBoxMixin.performLayout #94 RenderOffstage.performLayout #95 RenderObject.layout #96 RenderProxyBoxMixin.performLayout #97 RenderObject.layout #98 _RenderTheatre.performLayout #99 RenderObject.layout #100 RenderProxyBoxMixin.performLayout #101 RenderObject.layout #102 RenderProxyBoxMixin.performLayout #103 RenderObject.layout #104 RenderProxyBoxMixin.performLayout #105 RenderObject.layout #106 RenderProxyBoxMixin.performLayout #107 RenderCustomPaint.performLayout #108 RenderObject.layout #109 RenderProxyBoxMixin.performLayout #110 RenderObject.layout #111 RenderProxyBoxMixin.performLayout #112 RenderObject.layout #113 RenderProxyBoxMixin.performLayout #114 RenderObject.layout #115 RenderProxyBoxMixin.performLayout #116 RenderObject.layout #117 RenderView.performLayout #118 RenderObject._layoutWithoutResize #119 PipelineOwner.flushLayout #120 RendererBinding.drawFrame #121 WidgetsBinding.drawFrame #122 RendererBinding._handlePersistentFrameCallback #123 SchedulerBinding._invokeFrameCallback #124 SchedulerBinding.handleDrawFrame #125 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch) The following RenderObject was being processed when the exception was fired: RenderFittedBox#fd977 relayoutBoundary=up6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE RenderObject: RenderFittedBox#fd977 relayoutBoundary=up6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: <none> (can use size) constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=67.1) size: MISSING fit: contain alignment: Alignment.center textDirection: ltr child: RenderSemanticsAnnotations#19efb relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: <none> (can use size) constraints: BoxConstraints(unconstrained) size: Size(0.0, 0.0) child: RenderLimitedBox#6f94a relayoutBoundary=up8 NEEDS-PAINT parentData: <none> (can use size) constraints: BoxConstraints(unconstrained) size: Size(0.0, 0.0) ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFittedBox#fd977 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was ClipRRect ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderClipRRect#18b61 relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPadding#7610e relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was GestureDetector ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPointerListener#c11e7 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was GestureDetector ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderSemanticsGestureHandler#84e77 relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Row ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFlex#47c31 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: _RenderSingleChildViewport#68fb4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderIgnorePointer#8b00a NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderSemanticsAnnotations#bb934 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPointerListener#567d6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderSemanticsGestureHandler#2cb7d NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPointerListener#d0a1b NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: _RenderScrollSemantics#49ecf NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderRepaintBoundary#f4b51 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderCustomPaint#dbee4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was SingleChildScrollView ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderRepaintBoundary#f5739 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderPadding#00888 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderDecoratedBox#f4a5e NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Column ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFlex#88b30 relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Row ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderFlex#96dde relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Scaffold ════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderDecoratedBox#f4a5e 'package:flutter/src/rendering/box.dart': Failed assertion: line 1979 pos 12: 'hasSize' The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════ D/EGL_emulation( 7980): app_time_stats: avg=85030.66ms min=85030.66ms max=85030.66ms count=1 ``` 3. Flag in `SvgPicture` with `BoxFit.contain` doesn't throw exception, but behaves in unexpected manner: ![image](https://user-images.githubusercontent.com/5578017/188745111-238c4ffa-d614-47a5-95ef-4165ceb83190.png) Image files are attached here: [flags.zip](https://github.com/dnfield/flutter_svg/files/9501020/flags.zip) --- Comment by @hit-flutter on Jan 11, 2024 Same issue here! Any update on this? --- Comment by @Abdelazeem777 on Mar 7, 2024 Same Here as well! --- Comment by @fullflash on Mar 13, 2024 same here. looks like tries to render before it is loaded properly. --- Comment by @fullflash on Mar 13, 2024 my workaround for Assertion error width>0 is wrapping with container and provide minWidth via constraints property ``` return Container( constraints: BoxConstraints(minWidth: 20), child: buildAsset(context), ); ```
package,p: flutter_svg
low
Critical
2,655,988,972
flutter
[flutter_svg] SvgPicture.network fails with Connection refused
_Imported from https://github.com/dnfield/flutter_svg/issues/774_ Original report by @cardexc on Sep 12, 2022 There is an issue when I try to get a lot (60-70) of SVG images via the network. I believe it depends on server restrictions. return SvgPicture.network("svg_file_url_$channelId", color: AppColors.white90, placeholderBuilder: (context) { return Center( child: ChannelLogoPlaceHolder(widget.channelId), );} Log: `Connection refused (OS Error: Connection refused, errno = 61), address = server_url, port = 51223` Is there any way to catch the error / re-launch SVG file retrieving? > Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.0.4, on macOS 12.1 21C52 darwin-arm, locale en-UA) [!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) [✓] Connected device (2 available) [✓] HTTP Host Availability flutter_svg: ^1.1.4
package,p: flutter_svg
low
Critical
2,655,989,083
flutter
[flutter_svg] Unsupported translate3d?
_Imported from https://github.com/dnfield/flutter_svg/issues/780_ Original report by @LongTien15 on Oct 1, 2022 I'm having this svg and want to show it on flutter app : <svg width="290" height="500" viewBox="0 0 290 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink'><defs><filter id="f1"><feImage result="p0" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PHJlY3Qgd2lkdGg9JzI5MHB4JyBoZWlnaHQ9JzUwMHB4JyBmaWxsPScjYTBiODY5Jy8+PC9zdmc+"/><feImage result="p1" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGNpcmNsZSBjeD0nMjUnIGN5PSczNzEnIHI9JzEyMHB4JyBmaWxsPScjZWQwNDkxJy8+PC9zdmc+"/><feImage result="p2" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGNpcmNsZSBjeD0nNzAnIGN5PSc0MDInIHI9JzEyMHB4JyBmaWxsPScjMDZlYjQ4Jy8+PC9zdmc+" /><feImage result="p3" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGNpcmNsZSBjeD0nMjU1JyBjeT0nMjc2JyByPScxMDBweCcgZmlsbD0nIzIzMTQzZCcvPjwvc3ZnPg==" /><feBlend mode="overlay" in="p0" in2="p1" /><feBlend mode="exclusion" in2="p2" /><feBlend mode="overlay" in2="p3" result="blendOut" /><feGaussianBlur in="blendOut" stdDeviation="42" /></filter> <clipPath id="corners"><rect width="290" height="500" rx="42" ry="42" /></clipPath><path id="text-path-a" d="M40 12 H250 A28 28 0 0 1 278 40 V460 A28 28 0 0 1 250 488 H40 A28 28 0 0 1 12 460 V40 A28 28 0 0 1 40 12 z" /><path id="minimap" d="M234 444C234 457.949 242.21 463 253 463" /><filter id="top-region-blur"><feGaussianBlur in="SourceGraphic" stdDeviation="24" /></filter><linearGradient id="grad-up" x1="1" x2="0" y1="1" y2="0"><stop offset="0.0" stop-color="white" stop-opacity="1" /><stop offset=".9" stop-color="white" stop-opacity="0" /></linearGradient><linearGradient id="grad-down" x1="0" x2="1" y1="0" y2="1"><stop offset="0.0" stop-color="white" stop-opacity="1" /><stop offset="0.9" stop-color="white" stop-opacity="0" /></linearGradient><mask id="fade-up" maskContentUnits="objectBoundingBox"><rect width="1" height="1" fill="url(#grad-up)" /></mask><mask id="fade-down" maskContentUnits="objectBoundingBox"><rect width="1" height="1" fill="url(#grad-down)" /></mask><mask id="none" maskContentUnits="objectBoundingBox"><rect width="1" height="1" fill="white" /></mask><linearGradient id="grad-symbol"><stop offset="0.7" stop-color="white" stop-opacity="1" /><stop offset=".95" stop-color="white" stop-opacity="0" /></linearGradient><mask id="fade-symbol" maskContentUnits="userSpaceOnUse"><rect width="290px" height="200px" fill="url(#grad-symbol)" /></mask></defs><g clip-path="url(#corners)"><rect fill="a0b869" x="0px" y="0px" width="290px" height="500px" /><rect style="filter: url(#f1)" x="0px" y="0px" width="290px" height="500px" /> <g style="filter:url(#top-region-blur); transform:scale(1.5); transform-origin:center top;"><rect fill="none" x="0px" y="0px" width="290px" height="500px" /><ellipse cx="50%" cy="0px" rx="180px" ry="120px" fill="#000" opacity="0.85" /></g><rect x="0" y="0" width="290" height="500" rx="42" ry="42" fill="rgba(0,0,0,0)" stroke="rgba(255,255,255,0.2)" /></g><text text-rendering="optimizeSpeed"><textPath startOffset="-100%" fill="white" font-family="'Courier New', monospace" font-size="10px" xlink:href="#text-path-a">0xed04915c23f00a313a544955524eb7dbd823143d • ACH <animate additive="sum" attributeName="startOffset" from="0%" to="100%" begin="0s" dur="30s" repeatCount="indefinite" /></textPath> <textPath startOffset="0%" fill="white" font-family="'Courier New', monospace" font-size="10px" xlink:href="#text-path-a">0xed04915c23f00a313a544955524eb7dbd823143d • ACH <animate additive="sum" attributeName="startOffset" from="0%" to="100%" begin="0s" dur="30s" repeatCount="indefinite" /> </textPath><textPath startOffset="50%" fill="white" font-family="'Courier New', monospace" font-size="10px" xlink:href="#text-path-a">0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 • USDC <animate additive="sum" attributeName="startOffset" from="0%" to="100%" begin="0s" dur="30s" repeatCount="indefinite" /></textPath><textPath startOffset="-50%" fill="white" font-family="'Courier New', monospace" font-size="10px" xlink:href="#text-path-a">0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 • USDC <animate additive="sum" attributeName="startOffset" from="0%" to="100%" begin="0s" dur="30s" repeatCount="indefinite" /></textPath></text><g mask="url(#fade-symbol)"><rect fill="none" x="0px" y="0px" width="290px" height="200px" /> <text y="70px" x="32px" fill="white" font-family="'Courier New', monospace" font-weight="200" font-size="36px">USDC/ACH</text><text y="115px" x="32px" fill="white" font-family="'Courier New', monospace" font-weight="200" font-size="36px">1%</text></g><rect x="16" y="16" width="258" height="468" rx="26" ry="26" fill="rgba(0,0,0,0)" stroke="rgba(255,255,255,0.2)" /><g mask="url(#fade-up)" style="transform:translate(72px,189px)"><rect x="-16px" y="-16px" width="180px" height="180px" fill="none" /><path d="M1 1C17 73 73 129 145 145" stroke="rgba(0,0,0,0.3)" stroke-width="32px" fill="none" stroke-linecap="round" /></g><g mask="url(#fade-up)" style="transform:translate(72px,189px)"><rect x="-16px" y="-16px" width="180px" height="180px" fill="none" /><path d="M1 1C17 73 73 129 145 145" stroke="rgba(255,255,255,1)" fill="none" stroke-linecap="round" /></g><circle cx="217px" cy="334px" r="4px" fill="white" /><circle cx="217px" cy="334px" r="24px" fill="none" stroke="white" /> <g style="transform:translate(29px, 384px)"><rect width="98px" height="26px" rx="8px" ry="8px" fill="rgba(0,0,0,0.6)" /><text x="12px" y="17px" font-family="'Courier New', monospace" font-size="12px" fill="white"><tspan fill="rgba(255,255,255,0.6)">ID: </tspan>107484</text></g> <g style="transform:translate(29px, 414px)"><rect width="133px" height="26px" rx="8px" ry="8px" fill="rgba(0,0,0,0.6)" /><text x="12px" y="17px" font-family="'Courier New', monospace" font-size="12px" fill="white"><tspan fill="rgba(255,255,255,0.6)">Min Tick: </tspan>63600</text></g> <g style="transform:translate(29px, 444px)"><rect width="133px" height="26px" rx="8px" ry="8px" fill="rgba(0,0,0,0.6)" /><text x="12px" y="17px" font-family="'Courier New', monospace" font-size="12px" fill="white"><tspan fill="rgba(255,255,255,0.6)">Max Tick: </tspan>76000</text></g><g style="transform:translate(226px, 433px)"><rect width="36px" height="36px" rx="8px" ry="8px" fill="none" stroke="rgba(255,255,255,0.2)" /><path stroke-linecap="round" d="M8 9C8.00004 22.9494 16.2099 28 27 28" fill="none" stroke="white" /><circle style="transform:translate3d(21px, 27px, 0px)" cx="0px" cy="0px" r="4px" fill="white"/></g></svg> But flutter_svg throws translate3d not supported + % not supported. How can i bypass this problem
package,p: flutter_svg
low
Minor
2,655,989,188
flutter
[flutter_svg] When there is text in Svg, the fill efficiency attribute of the text is invalid. Text will not become transparent.
_Imported from https://github.com/dnfield/flutter_svg/issues/792_ Original report by @superbor on Oct 20, 2022 When there is text in Svg, the fill efficiency attribute of the text is invalid. Text will not become transparent. This is the svg code ```xml <?xml version="1.0" encoding="UTF-8"?> <svg width="200px" height="172px" viewBox="0 0 200 172" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>customer_ic_wait</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="5-2-1审批结果" transform="translate(-516.000000, -333.000000)"> <g id="customer_ic_wait" transform="translate(516.000000, 333.000000)"> <path d="M186.206897,86 C186.206897,133.496488 147.610754,172 100,172 C82.3485615,172 65.9361966,166.707627 52.2703653,157.626724 L57.3074568,154.723952 C69.7046214,162.404643 84.333098,166.84 100,166.84 C144.754109,166.84 181.034483,130.646699 181.034483,86 C181.034483,85.1583494 181.02159,84.3197029 180.99599,83.4842463 L186.038532,80.5810408 C186.15022,82.3730478 186.206897,84.179921 186.206897,86 Z M100,0 C117.237831,0 133.293975,5.04725725 146.764479,13.7411859 L141.689922,16.6648745 C129.509685,9.36055401 115.246568,5.16 100,5.16 C55.245891,5.16 18.9655172,41.3533008 18.9655172,86 C18.9655172,86.4488133 18.9691835,86.8967723 18.9764878,87.3438489 L13.8974942,90.269647 C13.8281704,88.8551408 13.7931034,87.4316557 13.7931034,86 C13.7931034,38.5035115 52.3892457,0 100,0 Z" id="形状结合" fill-opacity="0.24" fill="#157EFC" fill-rule="nonzero"></path> <path d="M100,137.6 C96.2440273,137.6 92.5815587,137.200622 89.0529374,136.442113 L96.2569021,132.292055 C97.4916556,132.39006 98.7399817,132.44 100,132.44 C118.568938,132.44 134.598557,121.593976 142.070483,105.905856 L149.2667,101.761418 C142.589192,122.550622 123.05631,137.6 100,137.6 Z M100,34.4 C103.215395,34.4 106.362264,34.6926898 109.415296,35.2528194 L101.874313,39.5969551 C101.252599,39.5723957 100.627751,39.56 100,39.56 C82.0973233,39.56 66.5550112,49.641668 58.7665781,64.4244341 L51.2315639,68.7647602 C58.3421558,48.7418615 77.492188,34.4 100,34.4 Z" id="形状结合" fill-opacity="0.24" fill="#157EFC" fill-rule="nonzero"></path> <g id="编组-11" transform="translate(0.000000, 7.635122)" fill-opacity="0.24"> <path d="M9.1908818,45.3849294 L190.740572,45.5737059 C191.154176,45.574136 191.52857,45.7419434 191.799672,46.0130443 C192.070773,46.2841452 192.238581,46.6585395 192.239011,47.0721435 L192.239011,47.0721435 L192.302353,107.91351 C192.302785,108.327723 192.135282,108.702898 191.864118,108.974627 C191.592954,109.246356 191.218129,109.414639 190.809118,109.415071 L190.809118,109.415071 L9.25942817,109.226294 C8.8458242,109.225864 8.47142965,109.058057 8.20032844,108.786956 C7.92922724,108.515855 7.76141937,108.14146 7.76098877,107.727857 L7.76098877,107.727857 L7.69764655,46.8864902 C7.69721531,46.4722769 7.86471802,46.0971023 8.13588188,45.8253732 C8.40704574,45.5536441 8.78187074,45.3853606 9.1908818,45.3849294 L9.1908818,45.3849294 Z" id="矩形" stroke-opacity="0.24" stroke="#157EFC" stroke-width="5" transform="translate(100.000000, 77.400000) rotate(-30.000000) translate(-100.000000, -77.400000) "></path> <text id="待审批" transform="translate(99.967306, 77.826983) rotate(-30.000000) translate(-99.967306, -77.826983) " font-family="PingFangSC-Semibold, PingFang SC" font-size="36" font-weight="500" fill-opacity="0.24" fill="#157EFC" > <tspan x="45.9673058" y="90.8269832">待审批</tspan> </text> </g> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(54.869549, 40.367818) rotate(26.000000) translate(-54.869549, -40.367818) " points="54.8615291 46.5960044 49.0005015 49.8349623 50.1257617 42.9854189 45.3911644 38.1397784 51.9415141 37.1344018 54.8763997 30.9006734 57.7994782 37.1288599 64.3479346 38.1218444 59.6041468 42.9764519 60.7164298 49.8238785"></polygon> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(81.415620, 22.725654) rotate(64.000000) translate(-81.415620, -22.725654) " points="81.4075996 28.9630649 75.5552316 32.2068098 76.6788379 25.3471275 71.9512464 20.4943066 78.4919143 19.4874508 81.4224701 13.2444976 84.3412188 19.4819088 90.8799934 20.4763725 86.1432114 25.3381605 87.2538406 32.1957259"></polygon> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(37.860541, 65.679685) rotate(50.000000) translate(-37.860541, -65.679685) " points="37.8505177 71.9130924 31.9942761 75.1565029 33.1200965 68.3001958 28.3911378 63.4510722 34.9355176 62.4432 37.869102 56.2028663 40.7879307 62.4362741 47.3299444 63.4286594 42.5894999 68.2889894 43.6991023 75.142651"></polygon> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(140.019964, 137.601063) scale(-1, 1) rotate(8.000000) translate(-140.019964, -137.601063) " points="140.017159 143.828462 134.155693 147.062473 135.277198 140.216463 130.537647 135.369923 137.090098 134.36899 140.022361 128.139653 142.950493 134.367052 149.502282 135.36365 144.759516 140.213327 145.876482 147.058596"></polygon> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(161.099469, 112.658886) rotate(100.000000) translate(-161.099469, -112.658886) " points="161.10295 118.900293 155.257254 122.137351 156.371121 115.276518 151.638783 110.415378 158.175545 109.417018 161.096496 103.175611 164.022571 109.419424 170.560155 110.423162 165.831807 115.28041 166.951306 122.142161"></polygon> <polygon id="星形" fill-opacity="0.24" fill="#157EFC" transform="translate(107.691006, 150.775382) rotate(100.000000) translate(-107.691006, -150.775382) " points="107.694487 157.016789 101.848791 160.253847 102.962657 153.393014 98.2303193 148.531874 104.767082 147.533514 107.688032 141.292107 110.614108 147.53592 117.151692 148.539658 112.423343 153.396906 113.542842 160.258657"></polygon> </g> </g> </g> </svg> ```
package,p: flutter_svg
low
Minor
2,655,989,309
flutter
[flutter_svg] Allow animation/transition between placeholderBuilder and the SVG
_Imported from https://github.com/dnfield/flutter_svg/issues/796_ Original report by @lille-morille on Oct 22, 2022 Having some sort of animation control for fading etc between the placeholder and SVG would be nice. Flutter is great for fluid animations and transitions, and simply snapping between two images looks off in many apps. Following the Material Design Guidelines, loading images should fade between the loading and complete state. [[LINK]](https://m1.material.io/patterns/loading-images.html#) Please consider my suggestion. I love this project, thank you for a great package! <3 --- Comment by @behnamsattar on Jan 25, 2023 Or maybe even consider adding a [frameBuilder](https://api.flutter.dev/flutter/widgets/Image/frameBuilder.html) property the way it's used for the built-in Image widget. --- Comment by @jaggernod on Mar 9, 2023 Before v2.0 it was relatively simple to have the crossfade. However, required changing the top level of `SvgPicture` (not the cleanest solution). In v2.+ `flutter_svg` does not have enough information to handle the animation. Now [vector_graphics](https://github.com/dnfield/vector_graphics/issues/193) would need to expose the feature.
package,p: flutter_svg
low
Minor
2,655,989,438
flutter
[flutter_svg] Web svg gradient is not rendered in mobile bowsers
_Imported from https://github.com/dnfield/flutter_svg/issues/811_ Original report by @Turbozanik on Nov 24, 2022 **Issue**: Svg gradient not rendered on mobile browsers **Lib version**: flutter_svg: 1.1.5 **SVG example**: ``` <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <radialGradient id="paint0_radial_73_656" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(50.5729 50.5729) rotate(90) scale(45.5729)"> <stop offset="0.640625" stop-color="#4DC9DB" stop-opacity="0.8"/> <stop offset="1" stop-color="#4DC9DB" stop-opacity="0"/> </radialGradient> <radialGradient id="paint1_radial_73_656" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(50.3333 51.3333) rotate(90) scale(33.3333)"> <stop offset="0.276042" stop-color="#05B179" stop-opacity="0.8"/> <stop offset="0.838542" stop-color="#05B179" stop-opacity="0"/> </radialGradient> <g clip-path="url(#clip0_73_656)"> <g opacity="0.3" filter="url(#filter0_f_73_656)"> <path d="M50.5729 96.1458C75.7421 96.1458 96.1458 75.7421 96.1458 50.5729C96.1458 25.4037 75.7421 5 50.5729 5C25.4037 5 5 25.4037 5 50.5729C5 75.7421 25.4037 96.1458 50.5729 96.1458Z" fill="url(#paint0_radial_73_656)"/> </g> <g opacity="0.3" filter="url(#filter1_f_73_656)"> <path d="M50.3333 84.6667C68.7428 84.6667 83.6667 69.7428 83.6667 51.3333C83.6667 32.9238 68.7428 18 50.3333 18C31.9238 18 17 32.9238 17 51.3333C17 69.7428 31.9238 84.6667 50.3333 84.6667Z" fill="url(#paint1_radial_73_656)"/> </g> <path d="M66.4586 39.1579C66.0068 39.1579 65.5633 39.2666 65.1617 39.4842C64.76 39.6934 64.417 40.003 64.1659 40.3795C63.9149 40.756 63.7476 41.1828 63.6974 41.6346C63.6472 42.0864 63.7057 42.5383 63.8731 42.965L58.0159 48.8222C57.3633 48.5628 56.6353 48.5628 55.9827 48.8222L51.799 44.6385C51.9663 44.2201 52.0249 43.7599 51.9747 43.3081C51.9245 42.8562 51.7655 42.4295 51.5061 42.053C51.2467 41.6764 50.9121 41.3752 50.5104 41.1577C50.1088 40.9485 49.6653 40.8313 49.2135 40.8313C48.7617 40.8313 48.3182 40.9401 47.9165 41.1577C47.5149 41.3668 47.1719 41.6764 46.9208 42.053C46.6614 42.4295 46.5025 42.8562 46.4523 43.3081C46.4021 43.7599 46.4606 44.2117 46.628 44.6385L39.658 51.6085C39.0639 51.3742 38.4029 51.3575 37.8004 51.5499C37.1896 51.7424 36.6708 52.144 36.3194 52.6795C35.968 53.215 35.8174 53.8509 35.8759 54.4868C35.9429 55.1228 36.2274 55.7168 36.6792 56.1687C37.131 56.6205 37.7251 56.905 38.361 56.972C38.997 57.0389 39.6329 56.8799 40.1684 56.5285C40.7039 56.1771 41.0972 55.6583 41.298 55.0475C41.4904 54.4366 41.4737 53.784 41.2394 53.1899L48.2094 46.2199C48.8621 46.4793 49.59 46.4793 50.2427 46.2199L54.4263 50.4036C54.259 50.822 54.2004 51.2822 54.2506 51.734C54.3008 52.1858 54.4598 52.6126 54.7192 52.9891C54.9786 53.3656 55.3133 53.6668 55.7149 53.8844C56.1165 54.0936 56.56 54.2107 57.0119 54.2107C57.4637 54.2107 57.9072 54.102 58.3088 53.8844C58.7104 53.6752 59.0535 53.3656 59.3045 52.9891C59.5639 52.6126 59.7229 52.1858 59.7731 51.734C59.8233 51.2822 59.7647 50.8303 59.5974 50.4036L65.4545 44.5464C65.8394 44.6971 66.241 44.764 66.651 44.7305C67.061 44.7054 67.4543 44.5883 67.8141 44.3875C68.1739 44.1866 68.4835 43.9189 68.7261 43.5842C68.9688 43.2495 69.1278 42.873 69.2031 42.4713C69.2784 42.0697 69.2617 41.6513 69.1612 41.2581C69.0608 40.8648 68.8684 40.4966 68.609 40.1787C68.3496 39.8607 68.0233 39.6097 67.6468 39.434C67.2786 39.2583 66.8686 39.1662 66.4586 39.1662V39.1579Z" fill="#4DC9DB"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M27.9566 70C27.9566 69.3787 28.4603 68.875 29.0816 68.875H71.7551C72.3764 68.875 72.8801 69.3787 72.8801 70C72.8801 70.6213 72.3764 71.125 71.7551 71.125H29.0816C28.4603 71.125 27.9566 70.6213 27.9566 70Z" fill="#4DC9DB"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M28.2449 27.875C28.8662 27.875 29.3699 28.3787 29.3699 29V70C29.3699 70.6213 28.8662 71.125 28.2449 71.125C27.6236 71.125 27.1199 70.6213 27.1199 70V29C27.1199 28.3787 27.6236 27.875 28.2449 27.875Z" fill="#4DC9DB"/> </g> <defs> <filter id="filter0_f_73_656" x="1" y="1" width="99.1458" height="99.146" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="2" result="effect1_foregroundBlur_73_656"/> </filter> <filter id="filter1_f_73_656" x="16" y="17" width="68.6667" height="68.6665" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="0.5" result="effect1_foregroundBlur_73_656"/> </filter> <clipPath id="clip0_73_656"> <rect width="100" height="100" fill="white"/> </clipPath> </defs> </svg> ``` **How I use it**: ``` Visibility( visible: element.mAnswer.getIconPath().isNotEmpty, child: SvgPicture.asset(element.mAnswer.getHighlightedIconPath(), width: mIconSize), ) ``` Results comparison: **Mobile Web:**: ![photo1669311787](https://user-images.githubusercontent.com/7550948/203843090-6689e851-c3a7-44f0-8b17-a5937d637885.jpeg) **Desctop Web**: ![desctop_web png](https://user-images.githubusercontent.com/7550948/203842961-ec6c9d0e-aae9-4bdd-90ee-c50baf10a6ce.jpg) **Question:** Maybe someone has an idea of how can I fix that? **UPDATE #1**: FYI: Also my images generate the following warning during precaching, but still works as it should. And precaching also works. `unhandled element filter; Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#0e6dd(), name: "assets/images/ic_healthcare_highlighted.svg", colorFilter: null, theme: SvgTheme(currentColor: Color(0xff000000), fontSize: 14, xHeight: 7))` --- Comment by @dnfield on Jan 20, 2023 This is an upstream issue in Flutter - the HTML backend likely has not implemented something here that is impelemnted for the CanvasKit backend.
package,p: flutter_svg
low
Minor
2,655,989,556
flutter
[flutter_svg] Transparency issues caused by the latest version
_Imported from https://github.com/dnfield/flutter_svg/issues/812_ Original report by @RonakPustack on Nov 25, 2022 Original Image ![update_star](https://user-images.githubusercontent.com/68676516/203942660-ea711121-48cf-4774-85e4-d993315e9c6e.svg) Using flutter_svg 0.22.0 ![316590502_1126330801392133_5954360089196919729_n](https://user-images.githubusercontent.com/68676516/203942765-8b3064b2-2393-493b-9b3b-e75ff0787faf.jpg) Using the latest flutter_svg version ![316878913_1300759857366709_2963551458229049682_n](https://user-images.githubusercontent.com/68676516/203942827-6e3e352b-6bd2-4b93-a160-aaf218d6ed0b.jpg) I see that the latest version imports the svg as it is, which is an improvement but is there a way for me to achieve the same result that 0.22.0 gives without a color or blend mode, because this image is being used over a gradient, and using blend mode requires this image to have some background color, which would overlay the gradient.
package,p: flutter_svg
low
Minor
2,655,989,655
flutter
[flutter_svg] Compared with the browser, it is found that this svg rendering error
_Imported from https://github.com/dnfield/flutter_svg/issues/813_ Original report by @weaver712 on Nov 26, 2022 ![bugly](https://user-images.githubusercontent.com/26682933/204067718-d9ceb20a-9fa5-41bd-be50-d2b1b7b352e6.svg)
package,p: flutter_svg
low
Critical
2,655,989,761
flutter
[flutter_svg] SVG from string not rendering image from url
_Imported from https://github.com/dnfield/flutter_svg/issues/819_ Original report by @JoakoV3 on Dec 16, 2022 I have these markers in google maps [![googel maps markers][1]][1] [1]: https://i.stack.imgur.com/e1mdt.png I am generating them from an svg with an `<image>` that has a network image. ### The problem is, the markers image that should be inside is not being displayed. Here's the code that I use to generate the marker: ``` import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' show BitmapDescriptor; import 'dart:ui' as ui; Future<BitmapDescriptor> getAssetImageMarker(String networkImage) async { Size size = const Size(30, 30); String svgString = ''' <svg width="100" height="100" > <defs> <pattern id="image-pattern" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse" > <image href="https://images.unsplash.com/photo-1608848461950-0fe51dfc41cb" x="0" y="0" width="100" height="120" /> </pattern> </defs> <circle cx="50" cy="50" r="40" stroke="orange" stroke-width="4" fill="url(#image-pattern)" /> </svg> '''; final svgDrawableRoot = await svg.fromSvgString(svgString, 'debug: ${svgString.codeUnits}'); final ratio = ui.window.devicePixelRatio.ceil(); final width = size.width.ceil() * ratio; final height = size.height.ceil() * ratio; final picture = svgDrawableRoot.toPicture( size: Size( width.toDouble(), height.toDouble(), ), ); final image = await picture.toImage(width, height); final byteData = await image.toByteData(format: ui.ImageByteFormat.png); final uInt8List = byteData!.buffer.asUint8List(); return BitmapDescriptor.fromBytes(uInt8List); } ``` I don't know what the cause could be. Is this supported in svgFromString? --- Comment by @Zurigan on Jan 5, 2023 As far as I can work out `<pattern>` is unsupported by flutter_svg, that entire element will be ignored by the svg parser with a `unhandled element pattern;` info message in your debug console.
package,p: flutter_svg
low
Critical
2,655,989,889
flutter
[flutter_svg] Patterns with objectBoundingBox not rendering correctly
_Imported from https://github.com/dnfield/flutter_svg/issues/820_ Original report by @davidgtu on Dec 19, 2022 I'm using flutter_svg on the latest version (1.1.6) as of writing. I've been able to render SVGs with this library in the past, but I tried adding SVGs recently and I wasn't able to get it rendering. I have it added in `pubspec.yaml` ``` assets: - assets/svg/discover_more/ ``` and it's generated using `flutter pub run build_runner build`. when I try to render it, I see that it's returning the correct string, like `"assets/svg/discover_more/discover_more_articles.svg"` However it just renders a white box: [![enter image description here][1]][1] and I'm using it like this: ```dart SvgPicture.asset(image) // image = assets/svg/discover_more/discover_more_articles.svg ``` I've tried a combination of BoxFits and widths as well and it doesn't show anything besides that. I remember reading somewhere in the library's repo that it doesn't handle SVGs with `<image>` tags in them. For reference, my new SVGs look something like this with a base64 image: ```svg <svg width="1410" height="1069" viewBox="0 0 1410 1069" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0.196289" y="0.604492" width="1408.96" height="1067.84" fill="url(#pattern0)"/> <defs> <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"> <use xlink:href="#image0_1181_25" transform="scale(0.00190857 0.00251825)"/> </pattern> <image id="image0_1181_25" width="541" height="404" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAh0AAAGUCAYAAACRN5BqAAAMP2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbQAAlJCb4KIlABSQmihdwRRCUmAUEIMBBV7WVRw7aICNnRVRLHT7IidRbFhXyyoKOtiwa68SQFd95XvzffNnf/+c+Y/Z86dufcOAOonuGJxLqoBQJ6oUBIb7M8Ym5zCID0BZKABUGAArLm8AjErOjocwDLY/r28uwEQWXvVQab1z/7/WjT5ggIeAEg0xOn8Al4exAcBwKt4YkkhAEQZbz65UCzDsAJtCQwQ4oUynKnAVTKcrsB75TbxsWyIWwEgq3K5kkwA1C5DnlHEy4Qaan0QO4n4QhEA6gyIffLy8vkQp0FsA23EEMv0mek/6GT+TTN9SJPLzRzCirnICzlAWCDO5U79P9Pxv0ternTQhxWsqlmSkFjZnGHebubkh8mwKsS9ovTIKIi1IP4g5MvtIUapWdKQBIU9asgrYMOcAV2InfjcgDCIDSEOEuVGhiv59AxhEAdiuELQKcJCTjzEehAvFBQExiltNknyY5W+0PoMCZul5M9x...."/> </defs> </svg> ``` [1]: https://i.stack.imgur.com/97htl.png --- Comment by @GSPrakashNaidu2 on Jan 30, 2023 @davidgtu try to place the def element before the rect tag and check.. --- Comment by @p29hieu on May 9, 2023 The same problem. I'm using the SvgPicture.network() instance, and my url is [image](https://meterial-chef-ai.s3.ap-southeast-1.amazonaws.com/setting/allergicFood/allergicFood/Th%E1%BB%B1c+ph%E1%BA%A9m+d%E1%BB%8B+%E1%BB%A9ng+-+Th%E1%BB%8Bt+b%C3%B2.svg). When I copy this url to browser and check the response, I found the `<image />` tag in `svg` body. Maybe this is the problem.
package,p: flutter_svg
low
Critical
2,655,990,016
flutter
[flutter_svg] SVG not rendering remotelly but works locally
_Imported from https://github.com/dnfield/flutter_svg/issues/821_ Original report by @ranvirsahota on Dec 20, 2022 Can't get the attached svg to render ![Untitled-1](https://user-images.githubusercontent.com/18485561/208668109-6a591623-7191-4a78-ab88-48fc52d7f80e.svg) I did what was requested as per the reccomendations setting svg attritubutes to required values. I don't know if related or not but when I try to upload the icon to fluttericon.com I always get an error saying ``` If image looks not as expected please convert to [compound path](https://github.com/fontello/fontello/wiki/How-to-use-custom-images#importing-svg-images) manually. Skipped tags and attributes: fill ``` Thanks --- Comment by @ranvirsahota on Dec 28, 2022 I tried with the svgParser as well this is my code: ``` final SvgParser parser = SvgParser(); try { parser.parse('icons/add/add_white_bg.svg', warningsAsErrors: true); print('SVG is supported'); } catch (e) { print('SVG contains unsupported features'); } ``` And the output ``` SVG is supported Error: Bad state: Invalid SVG data dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_ packages/flutter_svg/src/svg/parser_state.dart 900:7 parse dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/flutter_svg/src/svg/parser_state.dart 877:29 parse packages/flutter_svg/parser.dart 27:23 parse dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/flutter_svg/parser.dart 19:29 parse packages/track/src/features/account_administration/presentation/accounts_list_view.dart 37:13 initState SVG is supported Error: Bad state: Invalid SVG data dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_ packages/flutter_svg/src/svg/parser_state.dart 900:7 parse dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/flutter_svg/src/svg/parser_state.dart 877:29 parse packages/flutter_svg/parser.dart 27:23 parse dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/flutter_svg/parser.dart 19:29 parse packages/track/src/features/account_administration/presentation/accounts_list_view.dart 37:13 initState ``` --- Comment by @the-thirteenth-fox on May 5, 2023 Same problem
package,p: flutter_svg
low
Critical
2,655,990,302
flutter
[flutter_svg] SVG anti-aliasing options guidance?
_Imported from https://github.com/dnfield/flutter_svg/issues/823_ Original report by @workerbee22 on Jan 7, 2023 So I'm building for Android TV / Google TV where screens are physically large, but resolutions can be quite low. As a result I have noticed many of my SVG images are missing any anti-aliasing and so have the _saw-tooth_ pixelated edges look. There seems to be no clear option in `flutter_svg` to enable anti-aliasing. The [flutter_svg package](https://pub.dev/documentation/flutter_svg/latest/flutter_svg/DrawablePaint-class.html) does support `DrawablePaint` class which provides an `isAntiAlias` property, but it is immutable. Is there any guidance/recommendations on how to use this? I realise this would be costly, but if I must choose between grainy looking UI vs. cost, then that is a cost I want to incur. --- Comment by @workerbee22 on Jan 7, 2023 **UPDATE:** I did find in `SvgPicture` the `clipBehavior` property and set to `Clip.antiAlias` instead of the default `Clip.hardEdge` and there was no difference. I then moved it up to `Clip.antiAliasWithSaveLayer` and still no difference. --- Comment by @jonahwilliams on Jan 22, 2023 generally speaking, everything that flutter draws is already anti aliased. Do you have some examples of SVGs that look aliased or perhaps some screenshots of the particular artifacts you are seeing? --- Comment by @mrwonko on Feb 24, 2023 I ran into a similar issue. I did some tests to narrow it down, here's the file I ended up with: ![repro](https://user-images.githubusercontent.com/220725/221192315-24ea1374-b9c2-4cd9-bb4f-2f375e54fd80.svg) The left half of the outer circle is a curve with a border, which renders nicely. The right half is a real circle, which also renders nicely. Inside is a curve in the shape of a border, but which is filled, not using a border. Visually, it's roughly of the same thickness as the borders, but it doesn't render as nicely. It still receives some anti-aliasing, but it looks worse, and there's a noticeable gap: ![Screenshot 2023-02-24 at 14 28 13](https://user-images.githubusercontent.com/220725/221192263-a97ff850-8b6e-4131-b88c-3939a093422a.png) So there appears to be an issue rendering slim shapes, but maybe that's just "doing it wrong"...
package,p: flutter_svg
low
Minor
2,655,990,589
flutter
[flutter_svg] PersistedOffset: is in an unexpected state. when pop back to route that displayed an svg in the AppBar if the platform is Web
_Imported from https://github.com/dnfield/flutter_svg/issues/827_ Original report by @ahmed-alhelali on Jan 17, 2023 Hi everyone! First of all, thanks a lot for this awesome plugin! I'm trying to use the flutter_svg to display the icons everywhere in my app, and everything works perfectly if the platform is Android but!, when the platform is Web and when I try to pop back using "navigator.pop(context)" to a route/screen that shows an SVG in the AppBar(which I use svg_flutter to display) I'm getting this error ```` ``` ======== Exception caught by scheduler library ===================================================== The following PersistedSurfaceException was thrown during a scheduler callback: PersistedOffset: is in an unexpected state. Expected one of: PersistedSurfaceState.active, PersistedSurfaceState.released But was: PersistedSurfaceState.pendingRetention When the exception was thrown, this was the stack: C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_ C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/html/surface.dart 179:3 debugAssertSurfaceState C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/html/scene_builder.dart 294:14 addRetained packages/flutter/src/rendering/layer.dart 643:14 [_addToSceneWithRetainedRendering] packages/flutter/src/rendering/layer.dart 1241:12 addChildrenToScene packages/flutter/src/rendering/layer.dart 1378:5 addToScene packages/flutter/src/rendering/layer.dart 646:5 [_addToSceneWithRetainedRendering] packages/flutter/src/rendering/layer.dart 1241:12 addChildrenToScene packages/flutter/src/rendering/layer.dart 1378:5 addToScene packages/flutter/src/rendering/layer.dart 646:5 [_addToSceneWithRetainedRendering] packages/flutter/src/rendering/layer.dart 1241:12 addChildrenToScene packages/flutter/src/rendering/layer.dart 1834:5 addToScene packages/flutter/src/rendering/layer.dart 1054:5 buildScene packages/flutter/src/rendering/view.dart 231:30 compositeFrame packages/flutter/src/rendering/binding.dart 517:18 drawFrame packages/flutter/src/widgets/binding.dart 884:13 drawFrame packages/flutter/src/rendering/binding.dart 378:5 [_handlePersistentFrameCallback] packages/flutter/src/scheduler/binding.dart 1175:15 [_invokeFrameCallback] packages/flutter/src/scheduler/binding.dart 1104:9 handleDrawFrame packages/flutter/src/scheduler/binding.dart 1015:5 [_handleDrawFrame] C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 1168:13 invoke C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 219:5 invokeOnDrawFrame C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/initialization.dart 195:45 <fn> C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 334:14 _checkAndCall C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 339:39 dcall ``` ```` this is the code example of the first screen that contains the SVG icon in the AppBar ```dart class FirstScreen extends StatelessWidget { const FirstScreen ({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, elevation: 0.0, leading: IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: SvgPicture.asset( Constants.arrowBackIcon, width: 14, height: 14, color: Theme.of(context).primaryColor, ), ), centerTitle: true, title: Text( "Text", ), ), ); } } ``` ```` this is the result of flutter doctor -v ```` ``` [√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.22621.1105], locale en-US) • Flutter version 3.3.10 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 135454af32 (5 weeks ago), 2022-12-15 07:36:55 -0800 • Engine revision 3316dd8728 • Dart version 2.18.6 • DevTools version 2.15.0 [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at C:\Users\ahmed\AppData\Local\Android\sdk • Platform android-33, build-tools 32.1.0-rc1 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.0) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.2.32505.173 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) [√] IntelliJ IDEA Ultimate Edition (version 2022.1) • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2022.1.1 • Flutter plugin version 70.0.4 • Dart plugin version 221.5591.58 [√] VS Code (version 1.74.1) • VS Code at C:\Users\ahmed\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.56.0 [√] Connected device (5 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator) • Android SDK built for x86 (mobile) • emulator-5556 • android-x86 • Android 10 (API 29) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.1105] • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.126 • Edge (web) • edge • web-javascript • Microsoft Edge 109.0.1518.52 [√] HTTP Host Availability • All required HTTP hosts are available • No issues found! ``` ```` --- Comment by @Prn-Ice on Mar 30, 2023 I've got this too, in my case I dont even have to navigate. I just scroll to where the widget is and I see it. --- Comment by @ahmed-alhelali on Apr 12, 2023 That's really strange (: --- Comment by @Ashkan-Oliaie on Oct 19, 2023 I'm getting the similar error, **PersistedOffset: is in an unexpected state. Expected one of: PersistedSurfaceState.active, PersistedSurfaceState.released But was: PersistedSurfaceState.pendingRetention** Seemingly they are related but this happens when I'm scrolling and the color of the svg is changed. if I don't change the original color of the SVG, this won't happen.
package,p: flutter_svg
low
Critical
2,655,990,713
flutter
[flutter_svg] Issues building web when SvgPicture.file is present
_Imported from https://github.com/dnfield/flutter_svg/issues/834_ Original report by @ryzizub on Jan 29, 2023 Im getting error with latest version of this package on when building `flutter build web` ``` Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead. ``` Flutter: 3.3.10 Dart: 2.18.6
package,p: flutter_svg
low
Critical
2,655,990,848
flutter
[flutter_svg] Provide easy migration example(s) for `precachePicture`
_Imported from https://github.com/dnfield/flutter_svg/issues/841_ Original report by @Dohmanlechx on Feb 3, 2023 I just updated this package to `2.0.0+1` and noticed how `precachePicture` no longer existed in the API. Removed the affected functions from the "root page" of the app and yes, now my bottom navigation bar icons and the main logo are delayed. Didn't have this problem when I could precache the images. I have found this: https://github.com/dnfield/flutter_svg/blob/master/vector_graphics.md#precachepicture but unfortunately, it didn't tell me anything. Please provide proper code examples of how to precache an SVG resource, would be highly appreciated. --- Comment by @hygehyge on Feb 3, 2023 @Dohmanlechx Maybe this would work. ```dart const loader = SvgAssetLoader('res/large_icon.svg'); svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); ``` --- Comment by @dnfield on Feb 4, 2023 1. Are your icons still delayed in release/profile mode? See #837 - in debug mode things are slower right now. 2. I can add something about precaching. The problem ends up being that people precache at "bad" times like startup, which delays whole app startup. It shouldn't be quite as bad with the new version because of isolates, but it's still not great. The code that @hygehyge provided should work as well. --- Comment by @Dohmanlechx on Feb 4, 2023 1. No, it's much better in profile mode! 🎉 The small icons in the bottom navigation bar load instantly, but the large SVG illustration we have on the main page still is a bit delayed. I wrote a similar comment here: https://github.com/dnfield/flutter_svg/issues/840#issuecomment-1416062838 2. Actually, we prefer like 500 ms slower app startup than letting our end users see a jumpy layout when the big illustration eventually pops up. That isn't good UX. It would be so nice if you added them back, but I fully understand your concern and motive. I will try to convince our designer to sacrifice this big illustration to get a slightly faster app startup. > @Dohmanlechx Maybe this would work. > > ```dart > const loader = SvgAssetLoader('res/large_icon.svg'); > svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); > ``` Worked like a charm! I really can't feel any difference in the app startup either. Thank you! @dnfield Feel free to close this issue anytime, but I believe this code example would help a lot of people. --- Comment by @levi956 on Feb 6, 2023 > 1. Are your icons still delayed in release/profile mode? See [I am seeing a significant performance regression on 2.0.0 #837](https://github.com/dnfield/flutter_svg/issues/837) - in debug mode things are slower right now. > 2. I can add something about precaching. The problem ends up being that people precache at "bad" times like startup, which delays the whole app startup. It shouldn't be quite as bad with the new version because of the isolates, but it's still not great. > > The code that @hygehyge provided should work as well. The color parameter seems to be deprecated, Please what's the replacement for color SVGs? --- Comment by @levi956 on Feb 6, 2023 > @Dohmanlechx Maybe this would work. > > ```dart > const loader = SvgAssetLoader('res/large_icon.svg'); > svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); > ``` This seems like a single asset file, is it possible to add an asset path for the whole svg path and place it in void main startup? --- Comment by @swiftymf on Feb 6, 2023 > The color parameter seems to be deprecated, Please what's the replacement for color SVGs? I switched to using `colorFilter` by passing in my previous colors into a ColorFilter like this: `colorFilter: ColorFilter.mode(_color, BlendMode.srcIn),` Looks like that is basically the default when you don't pass into anything for `colorFilter` and it's working for me. --- Comment by @swiftymf on Feb 6, 2023 > 1. Are your icons still delayed in release/profile mode? See [I am seeing a significant performance regression on 2.0.0 #837](https://github.com/dnfield/flutter_svg/issues/837) - in debug mode things are slower right now. This was exactly my case. I was running debug builds and it was slow. Once I found this I tried a release build and it's looking good. 👍 --- Comment by @simplenotezy on Feb 22, 2023 @hygehyge is there a reason you don't include the context, and instead pass null? --- Comment by @hygehyge on Feb 22, 2023 @levi956 You can iterate asset names like this. ```dart final manifestJson = await rootBundle.loadString('AssetManifest.json') final images = json.decode(manifestJson).keys.where((String key) => key.startsWith('assets/images')); ``` @simplenotezy I use that code to load a large icon for startup screen, on entry point(`void main()`). So there is no `BuildContext` yet. --- Comment by @sikandernoori on Mar 15, 2023 Based on @hygehyge example I have implemented below in main before running app. ``` final manifestJson = await rootBundle.loadString('AssetManifest.json'); List svgsPaths = (json.decode(manifestJson).keys.where((String key) => key.startsWith('assets/images/') && key.endsWith('.svg')) as Iterable).toList(); for(var svgPath in svgsPaths as List<String>) { var loader = SvgAssetLoader(svgPath); await svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); } ``` and this is how I am getting svg instance. ``` static SvgPicture get getSomeImage => SvgPicture.asset( "assets/images/some_image.svg", height: 40, width: 40, color: Colors.white, ); ``` --- Comment by @olegyablokov on Apr 12, 2023 What if I use ".svg.vec" files as described in "Precompiling and Optimizing SVGs" section in README in flutter_svg? Should I cache these files and if yes then how? --- Comment by @dnfield on Apr 12, 2023 You should not need to cache the .vec files. --- Comment by @keithhie on Apr 17, 2023 ``` final manifestJson = await rootBundle.loadString('AssetManifest.json'); List svgsPaths = (json.decode(manifestJson).keys.where((String key) => key.startsWith('assets/images/') && key.endsWith('.svg')) as Iterable).toList(); for(var svgPath in svgsPaths as List<String>) { var loader = SvgAssetLoader(svgPath); await svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); } ``` This code snippet provided by @sikandernoori used to work for me, but all of a sudden, I'm facing this issue below: ``` Unhandled Exception: 'package:vector_graphics_codec/vector_graphics_codec.dart': Failed assertion: line 771 pos 12: 'format == 0': is not true. #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) #2 VectorGraphicsCodec.writeImage (package:vector_graphics_codec/vector_graphics_codec.dart:771:12) #3 _encodeInstructions (package:vector_graphics_compiler/vector_graphics_compiler.dart:171:11) #4 encodeSvg (package:vector_graphics_compiler/vector_graphics_compiler.dart:142:10) #5 SvgLoader._load.<anonymous closure>.<anonymous closure> (package:flutter_svg/src/loaders.dart:137:14) #6 _testCompute (package:flutter_svg/src/utilities/compute.dart:12:38) #7 SvgLoader._load.<anonymous closure> (package:flutter_svg/src/loaders.dart:135:21) ``` --- Comment by @felipecastrosales on Aug 23, 2023 Hi, any expectation about this? --- Comment by @feinstein on Sep 6, 2023 FYI: I see my bottom navigator SVGs "blinking" when the main screen opens, the same behavior we see with asset images. My bet is not on this library's performance, but on the time that takes from assets to be retrieved from storage. I am on Flutter 3.10.7 and I can't see this on iOS, only on Android. --- Comment by @felipecastrosales on Sep 6, 2023 @feinstein Yesterday I also noticed this in my app, precisely in my bottom navigation - like you. In fact, in a part of my app I decided to migrate the assets to png and perform a precacheImage and the difference in performance was absurd - much better. --- Comment by @feinstein on Sep 6, 2023 There are other ways of solving this: 1 - Precache SVGs as described here. 2 - Create a dart file where each of your SVGs are a String. Since they will be part of your code, they don't need to be loaded from storage. 3 - Transform your SVGs into a font and use them as Icons (that's they way Flutter Icons work). --- Comment by @DanMossa on Dec 6, 2023 > You should not need to cache the .vec files. @dnfield I'm using the compiled `.vec` images and still experience a delay before the image renders ```dart SvgPicture(AssetBytesLoader("assets/logo_lights_large.svg.vec"), height: 50), ``` --- Comment by @eshfield on Dec 13, 2023 > Based on @hygehyge example I have implemented below in main before running app I have found a way to do the same without `AssetManifest.json` file: ``` Future<void> precacheSvgImages() async { final assetManifest = await AssetManifest.loadFromAssetBundle(rootBundle); final assets = assetManifest.listAssets(); // the same code below final svgPaths = assets.where((path) => path.endsWith('.svg')); for (final svgPath in svgPaths) { final loader = SvgAssetLoader(svgPath); await svg.cache .putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null)); } } ``` This function has to be called inside of `initState()` method of `MainApp` for example—it will not work in the `main()` before `runApp` started. --- Comment by @cedvdb on Feb 3, 2024 > There are other ways of solving this: > > 1 - Precache SVGs as described here. > > 2 - Create a dart file where each of your SVGs are a String. Since they will be part of your code, they don't need to be loaded from storage. > > 3 - Transform your SVGs into a font and use them as Icons (that's they way Flutter Icons work). For 3. I don't think fonts can have multiple colors can they ? For 2. That behavior is different for the web for multiple reasons --- Comment by @feinstein on Feb 4, 2024 Never tested it on the Web, could you elaborate more on why it doesn't work in the web? --- Comment by @cedvdb on Feb 4, 2024 assets are dwnloaded separately. Http2 parallelism and browser caching are some of the things you give up on the web by putting the svg inside your dart code. --- Comment by @feinstein on Feb 4, 2024 Good point, but unless you have lots of SVGs, or huge ones, this shouldn't be a problem in today's internet speeds, since SVGs are tiny.
package,p: flutter_svg
low
Critical
2,655,990,965
flutter
[flutter_svg] Resizing svgs
_Imported from https://github.com/dnfield/flutter_svg/issues/842_ Original report by @CodeDoctorDE on Feb 3, 2023 After upgrading to 2.0, the resize option is gone. I was using ```dart final picture = svgRoot!.toPicture(size: size); canvas.drawPicture(picture); ``` I'm using the flutter canvas
package,p: flutter_svg
low
Minor
2,655,991,079
flutter
[flutter_svg] Simple svg not rendered properly on mobile browsers
_Imported from https://github.com/dnfield/flutter_svg/issues/845_ Original report by @ferraridamiano on Feb 8, 2023 I just added `flutter_svg 2.0.0+1` to my app with the optimization of `vector_graphics_compiler`. The icons are properly rendered on all the platform (even on the Web) but not on mobile browsers (I tried chrome for android and firefox for android). Maybe it is an issue with the flutter html renderer. <details> <summary>Example images (on the right the expected result</summary> ![-2147483648_-211234](https://user-images.githubusercontent.com/34270884/217465699-1b6a1226-3d81-404f-8f4a-2f43e3071b2c.jpg) ![-2147483648_-211236](https://user-images.githubusercontent.com/34270884/217465709-8f07056c-490c-4340-b790-9313ce41e197.jpg) </details> You can find all the icons [here](https://github.com/ferraridamiano/ConverterNOW/tree/master/assets/property_icons) And you can see the web app with the issue [here](https://converter-now.web.app) --- Comment by @dnfield on Feb 9, 2023 The more I look at bugs like this the more I think we should just be injecting the SVG if we're on the HTML backend. But it always turns out to be harder than I think it should be. I'm going to see if we can do it again.
package,p: flutter_svg
low
Critical
2,655,991,345
flutter
[flutter_svg] After methods deprecation, how can I convert SVG to the bitmap without Widget?
_Imported from https://github.com/dnfield/flutter_svg/issues/858_ Original report by @arsenioo on Feb 12, 2023 Hello, For versions 1.1.6 and below I used the following code to convert SVG to Image: ``` final root = await svg.fromSvgString(...); final picture = root.toPicture(size: size); final image = await picture.toImage(...); ``` Now this approach is deprecated, but I still need to get a bitmap from SVG bypassing Widget. Any idea how to accomplish this? Thank you! --- Comment by @dnfield on Feb 13, 2023 Looks like this got lost in the readme updates. I'll add it back. In the mean time here is a code snippet that should work: ``` final pictureInfo = await vg.loadPicture(SvgStringLoader(...); final image = await pictureInfo.picture.toImage(...); ``` --- Comment by @arsenioo on Feb 13, 2023 Thank you very much for the prompt response, now it works! Although I still have some issues when I switch from 1.1.6 to 2.0.1 which disappear when switch back, I'm still not ready to blame flutter_svg in this, it is probably my bug. If not, I'll reopen this issue with further details o create a new one. --- Comment by @arsenioo on Feb 14, 2023 A quick follow up. In order to render SVG into destination bitmap dimensions I had to write the following code: ``` final ui.PictureRecorder recorder = ui.PictureRecorder(); final ui.Canvas canvas = ui.Canvas(recorder); canvas.scale(dstWidth / pictureInfo.size.width, dstHeight / pictureInfo.size.height); canvas.drawPicture(pictureInfo.picture); final ui.Picture scaledPicture = recorder.endRecording(); final image = await scaledPicture.toImage(dstWidth, dstHeight); ``` Is there any chance to avoid this intermediate step and get the desired picture size after loadPicture? If not, may be it would be worthful to make some public method for this or additional Size parameter? Just because SVG -> scale -> bitmap case is something essential and the "scale" part should not lead to reinvent the wheel :) Actually, that's why my code worked fine in 1.1.6, so for 2.x it is also a question of the backward compatibility. Thank you! --- Comment by @NachiketaVadera on Feb 16, 2023 This works but would love to get `fromSvgString` back --- Comment by @androidseb on Feb 25, 2023 > A quick follow up. In order to render SVG into destination bitmap dimensions I had to write the following code: > > ``` > final ui.PictureRecorder recorder = ui.PictureRecorder(); > final ui.Canvas canvas = ui.Canvas(recorder); > > canvas.scale(dstWidth / pictureInfo.size.width, dstHeight / pictureInfo.size.height); > canvas.drawPicture(pictureInfo.picture); > final ui.Picture scaledPicture = recorder.endRecording(); > > final image = await scaledPicture.toImage(dstWidth, dstHeight); > ``` This only really "works" if you're scaling down your SVG image, but if you're looking to scale it up, you will lose quality and your picture will become pixelated. I have not found a way to achieve this without quality loss at this time... It seems like the only way to achieve this would be with a library change, maybe adding a `size` parameter to the `SvgStringLoader` object constructor? Something like this: ```dart SvgStringLoader('<xml... </xml>', size: Size(500,500)) ``` or ```dart final pictureInfo = await vg.loadPicture(SvgStringLoader(...), size: Size(500,500)); ``` Or maybe it is possible through some other way that I have not found? Anybody found a way to achieve this without losing picture quality when scaling up the SVG image? --- Comment by @revever on Feb 25, 2023 > I'll add it back. In the mean time here is a code snippet that should work: > > ``` > final pictureInfo = await vg.loadPicture(SvgStringLoader(...); > final image = await pictureInfo.picture.toImage(...); > ``` If the original svg view is too large, the generatd image may take a lot of memory. It will be nice to have a size option when loading the picture. --- Comment by @sgehrman on Feb 27, 2023 same issue. why isn't it simple to convert an svg to an image with a size? Do we have to edit the svg to fix the size? --- Comment by @sgehrman on Feb 27, 2023 jovial_svg works well: ``` import 'package:jovial_svg/jovial_svg.dart'; static Future<Uint8List> svgToPng({ required String svg, ui.Size? scaleTo, }) async { try { final ScalableImage si = ScalableImage.fromSvgString(svg); await si.prepareImages(); final vpSize = si.viewport; final recorder = ui.PictureRecorder(); final ui.Canvas c = ui.Canvas(recorder); if (scaleTo != null) { c.scale(scaleTo.width / vpSize.width, scaleTo.height / vpSize.height); } si.paint(c); si.unprepareImages(); final size = scaleTo ?? ui.Size(vpSize.width, vpSize.height); final ui.Picture pict = recorder.endRecording(); final ui.Image rendered = await pict.toImage(size.width.round(), size.height.round()); final ByteData? bd = await rendered.toByteData( format: ui.ImageByteFormat.png, ); pict.dispose(); rendered.dispose(); if (bd != null) { return bd.buffer.asUint8List(); } } catch (err) { print('svgToPngBytes: Error = $err'); } return Uint8List(0); } ``` --- Comment by @NachiketaVadera on Mar 20, 2023 Also, `vg.loadPicture` seems to require build context. Is there any reason why we can have fromSvgString back in? --- Comment by @dnfield on Mar 20, 2023 > Also, `vg.loadPicture` seems to require build context. Is there any reason why we can have fromSvgString back in? Build context is nullable. --- Comment by @FaFre on Jun 2, 2023 > > A quick follow up. In order to render SVG into destination bitmap dimensions I had to write the following code: > > ``` > > final ui.PictureRecorder recorder = ui.PictureRecorder(); > > final ui.Canvas canvas = ui.Canvas(recorder); > > > > canvas.scale(dstWidth / pictureInfo.size.width, dstHeight / pictureInfo.size.height); > > canvas.drawPicture(pictureInfo.picture); > > final ui.Picture scaledPicture = recorder.endRecording(); > > > > final image = await scaledPicture.toImage(dstWidth, dstHeight); > > ``` > > This only really "works" if you're scaling down your SVG image, but if you're looking to scale it up, you will lose quality and your picture will become pixelated. I have not found a way to achieve this without quality loss at this time... > > It seems like the only way to achieve this would be with a library change, maybe adding a `size` parameter to the `SvgStringLoader` object constructor? Something like this: > > ```dart > SvgStringLoader('<xml... </xml>', size: Size(500,500)) > ``` > > or > > ```dart > final pictureInfo = await vg.loadPicture(SvgStringLoader(...), size: Size(500,500)); > ``` > > Or maybe it is possible through some other way that I have not found? Anybody found a way to achieve this without losing picture quality when scaling up the SVG image? I was assuming the same, but I found out this is not the case. Taken this SVG icon with the "size" of 24x24: ```svg <svg xmlns="http://www.w3.org/2000/svg" id="mdi-ab-testing" viewBox="0 0 24 24"><path d="M4 2A2 2 0 0 0 2 4V12H4V8H6V12H8V4A2 2 0 0 0 6 2H4M4 4H6V6H4M22 15.5V14A2 2 0 0 0 20 12H16V22H20A2 2 0 0 0 22 20V18.5A1.54 1.54 0 0 0 20.5 17A1.54 1.54 0 0 0 22 15.5M20 20H18V18H20V20M20 16H18V14H20M5.79 21.61L4.21 20.39L18.21 2.39L19.79 3.61Z" /></svg> ``` Scaled up to 512x512: ```dart canvas.scale(512 / pic.size.width, 512 / pic.size.height); canvas.drawPicture(pic.picture); ``` Produces following sharp picture: ![test](https://github.com/dnfield/flutter_svg/assets/59543085/064b69ca-db00-434b-87ff-ea77bf584beb) So scaling the canvas seems perfectly valid and the right thing to do. Probably the Viewport Size is just for the SVG internal commands that also must be in a certain coordinate space, but doesn't apply to the actual SVG since this will be always salable through its vectors. --- Comment by @androidseb on Oct 2, 2023 I struggled to get this working, but @FaFre's response helped me figure it out. I'll post my full code sample here in case it helps - I wanted to convert an SVG string to PNG bytes, but you can adapt the code and grab intermediary results to suit your needs: ```dart // With the following imports: // import 'dart:typed_data'; // import 'dart:ui' as ui; // import 'package:flutter/widgets.dart'; // import 'package:flutter_svg/flutter_svg.dart'; Future<Uint8List> svgStringToPngBytes( // The SVG string String svgStringContent, // The target width of the output image double targetWidth, // The target height of the output image double targetHeight, ) async { final SvgStringLoader svgStringLoader = SvgStringLoader(svgStringContent); final PictureInfo pictureInfo = await vg.loadPicture(svgStringLoader, null); final ui.Picture picture = pictureInfo.picture; final ui.PictureRecorder recorder = ui.PictureRecorder(); final ui.Canvas canvas = Canvas(recorder, Rect.fromPoints(Offset.zero, Offset(targetWidth, targetHeight))); canvas.scale(targetWidth / pictureInfo.size.width, targetHeight / pictureInfo.size.height); canvas.drawPicture(picture); final ui.Image imgByteData = await recorder.endRecording().toImage(targetWidth.ceil(), targetHeight.ceil()); final ByteData? bytesData = await imgByteData.toByteData(format: ui.ImageByteFormat.png); final Uint8List imageData = bytesData?.buffer.asUint8List() ?? Uint8List(0); pictureInfo.picture.dispose(); return imageData; } ``` We get a nicely non-pixelated vector-scaled PNG image out of this, even if the SVG image was smaller than the specified target size. As mentioned in the 2.0.0 release notes, from what I can see (note it's specific to my setup), the performance has improved significantly: I've benchmarked running that specific function 1000 times on a specific image in debug mode, and what used to take 2 seconds now takes about 1.5 seconds. I've created a PR to improve the documentation and help people find how to scale the SVG images [here](https://github.com/dnfield/flutter_svg/pull/991). I'm hopeful that with this clarification, we could resolve/close this issue... I hope this helps!
package,p: flutter_svg
low
Critical
2,655,991,611
flutter
[flutter_svg] Strange appearances and disappearances of SVG pattern-filled elements
_Imported from https://github.com/dnfield/flutter_svg/issues/859_ Original report by @virtualzeta on Feb 13, 2023 HI, I notice some instability in fill or stroke SVG with patterns. After countless tests I have reduced the problem to the bone. Earlier I thought that using multiple patterns creates problems since even using only one strange things happen. In the example below I'm interested in filling the last shape, but if I don't put something else first it won't let me do it. So for testing I put circles. Try removing one or two magic circles and refreshing a few times (try both hot reloading and not) and the item I want to fill will disappear as unfilled. Now I'm doing the circles example, but sometimes it's enough for me to make a change to the code (not necessarily SVG but DART) and it disappears, then reappears. Then you think you have to go eat and put the pot on the stove and it disappears, but you take it off the stove and it reappears. See for yourself with this simple code and let me know. I'm in debug mode but I've tried with release version too. ``` import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Container( color: Colors.white, child: Stack( children: <Widget>[ SizedBox( width: 221.0, height: 305.0, child: SvgPicture.string( testCode, allowDrawingOutsideViewBox: true, ), ), ], ), ), ); } } const String testCode = '<svg viewBox="0.0 0.0 200.0 200.0" ><defs><pattern id="test" patternUnits="userSpaceOnUse" x="0.0" y="0.0" width="200.0" height="80.0" viewBox="0.00000 0.00000 200.00000 80.00000"><rect width="300" height="100" fill="#123456"/></pattern></defs><circle cx="40" cy="0" r="30" fill="url(#test)"/><circle cx="100" cy="0" r="30" fill="url(#test)"/><path transform="translate(203.86, -507.37)" d="M -88.59816741943359 815.8993530273438 C -145.8555908203125 726.7476806640625 -145.19189453125 726.8890380859375 -144.5281524658203 726.8890380859375 L 10.64076614379883 718.7666015625 L 18.28900909423828 764.06298828125 L -88.59816741943359 815.8993530273438 Z" fill="url(#test)" stroke="none" stroke-width="1" stroke-miterlimit="10" stroke-linecap="butt" /></svg>'; ``` Thank you. current environment Flutter_svg 2.0.0+1 Flutter SDK 3.8.0-10.0.pre.13 Dart SDK 3.0.0-218.0.dev (Flutter) --- Comment by @dnfield on Feb 13, 2023 I'm not sure I understand what the bug you're reporting is. I ran the sample project and it seems to render? --- Comment by @virtualzeta on Feb 13, 2023 > I'm not sure I understand what the bug you're reporting is. I ran the sample project and it seems to render? Well, if you used the example code it's possible that it rendered because, as I said, I made sure that by adding elements (circles) the filling of the last element was done. I don't know why this happens but after many tests I have seen that doing so works. However, I asked to test by removing a circle from the SVG code and reloading. And maybe even remove the other one because I'm not interested in them and they're the only way I've found to fix the situation but which obviously can't be solved like this. If you have the same result that I get you will see that the last element (ie the one that should be the useful one) is not filled and disappears. **This is what I see if I start debugging using the code with the three elements (the two circles and a shape) and restarting with hot restart (not hot reload).** ![Screenshot_1676334591](https://user-images.githubusercontent.com/74735878/218607009-71386939-3912-45f5-83c3-13acf9c3f98a.png) **This is what I see if I start debugging using the code with the two elements (I took off the second circle and kept the shape I REALLY care about filling even though all elements have the same filling) and restarting with hot restart (not hot reload). The shape is gone, yet it's there and if I fill it with a color code WITHOUT using the pattern as a fill I see it just fine with or without circles or other elements.** ![Screenshot_1676334611](https://user-images.githubusercontent.com/74735878/218608241-2acc9e99-538e-40d5-81aa-88b24e57a73d.png) In other circumstances if I use hot relaod then it appears (but not in this example). I add that even doing so many times when loading the page in filling it is still not executed except after a hot reload (which obviously I do only for testing). So for now I have this unstable behavior. I prepared the example code just to get out of my app and avoid having doubts about dependencies that could create problems. In the meantime I also switched to the stable channel from the master but still the same happens to me. Sounds like a cache and/or load times issue. I also tried with your new 2.0.1 version but it's the same. The upload in debug mode without the isolates is much better. :-) I don't know why it happens and that's why I'm bothering you. I hope that I can carry out the operations that I recommended to find the problem. Thanks.
package,p: flutter_svg
low
Critical
2,655,991,722
flutter
[flutter_svg] BoxFit.cover does not work
_Imported from https://github.com/dnfield/flutter_svg/issues/867_ Original report by @drmilde on Feb 19, 2023 In 1.16 BoxFit.cover worked ok, now a small white border on the left and right side is shown. --- Comment by @dnfield on Feb 21, 2023 Please share a reproduction.
package,p: flutter_svg
low
Minor
2,656,004,205
flutter
[flutter_svg] svg <marker> not work?
_Imported from https://github.com/dnfield/flutter_svg/issues/871_ Original report by @jzhgithub18 on Feb 27, 2023 --- Comment by @jzhgithub18 on Feb 27, 2023 my svg: `<svg viewBox="0 0 720 1280" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <marker id="/rc/defs/arrowStyle" zorder="1" markerWidth="5" markerHeight="5" markerUnits="strokeWidth" refX="50" refY="50" viewBox="0 0 100 100" orient="auto"> <path id="/rc/defs/arrowStyle/1" zorder="1" d="M100 50L0 90L30 50L0 10L100 50Z"/> </marker> </defs> <rect xmlns="http://www.w3.org/2000/svg" width="720" height="1280" fill="#FF9900" rx="4" ry="4"/> <line id="/1/1677122352_1@aragorn@令狐冲" zorder="1" stroke="black" stroke-width="3" x1="320" y1="657.60004" x2="431.29999" y2="1063.4" marker-end="url(#/rc/defs/arrowStyle)"/> <path id="/rc/1" zorder="1" d="M100 50L0 90L30 50L0 10L100 50Z"/> <line x1="0" y1="0" x2="250" y2="50" stroke="#000" stroke-width="8" marker-end="url(#/rc/defs/arrowStyle)" /> <text x="60" y="15" style='font-family:sans-serif;font-size: 14pt; stroke:none; fill: black; '>令狐冲</text> </svg>` **expect:** ![image](https://user-images.githubusercontent.com/112080579/221516916-477cfaf7-34c6-49b1-be5f-0e13b29db448.png) present: ![image](https://user-images.githubusercontent.com/112080579/221518199-e0909241-b0c7-4585-8b58-cc7d3409296d.png) --- Comment by @dnfield on Feb 27, 2023 It is not implemented in this library. I'm open to it but don't get this request all that often. --- Comment by @Zeebzog on Oct 5, 2023 Hi, The library is great, but I also need marker-end implemented. The below fails to draw the arrow head as well. `<svg width="2788" height="1232" viewBox="0 -1232 2788 1232" xmlns="http://www.w3.org/2000/svg"><marker id="arrow" refX="1" refY="5" markerWidth="4" markerHeight="4" viewBox="0 0 10 10" orient="auto" ><path d="M 0 0 L 10 5 L 0 10 z" fill="black" /></marker><line x1="104" y1="-225" x2="164" y2="-225" stroke="black" stroke-width="2" marker-end="url(#arrow)" /></svg>` Thank you.
package,p: flutter_svg
low
Minor
2,656,004,409
flutter
[flutter_svg] Support objectBoundingBox units in patterns
_Imported from https://github.com/dnfield/flutter_svg/issues/882_ Original report by @bharat8 on Mar 14, 2023 Svg is not rendering properly. Always gives an error like :- `Failed to find definition for url(#pattern0)` Have tried moving up the <defs> at the top but still no luck. Don't know if doing something wrong as i have little experience with svg's. Here is the svg file i am trying to render [Svg File](https://gist.github.com/bharat8/19ba7975dcd6c5614d48fee7fb3b8d6b?short_path=f8c067c) Any help will be much appreciated. Thank you! --- Comment by @dnfield on Mar 14, 2023 I believe the problem is it's using `objectBoundingBox` for the pattern units, which isn't yet supported. --- Comment by @dnfield on Mar 14, 2023 Supporting that is on my list of things to do but it's not super high priority at the moment and I'm not sure when I'll get to it. --- Comment by @Joseph-Nathan on May 20, 2023 @dnfield is there way to fix this on my own ?
package,P3,p: flutter_svg
low
Critical
2,656,004,529
flutter
[flutter_svg] Support `mask-type:alpha`
_Imported from https://github.com/dnfield/flutter_svg/issues/886_ Original report by @hashirshoaeb on Mar 15, 2023 Desired Output: In mac preview and google chrome it is visible like this. <img width="129" alt="Screenshot 2023-03-15 at 6 28 28 PM" src="https://user-images.githubusercontent.com/35165481/225322902-4f031f25-c2c9-4bb0-a4f8-7169d215c780.png"> package output: ![Screenshot 2023-03-15 at 6 29 11 PM](https://user-images.githubusercontent.com/35165481/225323122-efecd127-0f19-4d1a-9267-667a16b50e66.png) svg file: ``` <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="paint0_linear_2747_23934" x1="8.125" y1="5" x2="36.25" y2="26.25" gradientUnits="userSpaceOnUse"> <stop stop-color="#EEBF6D" stop-opacity="0.64"/> <stop offset="1" stop-color="#EBB04A" stop-opacity="0.8"/> </linearGradient> </defs> <circle cx="20" cy="20" r="20" fill="url(#paint0_linear_2747_23934)"/> <mask id="mask0_2747_23934" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="12" y="12" width="20" height="16"> <path d="M30.3275 22.9176C30.3275 25.2189 28.4621 27.0843 26.1608 27.0843C25.415 27.0843 24.7141 26.8885 24.1083 26.5447C23.4667 26.1811 22.933 25.6538 22.5616 25.0166C22.1902 24.3794 21.9944 23.6552 21.9941 22.9176C21.9941 21.8476 22.3975 20.8718 23.06 20.1343C23.4503 19.6985 23.9283 19.3499 24.4627 19.1116C24.997 18.8732 25.5757 18.7503 26.1608 18.751C28.4621 18.751 30.3275 20.6164 30.3275 22.9176Z" fill="white" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M26.1641 15.001V18.751C25.579 18.7503 25.0003 18.8732 24.4659 19.1116C23.9316 19.3499 23.4536 19.6985 23.0632 20.1343C22.3757 20.8982 21.9959 21.8899 21.9974 22.9176C21.9976 23.6552 22.1934 24.3794 22.5648 25.0166C22.9362 25.6538 23.4699 26.1811 24.1116 26.5447C23.0024 26.8801 21.5299 27.0843 19.9141 27.0843C16.4624 27.0843 13.6641 26.1514 13.6641 25.001V15.001" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M26.1641 15.0003C26.1641 16.1507 23.3657 17.0837 19.9141 17.0837C16.4624 17.0837 13.6641 16.1507 13.6641 15.0003C13.6641 13.8499 16.4624 12.917 19.9141 12.917C23.3657 12.917 26.1641 13.8499 26.1641 15.0003Z" fill="white" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M13.6641 21.6668C13.6641 22.8172 16.4624 23.7502 19.9141 23.7502C20.667 23.7502 21.3891 23.706 22.0574 23.6243M13.6641 18.3335C13.6641 19.4839 16.4624 20.4168 19.9141 20.4168C21.0624 20.4168 22.1386 20.3135 23.0632 20.1335" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M27.8307 22.9176H26.1641V21.251" stroke="black" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> </mask> <g mask="url(#mask0_2747_23934)"> <path d="M12 10H32V30H12V10Z" fill="white"/> </g> </svg> ``` --- Comment by @dnfield on Mar 15, 2023 This is a bug in the mask optimizer. --- Comment by @dnfield on Mar 15, 2023 Hm. Maybe it is not a bug in the masking optimizer, but it is a bug in mask handling... --- Comment by @dnfield on Mar 15, 2023 Yeah, the `mask-type` is not being processed correctly in this library. --- Comment by @dnfield on Mar 15, 2023 This needs a bit of thinking about how to properly apply masks that I'm not going to have time for soon. I'm open to a PR to fix this, but you can also temporarily work around it by removing the last path in your mask (which doesn't contribute to drawing in this case). --- Comment by @dnfield on Mar 15, 2023 ```svg <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="paint0_linear_2747_23934" x1="8.125" y1="5" x2="36.25" y2="26.25" gradientUnits="userSpaceOnUse"> <stop stop-color="#EEBF6D" stop-opacity="0.64"/> <stop offset="1" stop-color="#EBB04A" stop-opacity="0.8"/> </linearGradient> </defs> <circle cx="20" cy="20" r="20" fill="url(#paint0_linear_2747_23934)"/> <mask id="mask0_2747_23934" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="12" y="12" width="20" height="16"> <path d="M30.3275 22.9176C30.3275 25.2189 28.4621 27.0843 26.1608 27.0843C25.415 27.0843 24.7141 26.8885 24.1083 26.5447C23.4667 26.1811 22.933 25.6538 22.5616 25.0166C22.1902 24.3794 21.9944 23.6552 21.9941 22.9176C21.9941 21.8476 22.3975 20.8718 23.06 20.1343C23.4503 19.6985 23.9283 19.3499 24.4627 19.1116C24.997 18.8732 25.5757 18.7503 26.1608 18.751C28.4621 18.751 30.3275 20.6164 30.3275 22.9176Z" fill="white" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M26.1641 15.001V18.751C25.579 18.7503 25.0003 18.8732 24.4659 19.1116C23.9316 19.3499 23.4536 19.6985 23.0632 20.1343C22.3757 20.8982 21.9959 21.8899 21.9974 22.9176C21.9976 23.6552 22.1934 24.3794 22.5648 25.0166C22.9362 25.6538 23.4699 26.1811 24.1116 26.5447C23.0024 26.8801 21.5299 27.0843 19.9141 27.0843C16.4624 27.0843 13.6641 26.1514 13.6641 25.001V15.001" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M26.1641 15.0003C26.1641 16.1507 23.3657 17.0837 19.9141 17.0837C16.4624 17.0837 13.6641 16.1507 13.6641 15.0003C13.6641 13.8499 16.4624 12.917 19.9141 12.917C23.3657 12.917 26.1641 13.8499 26.1641 15.0003Z" fill="white" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M13.6641 21.6668C13.6641 22.8172 16.4624 23.7502 19.9141 23.7502C20.667 23.7502 21.3891 23.706 22.0574 23.6243M13.6641 18.3335C13.6641 19.4839 16.4624 20.4168 19.9141 20.4168C21.0624 20.4168 22.1386 20.3135 23.0632 20.1335" stroke="white" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> </mask> <g mask="url(#mask0_2747_23934)"> <path d="M12 10H32V30H12V10Z" fill="white"/> </g> </svg> ```
package,P3,p: flutter_svg
low
Critical
2,656,004,656
flutter
[flutter_svg] Stroke opacity not applied
_Imported from https://github.com/dnfield/flutter_svg/issues/891_ Original report by @Maatteogekko on Mar 17, 2023 Take this svg as an example ```svg <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path fill="#293540" stroke="#293540" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19 21-7-5-7 5V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v16Z" /> </svg> ``` I am using the color mapper API to remap colors like this: ```dart class _ColorMapper implements ColorMapper { const _ColorMapper({ required this.baseColor, }); static const _rawBaseColor = Color(0xFF293540); final Color baseColor; @override Color substitute(String? id, String elementName, String attributeName, Color color) { if (color == _rawBaseColor) return baseColor; return color; } } // --- SvgPicture( SvgStringLoader( icon, colorMapper: _ColorMapper( baseColor: iconColor, ), ), ); ``` If I use a color with opacity != 1, let's say `iconColor = Color(0x802260DD)` as the base color, only the fill gets the opacity applied; the stroke remains fully opaque. Maybe related to https://github.com/dnfield/flutter_svg/issues/617 --- Comment by @dnfield on Mar 17, 2023 Yeah, there's a bug here for sure. Taking a look. --- Comment by @dnfield on Mar 17, 2023 Ok. So I can definitely fix the whole "stroke opacity is getting ignored" part, but be aware that strokes and fills get composited individually and the opacity will be multiplicative - so your case will be something like this SVG: ```svg <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path fill="#293540" stroke="#293540" fill-opacity=".5" stroke-opacity=".5" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19 21-7-5-7 5V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v16Z" /> </svg> ``` Which will not look like a single uniform color. --- Comment by @Maatteogekko on Mar 18, 2023 You're right. To get a uniform color I tried with this: ```svg <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path fill="#293540" stroke="#293540" opacity=".5" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19 21-7-5-7 5V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v16Z" /> </svg> ``` But it still doesn't render correctly. I guess it's the same problem? --- Comment by @dnfield on Mar 19, 2023 If you want it uniform just remove the stroke attribute(s) --- Comment by @devmaslove on Oct 18, 2023 I have the same problem. In svg file: stroke="currentColor" If I set currentColor with opacity - ```dart theme: SvgTheme( currentColor: Colors.white.withOpacity(0.5), ), ``` opacity is ignored
package,P3,p: flutter_svg
low
Critical
2,656,004,781
flutter
[flutter_svg] Why the ! operator on message in provideSvg?
_Imported from https://github.com/dnfield/flutter_svg/issues/893_ Original report by @Albert221 on Mar 20, 2023 Hi! I created my own `SvgNetworkLoader` extending it. In overriden `prepareMessage` I return `null` on some network failures, as the return type was `Future<Uint8List?>`. But looks like returning null is illegal here, because in `loaders.dart:361` the library uses `!` on it: ```dart String provideSvg(Uint8List? message) => utf8.decode(message!); ``` Which results in an unhandled exception. I propose to either change return type of `prepareMessage` or handle nulls there. --- Comment by @dnfield on Mar 20, 2023 Agreed this is a problem. Probably related to #250
package,P3,p: flutter_svg
low
Critical
2,656,004,935
flutter
[flutter_svg] Invalid double 4mm
_Imported from https://github.com/dnfield/flutter_svg/issues/906_ Original report by @djpnewton on Apr 18, 2023 SvgPicture is generating a FormatException on a basic svg generated by a python QR code to SVG library ``` ════════ Exception caught by widgets library ═══════════════════════════════════ Invalid double 4mm The relevant error-causing widget was SvgPicture security.dart:83 ════════════════════════════════════════════════════════════════════════════════ ``` --- Comment by @Jyoshnarani on May 1, 2023 Facing same issue FormatException: Invalid double 100% --- Comment by @Jyoshnarani on May 1, 2023 > Facing same issue > > FormatException: Invalid double > > > 100% This issue is resolved for me. There is a problem in the image. Issues are on the server side. So try with another image and it's worked. --- Comment by @djpnewton on May 2, 2023 > There is a problem in the image. > Issues are on the server side. > So try with another image and it's worked. I dont understand what you mean? --- Comment by @Jyoshnarani on Jun 23, 2023 The server didn't accept double the value for a key in input body --- Comment by @shanelau on Oct 23, 2023 it works on vector_graphics_compiler: 1.1.7 but throw error on 1.1.9 ``` Invalid double 4e ``` --- Comment by @Jyoshnarani on Oct 27, 2023 For Me its worked when I allowed from server. Any way Its working so we can close this.
package,P3,p: flutter_svg
low
Critical
2,656,021,550
excalidraw
Bug: Local storage overflow fails silently, without letting the user know
Nobody is probably using the app this way, but I was playing around and noticed that if I paste in too many items, local storage gets overflowed. It's not obvious because the error is in the console. ![Image](https://github.com/user-attachments/assets/c5c66200-6594-4cbd-830d-5148e352ca27)
bug
low
Critical
2,656,027,570
deno
deno task wrongly assume npm: imports are installed globally
Version: Deno 1.43.6 OS: Linux Mint 20 I have a custom `esbuild` command made of a `esbuild.js` script installed globally by deno. It worked well until I switched its import of esbuild from `https://deno.land/x/esbuild@v0.19.8/mod.js` to `npm:esbuild@0.20.2`. Now the associated task that is using the global command `esbuild` is launching esbuild as it was installed globally by a `npm install -g esbuild` instead of my custom command. Note that a `which esbuild` is still pointing to my custom script. The error happen only in the task's command. $HOME/dev/esbuild.js ```js // import * as esbuild from 'https://deno.land/x/esbuild@v0.19.8/mod.js' import * as esbuild from 'npm:esbuild@0.20.2' // ... my custom code here, loading .yaml configs ``` deno.jsonc ```json { "tasks": { "watch": "esbuild watch esbuild-config.yaml ui-esbuild-config.yaml" } } ``` ```bash $ which esbuild $HOME/.deno/bin/esbuild $ nano $HOME/.deno/bin/esbuild ``` $HOME/.deno/bin/esbuild ```sh #!/bin/sh # generated by deno install exec deno run --allow-read --allow-write --allow-net --allow-env --allow-run --no-config '$HOME/dev/esbuild.js' "$@" ``` # The error ```bash $ deno task watch Task watch esbuild watch esbuild-config.yaml ui-esbuild-config.yaml ✘ [ERROR] Must use "outdir" when there are multiple input files 1 error error: Uncaught Error: Command failed: $HOME/.cache/deno/npm/registry.npmjs.org/@esbuild/linux-x64/0.20.2/bin/esbuild watch esbuild-config.yaml ui-esbuild-config.yaml ``` The error shows the npm's bin script is resolved instead of the actual system wide command...
bug,needs investigation,task runner
low
Critical
2,656,033,772
ant-design
Luxon DatePicker wrapper mixes timezones for different input interactions
### Reproduction link [https://github.com/juanma-rodriguez-nazaries/antd-timepicker-luxon-timezone](https://github.com/juanma-rodriguez-nazaries/antd-timepicker-luxon-timezone) ### Steps to reproduce 1. Clone the repository 2. Run `pnpm install` 3. Run `pnpm run dev` 4. Open the browser and go to `http://localhost:5173/` 5. Open the console and check the logs 6. Try to change the first time input using the keyboard and press Tab to jump to the next input 7. Try to change the second time input using the mouse and select the time from the dropdown and press OK 8. Check the logs and see the difference in the timezone set (submit is optional) ### What is expected? The goal is to have the TimePicker always set the timezone from the Luxon config, regardless of the input method. ### What is actually happening? ## Issue History When using keyboard typing input on the Ant Design TimePicker, the timezone is set from locale time. When using the mouse and selecting the time from the dropdown, the timezone is set from the Luxon config. ### **Update** After updating the antd, rc-picker and luxon versions, the issue is still present, but it's reversed. Now, when using keyboard typing input on the Ant Design TimePicker, the timezone is set from the Luxon config. When using the mouse and selecting the time from the dropdown, the timezone is set from locale time. | Environment | Info | | --- | --- | | antd | 5.22.1 | | React | ^18.3.1 | | System | Windows 11 | | Browser | Chrome 131.0.6778.69 | --- I've been trying to find a workaround for this closed issue: https://github.com/ant-design/ant-design/issues/51301 It's been suggested to use the `getNow: () => DateTime.now()` function as a workaround, but after testing it seems that the only workaround it's to redefine both the `getNow` and `parse` functions of the config to be able to have the same behavior on both interactions with the input. I've been struggling with this input for a while because I need to compare the selected times and I get inconsistent behavior for the timezone when using the date values from a `react-hook-form`. I think the config wrapper should keep track of the timezone properly in all scenarios for input values, which does not seem to be the case. I am using a form to submit and validate the values to replicate my scenario, however, checking the `onChange` callbacks, even if forcing the DateTime instantiation with Luxon the issue is still present. Following the trace up to the `DatePicker.generatePicker` settings wrapper, I stepped on a workaround that might point towards a fix for this issue: ```typescript const LuxonDatePicker = DatePicker.generatePicker<DateTime>({ ...luxonGenerateConfig, // Uncomment to make both interactions work properly, if missing, only typing the time will work // getNow: () => DateTime.now(), locale: { ...luxonGenerateConfig.locale, parse: (locale: string, text: string, formats: string[]) => { console.log("parse", DateTime.fromFormat(text, formats[0], { locale }).toISO()); // This prints the settings timezone console.log("defaultParse", luxonGenerateConfig.locale.parse(locale, text, formats)?.toISO()); // This prints local timezone return DateTime.fromFormat(text, formats[0], { locale }); }, } }); ``` Please check this traces of my reproduction: #### Logs sample ``` parse 2024-11-13T14:14:00.000-05:00 defaultParse 2024-11-13T14:14:00.000+01:00 onCalendarChange - Manual Type - 2024-11-13T14:14:00.000-05:00 America/New_York OnChange - Manual Type - 2024-11-13T14:14:00.000-05:00 America/New_York OnCalendarChange - UI Select - 2024-11-13T01:00:00.000+01:00 Europe/Madrid OnCalendarChange - UI Select - 2024-11-13T01:04:00.000+01:00 Europe/Madrid OnChange - UI Select - 2024-11-13T01:04:00.000+01:00 Europe/Madrid ``` Thank you. Best regards, JuanMa <!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
help wanted,Inactive
low
Minor
2,656,036,727
pytorch
`skipIfXYZ` decorators will skip CPU tests as well
### 🐛 Describe the bug Noticed while looking at how `skipIfMPS` is used in common_modules: https://github.com/pytorch/pytorch/blob/3d618019fb5dd1ab20da5b468056a4830d86d323/torch/testing/_internal/common_modules.py#L3879-L3886 which looks like it skips it just for MPS, but actually just skips all testing if running on the device where MPS is available, since skipIfMPS is defined as https://github.com/pytorch/pytorch/blob/3d618019fb5dd1ab20da5b468056a4830d86d323/torch/testing/_internal/common_utils.py#L1860-L1867 And has `TEST_MPS` simply checks if device is there: https://github.com/pytorch/pytorch/blob/3d618019fb5dd1ab20da5b468056a4830d86d323/torch/testing/_internal/common_utils.py#L1405 ### Versions 2.5, CI
triaged,module: testing
low
Critical
2,656,052,877
PowerToys
Crop and lock: Reparent behaviour in seperate window
### Description of the new feature / enhancement Can this feature be extended to allow a separate cropped live window so the user can interact with the same content in two different parts of the screen? ### Scenario when this would be used? The larger main screen is displaying a full application, including all of its chrome. For example Blender3D. The user's second monitor, a smaller resolution Wacom tablet shows a portion of the same application: The part of the application window that benefits from pen input. The user can maximise the resolution on both displays by displaying chrome on one but not the other. It also allows mirroring the monitor in a logical way that doesn't waste pixel space. ### Supporting information _No response_
Needs-Triage
low
Minor
2,656,087,459
langchain
chat ollama with_structured_output fails with union type
### Privileged issue - [X] I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here. ### Issue Content ```python from typing import Union from langchain_ollama import ChatOllama llm = ChatOllama(model="llama3.1", temperature=0) # Pydantic class Joke(BaseModel): """Joke to tell user.""" setup: str = Field(description="The setup of the joke") punchline: str = Field(description="The punchline to the joke") rating: Optional[int] = Field( default=None, description="How funny the joke is, from 1 to 10" ) class ConversationalResponse(BaseModel): """Respond in a conversational manner. Be kind and helpful.""" response: str = Field(description="A conversational response to the user's query") class FinalResponse(BaseModel): final_output: Union[Joke, ConversationalResponse] structured_llm = llm.with_structured_output(FinalResponse) structured_llm.invoke("Tell me a joke about cats") ``` raise here: https://github.com/langchain-ai/langchain/pull/27415
Ɑ: core
low
Major
2,656,138,278
PowerToys
Monaco languages file includes multiple IDs with the same extension
### Microsoft PowerToys version 0.86 ### Installation method Dev build in Visual Studio ### Running as admin No ### Area(s) with issue? File Explorer: Preview Pane, Peek ### Steps to reproduce Please note: this is a minor issue, and I'm just reporting it to raise awareness and to include repro code so it may be tracked in the future. The `monaco_languages.json` file includes a mapping of file extensions to language IDs. This allows for syntax highlighting on a per-language basis. There exist 3 cases where the same file extension is present for multiple languages. This may result in incorrect syntax highlighting in one of those cases. The code to repro the issue is as follows: ``` csharp using System.Text.Json; string json = File.ReadAllText("monaco_languages.json"); using var jsonDoc = JsonDocument.Parse(json); var list = jsonDoc.RootElement.GetProperty("list"); foreach (var entry in list.EnumerateArray() .Where(item => item.TryGetProperty("id", out var _) && item.TryGetProperty("extensions", out var _)) .SelectMany(item => item.GetProperty("extensions").EnumerateArray() .Select(ext => new { Extension = ext.GetString(), Id = item.GetProperty("id").GetString() }) ).GroupBy(pair => pair.Extension) .Where(group => group.Count() > 1) .Select(group => new { Extension = group.Key, Ids = group.Select(x => x.Id) })) { Console.WriteLine($"Extension '{entry.Extension}' used by IDs {string.Join(", ", entry.Ids)}"); } ``` (Setup a new Console application with this code as `Program.cs` and also copy in the current `monaco_languages.json` file, setting that file to be copied to the output directory.) The results are: ``` Extension '.gitconfig' used by IDs ini, iniExt Extension '.pp' used by IDs pascal, ruby Extension '.csproj' used by IDs xml, xmlExt ``` The lookup for Monaco language matching in PowerToys will always pick the first match, so a file with a .pp extension will always be recognised as Pascal, even if it is a Puppet manifest file. (I assume the other 2 cases are OK, as the language IDs appear synonymous.) I'm unsure what the resolution for this is without doing file introspection. That's probably unreasonable, especially for a single case such as this. If it was decided to favour Puppet files over Pascal, the entry for Ruby should be moved before Pascal's in the file. ### ✔️ Expected Behavior Files for Pascal and Puppet manifest files should be recognised as distinct, and highlighted differently by Monaco. ### ❌ Actual Behavior As the files share the same extension, they cannot be distinguished from one another, and will always be rendered as Pascal. ### Other Software _No response_
Issue-Bug,Needs-Triage
low
Minor
2,656,170,604
pytorch
NCCL hangs cause timeout
### 🐛 Describe the bug I'm training a vqgan model and there is a forward operation which do allreduce across batch to get an estimation of the data distribution. It successfully ran for hours and hang in the allreduce operation. But it didn't throw any specific error. But still, the program will stuck after running for serveral hours at randomly batch. I cannot find out why. BTW, 1. it only occupies 10% GPU memory on each card thus it's impossible to oom 2. The data loading on each card is passed with no nan values before the stuck 3. Plus, I'm sure that the nvidia fabricmanager works fine without any error.' 4. I've check the ROCE network and do a long time nccl multi-node test on allreduce (by mpi) and everything looks just fine. NCCL env: ``` # nccl version: 22.3 NCCL_IB_TIMEOUT=11 \ NCCL_DEBUG=INFO \ NCCL_DEBUG_FILE=/data1/nccl_debug_%h.%p \ NCCL_IB_CUDA_SUPPORT=1 \ NCCL_IBEXT_DISABLE=1 \ NCCL_DEBUG_SUBSYS=ALL \ NCCL_IB_DISABLE=0 \ NCCL_NVLS_ENABLE=0 \ NCCL_IB_RETRY_CNT=7 \ GLOO_SOCKET_IFNAME=eth1x \ NCCL_SOCKET_IFNAME=eth1x \ NCCL_IB_HCA=mlx5_0:1,mlx5_1:1,mlx5_2:1,mlx5_3:1,mlx5_4:1,mlx5_5:1,mlx5_6:1,mlx5_7:1 \ NCCL_IB_GID_INDEX=3 \ TORCH_DISTRIBUTED_DEBUG=INFO \ ``` The related code: ```python from torch.distributed import nn as dist_nn # ...... # some model forward operations a = torch.Tensor(153,262144) # an intermediate float32 cuda tensor, which is used later on in calculate loss dist_nn.all_reduce(a) # this line hangs a /= dist.get_world_size() # some forward operations and backward ... ``` output: ``` container-node08: [rank50]:[E1113 16:25:40.598747947 ProcessGroupNCCL.cpp:1844] [PG ID 0 PG GUID 0(default_pg) Rank 50] Timeout at NCCL work: 3844095, last enqueued NCCL work: 3844106, last completed NCCL work: 3844094. container-node08: [rank50]:[E1113 16:25:40.598768762 ProcessGroupNCCL.cpp:630] [Rank 50] Some NCCL operations have failed or timed out. Due to the asynchronous nature of CUDA kernels, subsequent GPU operations might run on corrupted/incomplete data. container-node08: [rank50]:[E1113 16:25:40.598775081 ProcessGroupNCCL.cpp:636] [Rank 50] To avoid data inconsistency, we are taking the entire process down. container-node08: [rank50]:[E1113 16:25:40.600342730 ProcessGroupNCCL.cpp:1605] [PG ID 0 PG GUID 0(default_pg) Rank 50] Process group watchdog thread terminated with exception: [Rank 50] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3844095, OpType=ALLREDUCE, NumelIn=262144, NumelOut=262144, Timeout(ms)=600000) ran for 600034 milliseconds before timing out. container-node08: Exception raised from checkTimeout at /opt/pytorch/pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:618 (most recent call first): container-node08: frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x98 (0x7f5c421b30a8 in /usr/local/lib/python3.10/dist-packages/torch/lib/libc10.so) container-node08: frame #1: <unknown function> + 0x114308e (0x7f5c4336708e in /usr/local/lib/python3.10/dist-packages/torch/lib/libtorch_cuda.so) container-node08: frame #2: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x282 (0x7f5c4337cee2 in /usr/local/lib/python3.10/dist-packages/torch/lib/libtorch_cuda.so) container-node08: frame #3: c10d::ProcessGroupNCCL::watchdogHandler() + 0x24b (0x7f5c4338631b in /usr/local/lib/python3.10/dist-packages/torch/lib/libtorch_cuda.so) container-node08: frame #4: c10d::ProcessGroupNCCL::ncclCommWatchdog() + 0x14d (0x7f5c43387d7d in /usr/local/lib/python3.10/dist-packages/torch/lib/libtorch_cuda.so) container-node08: frame #5: <unknown function> + 0xdc253 (0x7f5c41cb0253 in /lib/x86_64-linux-gnu/libstdc++.so.6) container-node08: frame #6: <unknown function> + 0x94ac3 (0x7f5ca1ba9ac3 in /lib/x86_64-linux-gnu/libc.so.6) container-node08: frame #7: clone + 0x44 (0x7f5ca1c3aa04 in /lib/x86_64-linux-gnu/libc.so.6) container-node08: ``` ### Versions I use ngc pytroch docker, 24.10-py3: PyTorch version: 2.5.0a0+e000cf0ad9.nv24.10 Is debug build: False CUDA used to build PyTorch: 12.6 ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.5 LTS (x86_64) GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Clang version: Could not collect CMake version: version 3.30.4 Libc version: glibc-2.35 Python version: 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-5.15.0-88-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA H100 80GB HBM3 GPU 1: NVIDIA H100 80GB HBM3 GPU 2: NVIDIA H100 80GB HBM3 GPU 3: NVIDIA H100 80GB HBM3 GPU 4: NVIDIA H100 80GB HBM3 GPU 5: NVIDIA H100 80GB HBM3 GPU 6: NVIDIA H100 80GB HBM3 GPU 7: NVIDIA H100 80GB HBM3 Nvidia driver version: 550.90.12 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.5.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.5.0 HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 57 bits virtual Byte Order: Little Endian CPU(s): 224 On-line CPU(s) list: 0-223 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Platinum 8480+ CPU family: 6 Model: 143 Thread(s) per core: 2 Core(s) per socket: 56 Socket(s): 2 Stepping: 8 Frequency boost: enabled CPU max MHz: 2001.0000 CPU min MHz: 800.0000 BogoMIPS: 4000.00 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 5.3 MiB (112 instances) L1i cache: 3.5 MiB (112 instances) L2 cache: 224 MiB (112 instances) L3 cache: 210 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-55,112-167 NUMA node1 CPU(s): 56-111,168-223 Vulnerability Gather data sampling: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.24.4 [pip3] nvidia-cudnn-frontend==1.7.0 [pip3] nvidia-nccl-cu12==2.22.3 [pip3] nvtx==0.2.5 [pip3] onnx==1.16.2 [pip3] optree==0.13.0 [pip3] pynvjitlink==0.3.0 [pip3] pytorch-triton==3.0.0+dedb7bdf3 [pip3] torch==2.5.0a0+e000cf0ad9.nv24.10 [pip3] torch-fidelity==0.3.0 [pip3] torch_tensorrt==2.5.0a0 [pip3] torchmetrics==1.5.2 [pip3] torchprofile==0.0.4 [pip3] torchvision==0.20.0a0 cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o
oncall: distributed,triaged
medium
Critical
2,656,189,647
godot
Remote Tab - Instances are not removed when game window is not visible
### Tested versions Godot v4.4.dev (277cb68e1) ### System information Godot v4.4.dev (277cb68e1) - macOS 13.7.1 - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon Pro 580 - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 threads) ### Issue description I have the strange behavior, that instances seem to be removes as expected with queue_free() if the game window is visible. <img width="2048" alt="Game Window visible" src="https://github.com/user-attachments/assets/ca0a3b58-1342-4954-acda-fa1f97142e84"> But if the game window is out of focus for a while the instances are not removed (according to the remote tab). <img width="2048" alt="Game Window in the background" src="https://github.com/user-attachments/assets/25ccf837-ce9e-4cf7-b9c2-854a3da69043"> ### Steps to reproduce I've attached a project. First run it with the game window visible. In the remote tab all the instances will be removed after leaving the screen Then run it again, but move the game window out of focus . The instances with stay in the remote tab, even after bringing the game window back. ### Minimal reproduction project (MRP) [notifier_test.zip](https://github.com/user-attachments/files/17736415/notifier_test.zip)
bug,topic:editor
low
Minor
2,656,195,761
ollama
Validation of Keys and Subkeys in Ollama API JSON Objects
**Problem:** When interacting with the Ollama API, developers may inadvertently pass incorrect keys or subkeys in their requests (e.g., due to typos or misunderstanding of the expected structure). Currently, the API does not provide feedback when this occurs, which can lead to silent failures where options are ignored without notifying the user. This behavior makes debugging difficult and increases the likelihood of unintended behavior. **Proposed Solution:** Implement a validation mechanism that checks for the existence of valid keys and subkeys in the JSON request object. If an invalid key or subkey is detected, return an informative error message detailing which key or subkey is incorrect. This will help developers quickly identify issues in their request payloads. ### Expected Behavior: 1. **Validation on Request Submission:** When a request is made to any endpoint (e.g., `/generate`, `/chat`), the API should validate all provided keys and subkeys against a predefined schema. 2. **Error Response for Invalid Keys:** If an invalid key or subkey is detected, return an error response with a message such as: ```python KeyError("Invalid key 'num_predct' in 'options'. Did you mean 'num_predict'?") ``` 4. **Graceful Handling of Missing Required Keys:** If a required key (e.g., `"model"`, `"prompt"`) is missing, return an error indicating which required key is missing: ```python KeyError("Missing required key 'model'.") ``` ### Benefits: 1. **Improved Usability:** Developers will receive immediate feedback when they make mistakes in their request payloads, reducing debugging time. 2. **Reduced Silent Failures:** By explicitly notifying users of invalid keys or subkeys, you can eliminate silent failures where options are ignored without warning. 3. **Increased Confidence in Requests:** Developers can be confident that all provided options are being processed as intended.
feature request,api
low
Critical
2,656,219,648
godot
Z-fighting occurs with collision shape fill or when a CSG node is selected due to gizmo drawing
### Tested versions - Reproducible in Godot Engine 4.3 stable - Reproducible in Godot Engine master https://github.com/godotengine/godot/commit/76fa7b291455a8ba24c50005072ebdb58f8a5984 ### System information Windows 11 ### Issue description https://github.com/godotengine/godot/pull/94321 @aaronfranke mentioned that CSG has Z-fighting when a CSG node is selected ### Steps to reproduce Select the second csg node and fly around. https://github.com/user-attachments/assets/e50594c9-e23d-4e3b-9a9c-3067fa643984 ### Minimal reproduction project (MRP) [csg_flicker.zip](https://github.com/user-attachments/files/17736632/csg_flicker.zip)
bug,topic:rendering,topic:editor,confirmed,topic:3d
low
Minor
2,656,224,909
kubernetes
Initiate websocket handshake to watch for events in cache.ListWatch
### What would you like to be added? The k8s client-go should make use of the upgradable websocket connection to watch for changes to resources, if the apiserver version allows it. ### Why is this needed? Make use of modern http/2 compatible websockets instead of streaming chunked responses.
priority/awaiting-more-evidence,sig/api-machinery,kind/feature,triage/accepted
low
Major
2,656,233,906
kubernetes
The watch websocket stream should respond to close frame and close the connection accordingly.
### What would you like to be added? If the watch handler has been upgraded to a websocket and a close frame is received from the client, the connection should be cleanly closed. ### Why is this needed? To allow for protocol compliance and for clients to be able to close connections in a more clean, websockety way.
kind/feature,needs-sig,needs-triage
low
Minor
2,656,317,415
pytorch
On the Apple M1 GPU, torch.where() finds tensor entries in the wrong place
### 🐛 Describe the bug In the example, a larger tensor is filled with False, except seven entries that are True. The torch.where() method finds True in the wrong place, in a seemingly random way one of the locations is off by one: see the 6th entry on the CPU and the GPU, on the GPU incorrectly in the 47102620th place, while the other six entries are correctly found in their right place. ```python import torch device = torch.device('mps' if torch.backends.mps.is_available() else 'cpu') # Mx Mac GPU backend tf = torch.ones(49995000) == 0 tf[4049973] = True tf[8746207] = True tf[17016956] = True tf[17566864] = True tf[42134836] = True tf[47102619] = True tf[49861220] = True print(torch.where(tf == True)) # CPU tfongpu = tf.to(device) print(torch.where(tfongpu == True)) # GPU ``` Gives the output: ``` Out>: (tensor([ 4049973, 8746207, 17016956, 17566864, 42134836, 47102619, 49861220]),) (tensor([ 4049973, 8746207, 17016956, 17566864, 42134836, 47102620, 49861220], device='mps:0'),) ``` ### Versions PyTorch version: 2.4.0 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 15.1 (arm64) GCC version: Could not collect Clang version: 16.0.0 (clang-1600.0.26.4) CMake version: Could not collect Libc version: N/A Python version: 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ] (64-bit runtime) Python platform: macOS-15.1-arm64-arm-64bit Is CUDA available: False CUDA runtime version: No CUDA CUDA_MODULE_LOADING set to: N/A GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True CPU: Apple M1 Max Versions of relevant libraries: [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.26.2 [pip3] onnxruntime==1.16.0 [pip3] torch==2.5.0.dev20240720 [pip3] torchaudio==2.4.0.dev20240720 [pip3] torchvision==0.20.0.dev20240720 [conda] numpy 1.26.0 pypi_0 pypi [conda] pytorch 2.4.0 py3.11_0 pytorch [conda] torch 2.5.0.dev20240720 pypi_0 pypi [conda] torchaudio 2.4.0.dev20240720 pypi_0 pypi [conda] torchvision 0.20.0.dev20240720 pypi_0 pypi cc @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen
triaged,module: 64-bit,module: correctness (silent),module: mps
low
Critical
2,656,329,684
langchain
Number of Agent Types Not Updated in the Docs
### URL https://python.langchain.com/api_reference/langchain/agents/langchain.agents.agent_types.AgentType.html ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: In the api docs as well as the langchain official documentation, there is mention of nine types of agent types. But in creating, the sql agent using your create_sql_agent class & passing CHAT_ZERO_SHOT_REACT_DESCRIPTION as the agent type. It was showing valur error, only four agent types are supported openai tools openai functions, ZERO_SHOT_REACT_DESCRIPTION etc. Please update the documentation as needed, there is a lot of confusion regarding this. ### Idea or request for content: Changes needed to be made in these documents: https://python.langchain.com/api_reference/_modules/langchain/agents/agent_types.html#AgentType https://python.langchain.com/api_reference/langchain/agents/langchain.agents.agent_types.AgentType.html#langchain.agents.agent_types.AgentType.ZERO_SHOT_REACT_DESCRIPTION
🤖:docs
low
Critical
2,656,334,525
godot
Cannot use newly added custom URL in the Asset Library if it has been programmatically added
- *Production edit: Follow-up to https://github.com/godotengine/godot/issues/99175.* ### Tested versions 4.3 ### System information Windows 10 ### Issue description the asset library does not reload the available_urls list in the editor when adding a custom URL in EditorSettings, even after project reload. I added one manually and it worked. ### Steps to reproduce when you add a new URL to the Asset Lib, it doesn't update in this dropdown, even when reloading ![image](https://github.com/user-attachments/assets/1570857a-b450-4f8b-a560-4d91b49f5c9c) if I add it manually it works, when I do it from code I only see this: ![image](https://github.com/user-attachments/assets/b210a9db-2eca-4d2a-8caa-c1b6c9b8ebf2) ### Minimal reproduction project (MRP) n/a
bug,topic:editor,topic:plugin,topic:assetlib
low
Minor
2,656,340,027
flutter
[flutter_svg] SVG polygon fails to draw when using pattern fill (2.0.5)
_Imported from https://github.com/dnfield/flutter_svg/issues/919_ Original report by @andrewsheridan on May 3, 2023 When I attempt to use a pattern fill my polygon does not get drawn. I am using `userSpaceOnUse` as the `patternUnits`, not `objectBoundingBox`. Here is an example of an SVG which fails to draw when a pattern is applied for the fill. ``` <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg id="3186207a-01d4-4d15-98a0-99da496660e6" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-323.15608919382504 -61.749571183533476 457.975986277873 508.4048027444254"> <defs> <pattern id="reference" x="0.0" y="0.0" width="10.0" height="10.0" patternUnits="userSpaceOnUse"> <rect x="0.0" y="0.0" width="5.0" height="5.0" fill="#fed100" fill-opacity="1.0"/> </pattern> </defs> <polygon points="-321.09777015437396,318.01029159519726 -323.15608919382504,-59.69125214408234 134.81989708404797,-61.749571183533476 127.61578044596911,326.2435677530017 -99.82847341337907,446.65523156089193 -321.09777015437396,318.01029159519726" fill="url(#reference)" fill-opacity="0.26666666666666666" stroke="#fed100" stroke-opacity="1.0" stroke-dasharray="2.0 1.0" stroke-width="1.0"/> </svg> ``` If I remove the following bit `fill="url(#reference)"`, the shape is drawn. I've tested this SVG on multiple SVG previewers and it works fine on each of them.
package,P3,p: flutter_svg
low
Minor
2,656,340,148
flutter
[flutter_svg] parseDoubleWithUnits doesn't handle percentages.
_Imported from https://github.com/dnfield/flutter_svg/issues/920_ Original report by @AppalaNaidu01 on May 4, 2023 I am facing an issue while rendering the following svg: `<svg width="16" height="16" fill="#F2C94C" viewBox="1 1 14 14" class="color-override"><path d="M8.3779 4.74233C8.14438 4.60607 7.85562 4.60607 7.6221 4.74233L5.37209 6.05513C5.14168 6.18957 5 6.4363 5 6.70311V9.34216C5 9.60897 5.14168 9.85573 5.37209 9.99016L7.6221 11.303C7.85562 11.4392 8.14438 11.4392 8.3779 11.303L10.6279 9.99016C10.8583 9.85573 11 9.60897 11 9.34216V6.70311C11 6.4363 10.8583 6.18957 10.6279 6.05513L8.3779 4.74233Z" mask="url(#hole-66.66666666666666)"></path><mask id="hole-66.66666666666666"><rect width="100%" height="100%" fill="white"></rect><circle r="4" cx="7.5" cy="8" fill="black" stroke="white" stroke-width="8" stroke-dasharray="calc(16.746666666666666) 25.12" transform="rotate(-90) translate(-16)"></circle></mask><path fill-rule="evenodd" clip-rule="evenodd" d="M7.24419 1.44066C7.71124 1.16822 8.28876 1.16822 8.75581 1.44066L13.2558 4.06566C13.7166 4.33448 14 4.82783 14 5.36133V10.6382C14 11.1717 13.7166 11.6651 13.2558 11.9339L8.75581 14.5589C8.28876 14.8313 7.71124 14.8313 7.24419 14.5589L2.74419 11.9339C2.28337 11.6651 2 11.1717 2 10.6382V5.36133C2 4.82783 2.28337 4.33448 2.74419 4.06566L7.24419 1.44066ZM8 2.73633L12.5 5.36133V10.6382L8 13.2632L3.5 10.6382V5.36133L8 2.73633Z"></path></svg>` Got this error: ```shell [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Invalid double 100% #0 double.parse (dart:core-patch/double_patch.dart:112:28) #1 parseDouble (package:vector_graphics_compiler/src/svg/numbers.dart:32:17) #2 parseDoubleWithUnits (package:vector_graphics_compiler/src/svg/numbers.dart:82:25) #3 SvgParser.parseDoubleWithUnits (package:vector_graphics_compiler/src/svg/parser.dart:969:20) #4 _Paths.rect (package:vector_graphics_compiler/src/svg/parser.dart:510:34) #5 SvgParser.addShape (package:vector_graphics_compiler/src/svg/parser.dart:886:31) #6 SvgParser.startElement (package:vector_graphics_compiler/src/svg/parser.dart:914:12) #7 SvgParser._parseTree (package:vector_graphics_compiler/src/svg/parser.dart:764:13) #8 SvgParser.parse (package:vector_graphics_compiler/src/svg/parser.dart:797:5) #9 parse (package:vector_graphics_compiler/vector_graphics_compiler.dart:76:17) #10 encodeSvg (package:vector_graphics_compiler/vec<…> ``` I tried with the latest version of the library, did I used any attribute which isn't handled by this library? --- Comment by @mstich-mcmservices on Oct 20, 2023 I'm having a similar problem - Unhandled Exception: FormatException: Invalid double 1322.856 1327.7532. I've scanned through the svg and with my limited knowledge of SVG format, I did not see anything that immediately looked erroneous. The file in question can be pulled from: https://drive.google.com/file/d/1HH2dBGBVcxMCVu8-y3r4sb4b0dhgxfry/view?usp=share_link Regards. --- Comment by @shanelau on Oct 23, 2023 same error --- Comment by @RikClaesen on Nov 30, 2023 problem is cause by the '%' in rect width and height attributes. The SvgParser.parseDoubleWithUnits cannot handle the '%' It calls numbers.parseDoubleWithUnits eg.: double? parseDoubleWithUnits( String? rawDouble, { bool tryParse = false, }) { return numbers.parseDoubleWithUnits( rawDouble, tryParse: tryParse, theme: theme, ); } and that one does not handle '%': double? parseDoubleWithUnits( String? rawDouble, { bool tryParse = false, required SvgTheme theme, }) { double unit = 1.0; // 1 rem unit is equal to the root font size. // 1 em unit is equal to the current font size. // 1 ex unit is equal to the current x-height. if (rawDouble?.contains('pt') ?? false) { unit = kPointsToPixelFactor; } else if (rawDouble?.contains('rem') ?? false) { unit = theme.fontSize; } else if (rawDouble?.contains('em') ?? false) { unit = theme.fontSize; } else if (rawDouble?.contains('ex') ?? false) { unit = theme.xHeight; } final double? value = parseDouble( rawDouble, tryParse: tryParse, ); return value != null ? value * unit : null; }
package,P3,p: flutter_svg
low
Critical
2,656,340,257
flutter
[flutter_svg] How do I handle errors?
_Imported from https://github.com/dnfield/flutter_svg/issues/921_ Original report by @GeylanKalafMohe on May 9, 2023 How do I handle error when loading SVG from network? Currently I only use `SvgPicture.network`, when there is no internet connection the widget throws exception in the console and placeholderBuilder is still showing. There should be like an onError or errorBuilder parameter!
package,p: flutter_svg
low
Critical
2,656,340,491
flutter
[flutter_svg] Svgs with colorFilter applied are not rendering correctly with Impeller
_Imported from https://github.com/dnfield/flutter_svg/issues/927_ Original report by @adigladi on May 23, 2023 Updated Flutter in our project and noticed that some svgs weren't rendering correctly with impeller now enabled. It seems like it is the svgs with a colorFilter applied that look weird. ```dart SvgPicture.asset( 'assets/svgs/flutter-icon.svg', colorFilter: const ColorFilter.mode( Colors.black, BlendMode.srcIn, ), ); ``` See image below (with the flutter logo used, the svgs in our project looks worse but I can't share them unfortunately): The icon on top uses a color filter and looking at the left edges there seems to be some aliasing. The lower icon has no color filter and is rendering correctly. ![IMG_23BC34A9564E-1](https://github.com/dnfield/flutter_svg/assets/35582133/67131287-a4fe-4f82-be1b-306d7af75647) Here's also a sample which shows the issue (a svg path needs to be provided though): ```dart import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; void main() async { runApp(const MaterialApp(home: MyHomePage())); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(), ); } } class MyHomePage extends StatelessWidget { const MyHomePage({super.key}); @override Widget build(BuildContext context) { final defaultSvg = SvgPicture.asset('assets/svgs/flutter-icon.svg'); final svgWithFilter = SvgPicture.asset( 'assets/svgs/flutter-icon.svg', colorFilter: const ColorFilter.mode( Colors.black, BlendMode.srcIn, ), ); return Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ svgWithFilter, const SizedBox(height: 20), defaultSvg, ], ), ), ); } } ``` --- Comment by @dnfield on May 24, 2023 Can you share flutter-icon.svg as well? --- Comment by @leredirect on May 24, 2023 same issue for me, using impeller too. without colorFilter: <img width="49" alt="image" src="https://github.com/dnfield/flutter_svg/assets/71591796/b0c79c02-0cc8-49e4-9f3a-c35a20965a9d"> with colorFilter (blendMode - srcIn) <img width="49" alt="image" src="https://github.com/dnfield/flutter_svg/assets/71591796/8b136a1c-cc66-45e3-a68d-5430d17c2801"> right fringe of icon is cutted a lil bit used file: ![ic_favourites_active](https://github.com/dnfield/flutter_svg/assets/71591796/f60f1fb3-ce41-4f84-9022-b1799f0aff1b) --- Comment by @Venusdjinni on May 26, 2023 Same issue here. NOt sure its an Impeller issue though, since i'm running on Android (Flutter 3.10.1). Here is my svg: ``` <svg width="25" height="24" viewBox="0.5 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <mask id="path-1-inside-1_922_5843" fill="white"> <path fill-rule="evenodd" clip-rule="evenodd" d="M23.2818 12H14.5C13.3954 12 12.5 12.8954 12.5 14V20.3739L6.74175 23.805C6.52085 23.9405 6.26455 24.0081 6.00507 23.9992C5.7456 23.9904 5.49453 23.9056 5.2835 23.7554C5.07247 23.6052 4.91088 23.3963 4.81907 23.1551C4.72726 22.9139 4.70933 22.6512 4.76754 22.3999L6.38247 15.0256L0.986284 10.5699C0.784114 10.4068 0.635205 10.1878 0.558442 9.94057C0.481678 9.69339 0.480519 9.42916 0.555068 9.18131C0.629616 8.93346 0.776544 8.71313 0.977246 8.54825C1.17795 8.38337 1.42338 8.28138 1.68251 8.25512L8.51854 7.48396L11.8089 0.743523C11.8839 0.587706 11.9892 0.448195 12.1188 0.333037C12.2484 0.21788 12.3997 0.129366 12.5639 0.07261C12.7281 0.0158538 12.9021 -0.0080221 13.0756 0.00236753C13.2492 0.0127572 13.419 0.057185 13.5752 0.13312C13.8443 0.260806 14.0612 0.476253 14.1898 0.743523L17.4801 7.48396L24.3175 8.25512C24.5766 8.28138 24.8221 8.38337 25.0228 8.54825C25.2235 8.71313 25.3704 8.93346 25.4449 9.18131C25.5195 9.42916 25.5183 9.69339 25.4416 9.94057C25.3648 10.1878 25.2159 10.4068 25.0137 10.5699L23.2818 12Z"/> </mask> <path fill-rule="evenodd" clip-rule="evenodd" d="M23.2818 12H14.5C13.3954 12 12.5 12.8954 12.5 14V20.3739L6.74175 23.805C6.52085 23.9405 6.26455 24.0081 6.00507 23.9992C5.7456 23.9904 5.49453 23.9056 5.2835 23.7554C5.07247 23.6052 4.91088 23.3963 4.81907 23.1551C4.72726 22.9139 4.70933 22.6512 4.76754 22.3999L6.38247 15.0256L0.986284 10.5699C0.784114 10.4068 0.635205 10.1878 0.558442 9.94057C0.481678 9.69339 0.480519 9.42916 0.555068 9.18131C0.629616 8.93346 0.776544 8.71313 0.977246 8.54825C1.17795 8.38337 1.42338 8.28138 1.68251 8.25512L8.51854 7.48396L11.8089 0.743523C11.8839 0.587706 11.9892 0.448195 12.1188 0.333037C12.2484 0.21788 12.3997 0.129366 12.5639 0.07261C12.7281 0.0158538 12.9021 -0.0080221 13.0756 0.00236753C13.2492 0.0127572 13.419 0.057185 13.5752 0.13312C13.8443 0.260806 14.0612 0.476253 14.1898 0.743523L17.4801 7.48396L24.3175 8.25512C24.5766 8.28138 24.8221 8.38337 25.0228 8.54825C25.2235 8.71313 25.3704 8.93346 25.4449 9.18131C25.5195 9.42916 25.5183 9.69339 25.4416 9.94057C25.3648 10.1878 25.2159 10.4068 25.0137 10.5699L23.2818 12Z" fill="black"/> <path d="M23.2818 12V13H23.6413L23.9185 12.7711L23.2818 12ZM12.5 20.3739L13.0119 21.233L13.5 20.9422V20.3739H12.5ZM6.74175 23.805L6.22984 22.9458L6.21893 22.9525L6.74175 23.805ZM5.2835 23.7554L5.86335 22.9406L5.86335 22.9406L5.2835 23.7554ZM4.76754 22.3999L5.74181 22.6256L5.74439 22.6138L4.76754 22.3999ZM6.38247 15.0256L7.35932 15.2395L7.48991 14.6432L7.01918 14.2545L6.38247 15.0256ZM0.986284 10.5699L1.62304 9.79873L1.61417 9.79158L0.986284 10.5699ZM0.558442 9.94057L1.51345 9.644L1.51345 9.64399L0.558442 9.94057ZM0.555068 9.18131L-0.402552 8.89328L-0.402553 8.89328L0.555068 9.18131ZM0.977246 8.54825L1.61202 9.32095L0.977246 8.54825ZM1.68251 8.25512L1.78335 9.25008L1.79461 9.24881L1.68251 8.25512ZM8.51854 7.48396L8.63064 8.47766L9.1763 8.41611L9.41719 7.92264L8.51854 7.48396ZM11.8089 0.743523L12.7076 1.1822L12.71 1.1771L11.8089 0.743523ZM12.1188 0.333037L11.4545 -0.414456L11.4545 -0.414453L12.1188 0.333037ZM12.5639 0.07261L12.2373 -0.872543L12.5639 0.07261ZM13.0756 0.00236753L13.0159 1.00058L13.0159 1.00058L13.0756 0.00236753ZM13.5752 0.13312L13.1379 1.0325L13.1465 1.03659L13.5752 0.13312ZM14.1898 0.743523L13.2886 1.17704L13.2911 1.1822L14.1898 0.743523ZM17.4801 7.48396L16.5815 7.92264L16.8224 8.41612L17.3681 8.47766L17.4801 7.48396ZM24.3175 8.25512L24.2054 9.24888L24.2167 9.25002L24.3175 8.25512ZM25.4449 9.18131L26.4026 8.89328V8.89328L25.4449 9.18131ZM25.4416 9.94057L24.4865 9.64399V9.644L25.4416 9.94057ZM25.0137 10.5699L24.3858 9.79153L24.377 9.79878L25.0137 10.5699ZM14.5 13H23.2818V11H14.5V13ZM13.5 14C13.5 13.4477 13.9477 13 14.5 13V11C12.8431 11 11.5 12.3431 11.5 14H13.5ZM13.5 20.3739V14H11.5V20.3739H13.5ZM11.9881 19.5149L6.22988 22.9459L7.25362 24.664L13.0119 21.233L11.9881 19.5149ZM6.21893 22.9525C6.16546 22.9853 6.10286 23.002 6.03912 22.9998L5.97103 24.9987C6.42624 25.0142 6.87623 24.8956 7.26456 24.6574L6.21893 22.9525ZM6.03912 22.9998C5.97522 22.9976 5.91407 22.9767 5.86335 22.9406L4.70365 24.5701C5.07499 24.8344 5.51597 24.9832 5.97103 24.9987L6.03912 22.9998ZM5.86335 22.9406C5.81271 22.9046 5.77489 22.8552 5.75364 22.7994L3.88449 23.5109C4.04686 23.9374 4.33223 24.3057 4.70365 24.5701L5.86335 22.9406ZM5.75364 22.7994C5.73245 22.7437 5.72837 22.6833 5.74174 22.6255L3.79333 22.1742C3.6903 22.619 3.72207 23.0842 3.88449 23.5109L5.75364 22.7994ZM5.74439 22.6138L7.35932 15.2395L5.40562 14.8117L3.79069 22.186L5.74439 22.6138ZM7.01918 14.2545L1.62299 9.79878L0.349573 11.341L5.74576 15.7967L7.01918 14.2545ZM1.61417 9.79158C1.56582 9.75257 1.53115 9.70098 1.51345 9.644L-0.396567 10.2372C-0.260737 10.6745 0.00241023 11.061 0.358393 11.3482L1.61417 9.79158ZM1.51345 9.64399C1.49579 9.58712 1.49551 9.52647 1.51269 9.46934L-0.402553 8.89328C-0.534469 9.33186 -0.532431 9.79966 -0.396567 10.2372L1.51345 9.64399ZM1.51269 9.46934C1.52988 9.41219 1.56407 9.36034 1.61202 9.32095L0.342475 7.77555C-0.0109843 8.06592 -0.270645 8.45473 -0.402552 8.89328L1.51269 9.46934ZM1.61202 9.32095C1.66002 9.28152 1.71956 9.25648 1.78334 9.25002L1.58168 7.26021C1.12721 7.30627 0.695881 7.48523 0.342475 7.77555L1.61202 9.32095ZM1.79461 9.24881L8.63064 8.47766L8.40645 6.49027L1.57042 7.26142L1.79461 9.24881ZM9.41719 7.92264L12.7075 1.1822L10.9102 0.304848L7.6199 7.04529L9.41719 7.92264ZM12.71 1.1771C12.7274 1.14089 12.7521 1.108 12.783 1.08053L11.4545 -0.414453C11.2262 -0.211606 11.0403 0.0345199 10.9078 0.309946L12.71 1.1771ZM12.783 1.08053C12.8139 1.05308 12.8504 1.03162 12.8905 1.01776L12.2373 -0.872543C11.9489 -0.772887 11.6828 -0.617317 11.4545 -0.414456L12.783 1.08053ZM12.8905 1.01776C12.9306 1.00391 12.9732 0.998029 13.0159 1.00058L13.1354 -0.995846C12.8309 -1.01407 12.5256 -0.972202 12.2373 -0.872543L12.8905 1.01776ZM13.0159 1.00058C13.0586 1.00314 13.1001 1.01406 13.1379 1.03246L14.0124 -0.766216C13.7379 -0.899688 13.4398 -0.977623 13.1354 -0.995846L13.0159 1.00058ZM13.1465 1.03659C13.21 1.0667 13.2596 1.11676 13.2886 1.17703L15.0909 0.310012C14.8628 -0.16425 14.4786 -0.545085 14.0038 -0.770354L13.1465 1.03659ZM13.2911 1.1822L16.5815 7.92264L18.3788 7.04529L15.0884 0.304848L13.2911 1.1822ZM17.3681 8.47766L24.2054 9.24881L24.4296 7.26142L17.5922 6.49026L17.3681 8.47766ZM24.2167 9.25002C24.2804 9.25648 24.34 9.28152 24.388 9.32095L25.6575 7.77555C25.3041 7.48523 24.8728 7.30627 24.4183 7.26021L24.2167 9.25002ZM24.388 9.32095C24.4359 9.36034 24.4701 9.41219 24.4873 9.46934L26.4026 8.89328C26.2706 8.45473 26.011 8.06592 25.6575 7.77555L24.388 9.32095ZM24.4873 9.46934C24.5045 9.52647 24.5042 9.58712 24.4865 9.64399L26.3966 10.2372C26.5324 9.79966 26.5345 9.33186 26.4026 8.89328L24.4873 9.46934ZM24.4865 9.644C24.4689 9.70098 24.4342 9.75257 24.3858 9.79158L25.6416 11.3482C25.9976 11.061 26.2607 10.6745 26.3966 10.2372L24.4865 9.644ZM24.377 9.79878L22.645 11.2289L23.9185 12.7711L25.6504 11.341L24.377 9.79878Z" fill="#FFFF40" mask="url(#path-1-inside-1_922_5843)"/> <rect x="14" y="14.5" width="10" height="1" rx="0.5" fill="black" stroke="#FFFF40"/> <rect x="14" y="22.5" width="10" height="1" rx="0.5" fill="black" stroke="#FFFF40"/> <rect x="14" y="18.5" width="10" height="1" rx="0.5" fill="black" stroke="#FFFF40"/> </svg> ``` --- Comment by @dnfield on May 27, 2023 @jonahwilliams these appear to be the pipeline blends...? --- Comment by @adigladi on May 29, 2023 > Can you share flutter-icon.svg as well? Here you go: ![flutter-icon](https://github.com/dnfield/flutter_svg/assets/35582133/1d674e3b-821d-483a-9d15-b041663db6a9) --- Comment by @bdero on May 30, 2023 This looks like another subpass UV mapping issue. There's another open UV mapping issue which may or may not wind up being the same codepath. We should keep this reproduction in mind when triaging it: https://github.com/flutter/flutter/issues/127386 --- Comment by @chocokoko on Jun 14, 2023 > same issue for me, using impeller too. without colorFilter: <img alt="image" width="49" src="https://user-images.githubusercontent.com/71591796/240755452-b0c79c02-0cc8-49e4-9f3a-c35a20965a9d.png"> with colorFilter (blendMode - srcIn) <img alt="image" width="49" src="https://user-images.githubusercontent.com/71591796/240755593-8b136a1c-cc66-45e3-a68d-5430d17c2801.png"> right fringe of icon is cutted a lil bit used file: ![ic_favourites_active](https://user-images.githubusercontent.com/71591796/240755714-f60f1fb3-ce41-4f84-9022-b1799f0aff1b.svg) the same icon, and the same bug here --- Comment by @nileshrathore on Jun 15, 2023 facing the same issue! --- Comment by @seferdemirci on Jul 20, 2023 same here! any idea or opinion? --- Comment by @fatherOfLegends on Sep 14, 2023 Same issue --- Comment by @Mo0Khaled on Sep 19, 2023 same issue --- Comment by @dnfield on Sep 25, 2023 I have seen multiple reports of this issue, but I _cannot_ reproduce it on my iPhone or macOS desktop with Impeller enabled on a recent commit of Flutter. --- Comment by @aytunch on Sep 26, 2023 @dnfield try different size values. In my case, for some int length values, I see artifacts, for some they render correctly. --- Comment by @dnfield on Sep 26, 2023 If you could share a reproduction with the SVG and size values and device information that would be helpful. --- Comment by @simonNEON on Oct 5, 2023 Any updates on this? --- Comment by @okanulkr on Oct 17, 2023 It is rendering correctly only with the build argument `--no-enable-impeller`. Any updates? --- Comment by @SivaramSS on Oct 26, 2023 facing same issue with flutter 3.13.9 --- Comment by @deniskrr on Dec 15, 2023 Any updates? --- Comment by @sapar-io on Jan 7, 2024 any updates? --- Comment by @simonNEON on Jan 8, 2024 My current hot fix is to wrap the child with a Transform.scale like shown below. I believe you can play around with the scale to get a better or worse result but this works for me for now. I hope this will be fixed soon. `Transform.scale( scale: 0.999, child: child, )` --- Comment by @appinteractive on Feb 5, 2024 thanks, @simonNEON that actually helped 👍 --- Comment by @bselwe on Jun 6, 2024 > If you could share a reproduction with the SVG and size values and device information that would be helpful. @dnfield Try this icon: ```svg <svg width="27" height="26" viewBox="0 0 27 26" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.0195 24.3408C6.9502 24.3408 1.92285 19.3242 1.92285 13.2441C1.92285 7.1748 6.93945 2.14746 13.0088 2.14746C19.0889 2.14746 24.1162 7.1748 24.1162 13.2441C24.1162 19.3242 19.0889 24.3408 13.0195 24.3408ZM7.7666 13.2549C7.7666 13.8672 8.20703 14.2969 8.83008 14.2969H11.9668V17.4443C11.9668 18.0566 12.3965 18.4971 13.0088 18.4971C13.6318 18.4971 14.0723 18.0566 14.0723 17.4443V14.2969H17.2197C17.832 14.2969 18.2725 13.8672 18.2725 13.2549C18.2725 12.6318 17.832 12.1914 17.2197 12.1914H14.0723V9.04395C14.0723 8.43164 13.6318 7.98047 13.0088 7.98047C12.3965 7.98047 11.9668 8.43164 11.9668 9.04395V12.1914H8.83008C8.20703 12.1914 7.7666 12.6318 7.7666 13.2549Z" fill="white" style="fill:white;fill:white;fill-opacity:1;"/> </svg> ``` With the following size and filter it gets clipped on the bottom/right corners: ```dart Assets.icons.add.svg( width: 15, colorFilter: const ColorFilter.mode( Color.fromRGBO(255, 255, 255, 0.38), BlendMode.srcIn, ), ) ``` Flutter: 3.19.4 Device: iPhone 15 Pro 17.4 Simulator Xcode: 15.4
package,P1,p: flutter_svg
medium
Critical
2,656,340,606
flutter
[flutter_svg] precaching svg does not work.
_Imported from https://github.com/dnfield/flutter_svg/issues/930_ Original report by @mimoislam on May 28, 2023 Hello guys i am using Flutter_svg with my application and i am using a lot of svgs like 20 in one page and it is very laggy like drop to 1 fps i tried caching using svg.cache but it is not working i used it (cached all svg that i need for second page by before loading it when clicking in button ) . --- Comment by @pbouttier on Jun 28, 2023 Try https://pub.dev/packages/flutter_svg_provider I had the same problem, displaying up to 50 svg simultaneously, during animations, ... and this package solved the problem
package,P3,p: flutter_svg
low
Minor
2,656,340,890
flutter
[flutter_svg] Colored background in transparent SVG when using `SvgPicture` & `BoxDecoration` `backgroundBlendMode`
_Imported from https://github.com/dnfield/flutter_svg/issues/933_ Original report by @appcapsergen on Jun 2, 2023 When wrapping a SvgPicture.asset(...) with a Container/DecoratedBox with foregroundDecoration containing a `color` and a `backgroundBlendMode`, the image will sometimes have the chosen color wherever the SVG file is transparent. Code example and images down below: ```dart DecoratedBox( foregroundDecoration: const BoxDecoration( color: Colors.black, backgroundBlendMode: BlendMode.saturation, ), child: SvgPicture.asset('assets/images/certificate.svg'), ), ``` Expected result: <img src="https://github.com/dnfield/flutter_svg/assets/94898347/9f46ab06-6a8a-41e6-be16-758b85c13e35" width="580" height="340"> Actual result: <img src="https://github.com/dnfield/flutter_svg/assets/94898347/615327c7-4db3-4fcd-a95d-7581a04cca6f" width="580" height="340"> --- Comment by @kuemme01 on Jun 13, 2023 @appcapsergen Does this only happen on Android or also on iOS? --- Comment by @appcapsergen on Jun 13, 2023 @kuemme01 on both platforms, but on one it happens when you scroll and on the other it happens when you stop scrolling. Not sure which was which, but it's similar when scrolling if it makes sense.
package,P2,p: flutter_svg
low
Minor
2,656,340,985
flutter
[flutter_svg] polygon without points causes parsing issue.
_Imported from https://github.com/dnfield/flutter_svg/issues/934_ Original report by @aggeloskoutanis on Jun 7, 2023 Hello, I have been getting this error since I upgrade the package to 2.0.4. ``` _CastError: Null check operator used on a null value File "loaders.dart", line 421, in SvgNetworkLoader.provideSvg File "loaders.dart", line 138, in SvgLoader._load.<fn>.<fn> File "_isolates_io.dart", line 18, in compute.<fn> File "isolate", line 954, in _RemoteRunner._run File "isolate_patch.dart", line 300, in _delayEntrypointInvocation.<fn> File "isolate_patch.dart", line 192, in _RawReceivePort._handleMessage ``` Does it have to do with the loader trying to access the image before it is loaded? Flutter (Channel stable, 3.7.12, on macOS 13.3.1 --- Comment by @Kayes-Islam on Jul 21, 2024 I have the same error on this SVG file: https://github.com/user-attachments/assets/1c6fd3a8-6f2b-48b8-8201-26489bd558a6 I have a number of other SVG files and they are working without problem. I'm using version: 2.0.10+1 --- Comment by @Kayes-Islam on Jul 21, 2024 OK so I did the below and now it's working: 1. Got rid of couple of polygons that only had transform and fill like below: ```<polygon transform="translate(-0.020311,-25.843)" fill="#014953" />``` 2. Removed id attributes such as `id="path27"` 3. Replaced style attribute with fill value to direct fill attribute. I.e. replaced `style="fill:#014953"` to `fill="#014953"` Seems to be working now. --- Comment by @Kayes-Islam on Jul 21, 2024 I had issue in another file, this time removing the below is the only fix I had to apply: ```<polygon fill="#fff" transform="translate(.002336 -9.95283)"/>``` Confirmed that polygon without points is causing this issue.
package,P3,p: flutter_svg
low
Critical
2,656,347,538
go
x/tools/gopls: add "Eliminate dot import" code action
Sometimes we regret using dot imports but they are too tedious to remove. It would be easy (and ~~infallible~~ actually fallible) to offer a code action to automate this transformation. We could also offer the reverse ("Convert to dot import"), but perhaps we should not place temptation in front of weak mortals. (The reverse operation is fallible.)
help wanted,FeatureRequest,gopls,Tools,Refactoring
low
Major
2,656,364,321
flutter
[flutter_svg] Text offset in y direction
_Imported from https://github.com/dnfield/flutter_svg/issues/959_ Original report by @Huber1 on Jul 7, 2023 When i am using `SvgPicture.file()` for the following svg, it doesn't render the text in the correct location. Like you can see it is offset in y-direction ```svg <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Ebene_1" viewBox="0 0 1000 500" xml:space="preserve"><script xmlns=""/> <rect fill="#C79514" width="1000" height="500"/> <text text-anchor="middle" x="50%" y="50%" dy=".35em" font-family="Arial, sans-serif" font-weight="bold" font-size="425px" fill="#ffffff">21</text> <style xmlns="" class="darkreader darkreader--fallback">html, body, body :not(iframe) { background-color: #232425 !important; border-color: #777067 !important; color: #dddcd9 !important; }</style></svg> ``` Location: https://www.mvv-muenchen.de/fileadmin/lines/02021.svg ![Screenshot_20230627-112424](https://github.com/dnfield/flutter_svg/assets/22856090/16db7b35-b845-4fea-880e-ab89ec0ee49c) The Text is not, as expected centered vertically and horizontally, but only centered horizontally Is it a coincidence that the bottom line of the text is centered? The Image is not cropped. I put it inside a Center on a blank screen to make sure it is completely visible
package,P3,p: flutter_svg
low
Minor
2,656,364,470
flutter
[flutter_svg] ColorFilter being applied to whole app instead of just the SVG
_Imported from https://github.com/dnfield/flutter_svg/issues/962_ Original report by @wilsonsilva on Jul 8, 2023 My ColorFilter is being applied to the whole app, not just the container of the SVG. I tried wrapping the SVG in a `Container` and other widgets but it still applies the filter to the whole app. Is this expected? <img width="494" alt="Screenshot 2023-07-08 at 19 12 21" src="https://github.com/dnfield/flutter_svg/assets/645203/5307c262-2508-434c-a74d-1fc5e9cce49d"> Code: ```dart import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; void main() { runApp(App()); } class App extends StatelessWidget { App({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: Center( child: SizedBox( width: 300, height: 300, child: SvgPicture.asset( 'assets/svg/dart.svg', // from flutter_svg/example/assets/dart.svg colorFilter: const ColorFilter.mode( Color(0xFFFFC555), BlendMode.hardLight, ), ), ), ), ) ); } } ``` ``` FlutterSvg 2.0.7 Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 796c8ef792 (4 weeks ago) • 2023-06-13 15:51:02 -0700 Engine • revision 45f6e00911 Tools • Dart 3.0.5 • DevTools 2.23.1 ``` --- Comment by @wilsonsilva on Jul 9, 2023 This also happens in the example app. <img width="1728" alt="Screenshot 2023-07-09 at 08 38 43" src="https://github.com/dnfield/flutter_svg/assets/645203/7da5926c-752f-42df-b5d1-af6a0789191e"> --- Comment by @MrCsabaToth on Jul 15, 2023 Could be related to #942 or #938? What happens if you try `ColorFilter.mode(Colors.transparent, BlendMode.srcATop)`. If that works maybe you can cast the `Color(0xFFFFC555)` backdrop with a widget behind the `SvgPicture`. I was able to work around my problem while still staying with impeller that way. --- Comment by @noinskit on Aug 17, 2023 This bit me as well. As an extra data point, it only started after I upgraded from Flutter 3.10.x to Flutter 3.13.0. Using the ColorFiltered widget (wrapping SvgPicture) works around the issue for me. --- Comment by @Mohdx on Oct 4, 2023 try `BlendMode.srcIn` ``` colorFilter: const ColorFilter.mode( MainColors.color2, BlendMode.srcIn, ), ``` --- Comment by @minhdanh on May 15, 2024 Still happening to me. In my case I was trying to set the image to grayscale: ``` SvgPicture.asset( 'assets/images/svg/undraw_profile_pic_ic5t.svg', semanticsLabel: 'Profile pic', colorFilter: const ColorFilter.mode( Colors.grey, BlendMode.saturation, ), ), ``` --- Comment by @martin-braun on May 28, 2024 I don't know if this is related, but for me all color filters, except for `modulate` would dye even the transparent parts of my SVG.
package,P3,p: flutter_svg
low
Critical
2,656,364,653
flutter
[flutter_svg] mix blend mode on <g> not being applied to svg.
_Imported from https://github.com/dnfield/flutter_svg/issues/965_ Original report by @kent-nexient on Jul 13, 2023 First, thanks for this great package. Question: This svg does not render the same as Chrome and I have not been able to figure out why. Can you point out what may not be supported? <svg width="429" height="192" viewBox="0 0 429 192" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="429" height="192" fill="#077DAF"/> <g style="mix-blend-mode:luminosity" clip-path="url(#clip0_8687_104539)"> <path d="M263.129 41.4276L415.365 -0.64634L310.454 -8.58984L263.129 41.4276Z" fill="#0A528C"/> <path d="M222.882 97.9993L263.129 41.4296L194.762 18.9453L222.882 97.9993Z" fill="#0076A8"/> <path d="M263.129 41.4288L310.455 -8.58871L185.406 -35L263.129 41.4288Z" fill="#2081CE"/> <path d="M109 -3.13592L194.762 18.9445L185.406 -35L109 -3.13592Z" fill="#003C7A"/> <path d="M194.762 18.9445L263.129 41.4288L185.406 -35L194.762 18.9445Z" fill="#328ED8"/> <path d="M415.365 -0.644531L263.129 41.4294L331.277 62.5449L415.365 -0.644531Z" fill="#5CC8EB"/> <path opacity="0.3" d="M222.882 98.0018L194.761 18.9476L109 -3.13281L222.882 98.0018Z" fill="#00415D"/> <path d="M429 95.3066L415.365 -0.644531L331.277 62.545L429 95.3066Z" fill="#127190"/> <path d="M429.662 108.091L520.236 45.4741L413.292 -7.86193L429.662 108.091Z" fill="#328ED8"/> </g> <defs> <clipPath id="clip0_8687_104539"> <rect width="320" height="105" fill="white" transform="translate(109)"/> </clipPath> </defs> </svg> Thanks --- Comment by @kent-nexient on Jul 13, 2023 ![Social Category SVG@2x](https://github.com/dnfield/flutter_svg/assets/49567110/ef2bcefd-b87a-4f21-bef2-d24f3dc410e3) --- Comment by @kent-nexient on Jul 13, 2023 Appears to be an issue with impeller. If I run without impeller, it renders fine.
package,P3,p: flutter_svg
low
Minor
2,656,364,738
flutter
[flutter_svg] Uncaught Bad state: Invalid SVG data
_Imported from https://github.com/dnfield/flutter_svg/issues/967_ Original report by @fakhravari on Jul 21, 2023 ![pmlm-en](https://github.com/dnfield/flutter_svg/assets/4311975/4ad8e2a7-4b82-4de8-ab60-06177e29f8e2) ![Screenshot 2023-07-21 211130](https://github.com/dnfield/flutter_svg/assets/4311975/a07130e5-4976-4a67-b630-d741e990dbc2) static const logoAppbar = 'assets/icons/pmlm-en.svg'; SvgPicture.asset( AppImagesAssets.logoAppbar, height: 55, color: Theme.of(context).colorScheme.primary, semanticsLabel: 'PMLM', ) --- Comment by @fakhravari on Jul 31, 2023 help me --- Comment by @SangaraNaarayanan-tuts on Dec 19, 2023 bro did u find any solution this is occuring for me too --- Comment by @darthcodehero on Jan 19, 2024 hey `const String svgNotifications = '''<svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg"> <g id="Notificaction"> <path id="Vector" d="M14.271 25.8216C12.1758 25.825 10.4128 24.4259 9.94297 22.3409C9.86609 22.0001 9.72259 21.9104 9.4151 21.8865C8.42341 21.8096 7.43087 21.7319 6.44261 21.6191C4.54893 21.4022 3.33345 19.593 3.94418 17.8019C4.41311 16.4267 4.38407 15.0036 4.54124 13.5977C4.71463 12.0482 4.70951 10.48 5.2109 8.97153C6.53998 4.97062 10.5981 2.27061 14.7955 2.50209C18.9236 2.7293 22.9177 5.74791 23.7044 10.4731C23.9256 11.8005 23.9649 13.1586 24.0802 14.5039C24.1776 15.6349 24.2656 16.7564 24.6209 17.8574C25.1889 19.6178 23.9846 21.3962 22.1353 21.6157C21.1906 21.7285 20.2416 21.8053 19.2935 21.8737C18.8861 21.9027 18.6785 21.995 18.5692 22.4741C18.1147 24.4618 16.3236 25.8182 14.271 25.8216ZM14.2343 19.9672C16.7062 19.8066 19.1739 19.6537 21.639 19.4803C22.436 19.4239 22.6905 18.9883 22.4565 18.223C22.3078 17.7352 22.1344 17.2432 22.0823 16.741C21.9047 15.0293 21.7407 13.3149 21.6348 11.5981C21.4144 8.03451 18.6196 5.16452 15.2097 4.74C11.5906 4.28986 8.05783 6.55254 7.20281 10.0973C6.84321 11.5895 6.82527 13.1655 6.65786 14.7038C6.52888 15.8868 6.534 17.0869 6.1035 18.2281C5.81309 18.9968 6.11119 19.4231 6.95254 19.482C9.37666 19.652 11.8016 19.8057 14.2343 19.9655V19.9672ZM12.1877 22.0633C12.4269 23.0806 13.3793 23.6811 14.5153 23.6264C15.3242 23.5871 16.3654 22.7415 16.3372 22.0633H12.1877Z" fill="#0E3924"/> </g> </svg>''';` `SvgPicture.string( svgNotifications, width: 28, height: 28, ),` Mine is a normal svg but try it like that, it worked for me --- Comment by @hpelitebook745G2 on Mar 21, 2024 is there a callback at least that captures the error event so i could display a placeholder? --- Comment by @tonytrill on Apr 4, 2024 I was not getting this error locally on web, but was after deploying and building the app I was getting this error. What I found was I was referencing the svg as `icons/my-icon.svg` as opposed to `assets/icons/my-icon.svg` in my `SvgPicture.asset()`. Hope this helps. --- Comment by @Spiro94 on May 9, 2024 > I was not getting this error locally on web, but was after deploying and building the app I was getting this error. What I found was I was referencing the svg as `icons/my-icon.svg` as opposed to `assets/icons/my-icon.svg` in my `SvgPicture.asset()`. Hope this helps. Same issue, thanks for the solution. --- Comment by @pjarnfelt on Sep 7, 2024 Why is there no error handling on the SvgPicture object?!! --- Comment by @faaqi on Oct 14, 2024 This bug freezes the app and not able to catch it. Did u find any solution @pjarnfelt
package,P3,p: flutter_svg
low
Critical
2,656,364,867
flutter
[flutter_svg] Svg network only show black rectangle
_Imported from https://github.com/dnfield/flutter_svg/issues/970_ Original report by @novannp on Jul 28, 2023 i have try this code and just show black `SvgPicture.network("https://lms.pptik.id/theme/image.php/fordson/core/1685632254/f/pdf")` that url return svg: ![image](https://github.com/dnfield/flutter_svg/assets/24910496/c2acbc20-3cc0-4cc3-8869-328398268a4d) and this the result : ![image](https://github.com/dnfield/flutter_svg/assets/24910496/8033ec84-fd67-4f95-b2b8-c50eaa7cc8c7) thank you --- Comment by @pratikiran on Jul 31, 2023 This is because the **URL** isn't serving a `static file`. Try to find the **URL** which serves static file. **Example**: ```dart SvgPicture.network ( "https://www.adobe.com/content/dam/cc/icons/Adobe_Corporate_Horizontal_Red_HEX.svg" ), ``` I hope this clears and helps @novannp . --- Comment by @novannp on Jul 31, 2023 thank u for tha answer, that url can't convert to static because that url coming from api response, i dont have access to backend.
package,P3,p: flutter_svg
low
Minor
2,656,364,951
flutter
[flutter_svg] [v2.0.5] Svg not properly resized when passed to vg.loadPicture()
_Imported from https://github.com/dnfield/flutter_svg/issues/971_ Original report by @dugernierg on Aug 2, 2023 I am using flutter_svg to handle SVG files that needs to be resized before getting formatted as PNGs to be used as markers on GoogleMap (why GoogleMap doesn't handle SVG is beyond me, but not the topic of this post). Because I haven't find a way to convert an `SvgPicture` directly into `ByteData` with the `ImageByteFormat.png` format, I'm doing a bit of a workaround by converting it into an Image first. ``` final width = 100.0; final height = 140.0; final svgPicture = SvgPicture.asset( assetPath, height: height, width: width, ); final pictureInfo = await vg.loadPicture(svgPicture.bytesLoader, null); final image = await pictureInfo.picture.toImage(width.round(), height.round()); final bytes = await image.toByteData(format: ImageByteFormat.png); final marker = BitmapDescriptor.fromBytes(bytes.buffer.asUint8List()); ``` I follow what was recommended [here](https://github.com/dnfield/flutter_svg/issues/842). However, no matter what value I give to `width` and `height`, the file will be shown in its original size. As far as I can tell, the bytesLoader ignores the values passed to `SvgPicture.asset()` and uses the one inside the file instead (see picture below). ![image](https://github.com/dnfield/flutter_svg/assets/39966404/b4e6b639-d953-459e-9983-0315c2ac24d7) I'm not sure if it's intended or not, but it's at the very least counterintuitive in my opinion. --- Comment by @HasanShaddadKangaroo on Aug 29, 2023 @dugernierg Did you find any workaround for this or maybe another way to implement it? --- Comment by @dugernierg on Sep 1, 2023 @HasanShaddadKangaroo I ended up parsing the svg string myself by doing the following steps: * matched on `'height="(.*?)"'`, `'width="(.*?)"'` and `'viewBox="(.*?)"'` RegExps to find the existing values as strings. * did some `replaceAll()` on those strings to isolate the values then parse them as double. * did a replaceFirst on the same RegExps from step one to switch the old values by values*ratio: `replaceFirst(RegExp('height="(.*?)"'), 'height="$newHeight"')` * applied a transform=scale on all paths with: `replaceAll('<path', '<path transform="scale($devicePixelRatio)" ')` Applying the scale without modifying all height, width and viewBox doesn't work. It's a 25 lines workaround that's blind enough to the SVG syntax for us to use, but it's also because we know how our SVGs are written. --- Comment by @eEQK on Sep 18, 2023 I've forked the repo and made a hacky fix for that, I most likely won't create a PR unless Dan himself says otherwise - the reason being it most likely isn't a proper solution (but more of a workaround) Import using: ```yaml flutter_svg: git: url: https://github.com/XperiTech/flutter_svg path: packages/flutter_svg ref: e969f6c510949eee75b3e93269411e8815fd1f45 ``` (`flutter_svg` also contains a `ref` for `vector_graphics` so it shouldn't be possible for me or anyone else to inject malicious code - you can also simply fork the repo) The way you can use it is by specifying `targetSize`: ```dart await vg.loadPicture( SvgStringLoader(svgString), context, targetSize: Size(80, 80), ); ``` --- the code inside will calculate how much it should scale each axis (`width` and `height` are taken from the svg file itself, while target is what you specify): ```dart final double sx = targetWidth / width; final double sy = targetHeight / height; ``` and then it will choose the smallest one to scale the svg: ```dart _canvas.scale(min(sx, sy)); ``` --- Comment by @dnfield on Sep 18, 2023 > I've forked the repo and made a hacky fix for that, I most likely won't create a PR unless Dan himself says otherwise - the reason being it most likely isn't a proper solution (but more of a workaround) > > Import using: I think if you add some tests for this it would be a reasonable way to handle this upstream. --- Comment by @osnipezzini on Feb 27, 2024 Some news about this ? --- Comment by @sirkalmi on Aug 7, 2024 I solved it this way in my agony, I'm waiting for the error correction so that I can delete the seemingly unnecessary subsequent resizing. ``` static Future<ui.Image> imageFromSvgAsset(String fileName, {String? svgString, Size? size, Map<String, String>? replace, String? subDirectory}) async { svgString ??= await readSvgString(fileName, replace: replace, subDirectory: subDirectory); final pictureInfo = await vg.loadPicture(SvgStringLoader(svgString), null); //https://github.com/dnfield/flutter_svg/issues/971 final image = await pictureInfo.picture.toImage(pictureInfo.size.width.round(), pictureInfo.size.height.round()); final devicePixelRatio = Get.mediaQuery.devicePixelRatio; final targetWidth = (size?.width ?? image.width) * devicePixelRatio; final targetHeight = (size?.height ?? image.height) * devicePixelRatio; return await resizeImage(image, targetWidth.toInt(), targetHeight.toInt()); } ``` ``` static Future<ui.Image> resizeImage(ui.Image image, int targetWidth, int targetHeight) async { final recorder = ui.PictureRecorder(); final canvas = Canvas(recorder); canvas.drawImageRect( image, Rect.fromLTWH(0, 0, image.width.toDouble(), image.height.toDouble()), Rect.fromLTWH(0, 0, targetWidth.toDouble(), targetHeight.toDouble()), Paint(), ); final picture = recorder.endRecording(); final newImage = await picture.toImage(targetWidth, targetHeight); return newImage; } ```
package,P3,p: flutter_svg
low
Critical
2,656,365,018
flutter
[flutter_svg] The svg render the height incorrectly
_Imported from https://github.com/dnfield/flutter_svg/issues/973_ Original report by @tinyc0der on Aug 7, 2023 With this code ``` import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; const String svgString = ''' <svg style="vertical-align: -0.05ex" xmlns="http://www.w3.org/2000/svg" width="9.472ex" height="1.67ex" role="img" focusable="false" viewBox="0 -716 4186.7 738"> <g stroke="currentColor" fill="black" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"> <g data-mml-node="math"> <g data-mml-node="semantics"> <g data-mml-node="mrow"> <g data-mml-node="mi"> <path data-c="53" d="M308 24Q367 24 416 76T466 197Q466 260 414 284Q308 311 278 321T236 341Q176 383 176 462Q176 523 208 573T273 648Q302 673 343 688T407 704H418H425Q521 704 564 640Q565 640 577 653T603 682T623 704Q624 704 627 704T632 705Q645 705 645 698T617 577T585 459T569 456Q549 456 549 465Q549 471 550 475Q550 478 551 494T553 520Q553 554 544 579T526 616T501 641Q465 662 419 662Q362 662 313 616T263 510Q263 480 278 458T319 427Q323 425 389 408T456 390Q490 379 522 342T554 242Q554 216 546 186Q541 164 528 137T492 78T426 18T332 -20Q320 -22 298 -22Q199 -22 144 33L134 44L106 13Q83 -14 78 -18T65 -22Q52 -22 52 -14Q52 -11 110 221Q112 227 130 227H143Q149 221 149 216Q149 214 148 207T144 186T142 153Q144 114 160 87T203 47T255 29T308 24Z"></path> </g> <g data-mml-node="mo" transform="translate(645, 0)"> <path data-c="2E" d="M78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60Z"></path> </g> <g data-mml-node="mi" transform="translate(1089.7, 0)"> <path data-c="41" d="M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"></path> </g> <g data-mml-node="mi" transform="translate(1839.7, 0)"> <path data-c="42" d="M231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229Z"></path> </g> <g data-mml-node="mi" transform="translate(2598.7, 0)"> <path data-c="43" d="M50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q484 659 454 652T382 628T299 572T226 479Q194 422 175 346T156 222Q156 108 232 58Q280 24 350 24Q441 24 512 92T606 240Q610 253 612 255T628 257Q648 257 648 248Q648 243 647 239Q618 132 523 55T319 -22Q206 -22 128 53T50 252Z"></path> </g> <g data-mml-node="mi" transform="translate(3358.7, 0)"> <path data-c="44" d="M287 628Q287 635 230 637Q207 637 200 638T193 647Q193 655 197 667T204 682Q206 683 403 683Q570 682 590 682T630 676Q702 659 752 597T803 431Q803 275 696 151T444 3L430 1L236 0H125H72Q48 0 41 2T33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM703 469Q703 507 692 537T666 584T629 613T590 629T555 636Q553 636 541 636T512 636T479 637H436Q392 637 386 627Q384 623 313 339T242 52Q242 48 253 48T330 47Q335 47 349 47T373 46Q499 46 581 128Q617 164 640 212T683 339T703 469Z"></path> </g> </g> </g> </g> </g> </svg> '''; void main() { runApp(MaterialApp( home: Scaffold( body: Center( child: SvgPicture.string( svgString, ), ), ), )); } ``` ### The output The image doesn't follow svg size (width="9.472ex" height="1.67ex") <img width="300" alt="image" src="https://github.com/dnfield/flutter_svg/assets/19898639/17a0519b-0fe6-49b1-9190-6a821e1bf9b4"> ### Expected Small like this ![svgviewer-output](https://github.com/dnfield/flutter_svg/assets/19898639/c3b5ea3f-f8de-490d-a4b0-5f59f96721ee)
package,P3,p: flutter_svg
low
Minor
2,656,365,234
flutter
[flutter_svg] svg image show blur and serrated on web when spec size
_Imported from https://github.com/dnfield/flutter_svg/issues/979_ Original report by @gapkukb on Aug 18, 2023 HI, I have tried to render svg on the web but got a bad result . if me spec the image size on the svg , it will be shown blur serrated , if without size , it shown good. and it works good on app, the Problem only happened on web. ![image](https://github.com/dnfield/flutter_svg/assets/15757875/fca4bae0-5fb3-4593-9678-5a680adba8dc) As the picture shows that the top picture show it works on web . Does anyone known how to resolve it ? thanks.
package,P3,p: flutter_svg
low
Minor
2,656,365,328
flutter
[flutter_svg] <image> tags not rendered
_Imported from https://github.com/dnfield/flutter_svg/issues/980_ Original report by @billyjuliux on Aug 24, 2023 Hi, I tried to render svg image which contains `<image>` tags in `<defs>` (png image inside svg), but those images were not successfully rendered. Yet other elements of the svg were rendered successfully. I can't show you the real image, but here is the rough structure of the svg file: ``` <svg width="52" height="128" viewBox="0 0 52 128" fill="none" xmlns="http://www.w3.org/203/svg" xmlns:xlink="http://www.w3.org/1939/xlink"> <path d="M561.28 0H0V17.66H561.28" fill="#E60013"/> <mask id="mask0_335_524" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="562" height="178"> <path d="M561.28 0H0V177.66H561.28V0Z" fill="white"/> </mask> <g mask="url(#mask0_335_524)"> <path fill-rule="evenodd" clip-rule="even" d="M555" fill="#CF141C"/> <path fill-rule="evenodd" clip-rule="even" d="M0 151.78V177.66H561.28L0 151.78Z" fill="#CF141C"/> <rect x="-223" y="-44" width="67" height="35" fill="url(#pattern0)"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M561.281 0H385.291L440.381 177.66H561." fill="#CF141C"/> <rect x="386" y="8" width="171" height="173" fill="url(#pattern1)"/> </g> <path d="M211.444 " fill="white"/> <defs> <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"> <use xlink:href="#image0_3365_52461" transform="matrix(0.0005008 0 0 0.009108 -0.00112783 0)"/> </pattern> <pattern id="pattern1" patternContentUnits="objectBoundingBox" width="1" height="1"> <use xlink:href="#image1_3365_52461" transform="matrix(0.000632511 0 0 0.000625199 0 -0.00109684)"/> </pattern> <image id="image0_3365_52461" width="1920" height="1009" xlink:href="data:image/png;base64,iVBORw0KGgoAAAbk7CxAAAgAElEQVR4AezdaZMl13kf"/> <image id="image1_3365_52461" width="1581" height="1603" xlink:href="data:image/png;base64,iVBORw0ACDgXPJAAAKN2lDQ1BzUkdCIElFQzYxOTY2LTIuMQAAeJydlndUU9kWh8I="/> </defs> </svg> ``` I have tried to move the `<defs>` order to the front and use online tools of svg cleaner but still didn't work. Any help would be very appreciated. Thanks! --- Comment by @minseok-jeong-gn on Aug 26, 2023 Same issue --- Comment by @tsrCodes on Aug 27, 2023 Any Solution ?? --- Comment by @AristideVB on Aug 30, 2023 Also experiencing this issue, I ended up stacking my PNGs behind my SVG --- Comment by @pipe0919 on Sep 8, 2023 A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux --- Comment by @devnta on Sep 14, 2023 > A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux Thank you very much, bro! It worked for me. But what solution to fix this faster? Very thanks! --- Comment by @pipe0919 on Sep 14, 2023 > > A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux > > Thank you very much, bro! It worked for me. But what solution to fix this faster? Very thanks! Not now for me --- Comment by @dishankjindal1 on Nov 7, 2023 This is a problem, svg which contains images inside are working fine on browser but images are getting distorted in flutter/react-native both --- Comment by @ElDuderini on Dec 4, 2023 I've had issues with this as well, but unfortunately can't really do the conversion to a PDF and then back to an SVG since the issues with these images happen with dynamic content managed by CMS. --- Comment by @da-coid on Jan 10, 2024 if you get asset from figma , download it as png , and then convert to svg with tools that you can find on internet. It works ! --- Comment by @adimshev on Jan 15, 2024 any updates? --- Comment by @fisforfaheem on Feb 6, 2024 who will fix this --- Comment by @abdel-ke on Feb 13, 2024 for me i converted the svg to json with package xml2json then i mapped it --- Comment by @fisforfaheem on Feb 13, 2024 how On Tue, Feb 13, 2024 at 4:34 PM ABDELHAMID EL KEMMAL < ***@***.***> wrote: > for me i converted the svg to json with package xml2json then i mapped it > > — > Reply to this email directly, view it on GitHub > <https://github.com/dnfield/flutter_svg/issues/980#issuecomment-1941292774>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AIRXJSFNQZFCFJURKAYH3PDYTNFT3AVCNFSM6AAAAAA34VXG3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBRGI4TENZXGQ> > . > You are receiving this because you commented.Message ID: > ***@***.***> > --- Comment by @minseok-jeong-gn on Feb 14, 2024 For the saving time, If svg file doesn't render correctly, just use png or jpeg format. I'm just export image as png or jpeg format if svg file doesn't work. That saved my time a lot --- Comment by @fisforfaheem on Feb 14, 2024 That worked! but this should be fixed...by someone.. On Wed, Feb 14, 2024 at 6:08 AM minseok-jeong-gn ***@***.***> wrote: > For the saving time, > If svg file doesn't render correctly, > just use png or jpeg format. > > I'm just export image as png or jpeg format if svg file doesn't work. > That saved my time a lot > > — > Reply to this email directly, view it on GitHub > <https://github.com/dnfield/flutter_svg/issues/980#issuecomment-1942933215>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AIRXJSB5FZTGTMOGZOLGV6DYTQFBTAVCNFSM6AAAAAA34VXG3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSHEZTGMRRGU> > . > You are receiving this because you commented.Message ID: > ***@***.***> > --- Comment by @francisnumbi-chd on Feb 19, 2024 This is really pissing me ! Why can't they find a solution ! --- Comment by @fisforfaheem on Feb 22, 2024 I agree with you. On Mon, Feb 19, 2024 at 10:02 PM Francis Numbi ***@***.***> wrote: > This is really pissing me ! Why can't they find a solution ! > > — > Reply to this email directly, view it on GitHub > <https://github.com/dnfield/flutter_svg/issues/980#issuecomment-1952888489>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AIRXJSEBH6IV4PKHGT3QNBLYUOAUFAVCNFSM6AAAAAA34VXG3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJSHA4DQNBYHE> > . > You are receiving this because you commented.Message ID: > ***@***.***> > --- Comment by @yousefak007 on Mar 23, 2024 same for me --- Comment by @fisforfaheem on Jul 22, 2024 Kindly give us an update
package,p: flutter_svg
low
Minor
2,656,365,400
flutter
[flutter_svg] Support nested <svg> tags
_Imported from https://github.com/dnfield/flutter_svg/issues/983_ Original report by @kecson on Sep 6, 2023 https://api-mainnet.suifrens.sui.io/suifrens/0xb58aa2d1d137e480f8bd55094da2bb569cd51e2eb7d9415f7cd5a3c40cbd580b/svg ![image](https://github.com/dnfield/flutter_svg/assets/10434414/eebf7a36-4577-49e2-8524-acc1ae768f83)
package,P3,p: flutter_svg
low
Minor
2,656,365,463
flutter
[flutter_svg] [Feature Request] Support for switcher and error widget
_Imported from https://github.com/dnfield/flutter_svg/issues/986_ Original report by @milindgoel15 on Sep 15, 2023 A switcher widget would be nice to automatically load up the resulting SVG from an asset or anywhere else from a placeholder widget and an error widget that provides a fallback widget if the asset or network image fails to load. Currently, if the asset does not load, it displays the error in the app. The Switcher widget could be made similar to what cached_network_image does.
package,p: flutter_svg
low
Critical
2,656,365,814
flutter
[flutter_svg] implement the textLength attribute.
_Imported from https://github.com/dnfield/flutter_svg/issues/993_ Original report by @Zeebzog on Oct 5, 2023 This attribute seems to be ignored, am I doing something wrong? `<?xml version="1.0"?> <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><text x="50" y="40" font-size="12px" fill="black" text-anchor="middle" textLength="90" lengthAdjust="spacingAndGlyphs" >Short </text><text x="50" y="80" font-size="12px" fill="black" text-anchor="middle" textLength="90" lengthAdjust="spacingAndGlyphs" >Really Long String </text> </svg>` Should result in: ![image](https://github.com/dnfield/flutter_svg/assets/78379592/cb32e724-5f0c-4854-a0e5-d31c67b6136e) But instead you get: ![image](https://github.com/dnfield/flutter_svg/assets/78379592/f7f7ddbf-65e3-4c5a-9c31-92a475a1cc1c) --- Comment by @dnfield on Oct 10, 2023 This is part of SVG2 and not implemented. But I have no objections to implementing it if someone wants to create a patch. --- Comment by @dnfield on Oct 10, 2023 Sorry, it is part of 1.1 too and just not implemented :)
package,P3,p: flutter_svg
low
Minor
2,656,372,815
godot
Hitting CTRL+S repeatedly doesn't save resource each time with C#-based editor plugin and resource
### Tested versions - Reproducible in: v4.3.stable.mono.official [77dcf97d8], v4.4.dev4.mono.official [36e6207bb] ### System information Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (Advanced Micro Devices, Inc.; 32.0.11027.1003) - AMD Ryzen 7 5700G with Radeon Graphics (16 Threads) ### Issue description I'm making a custom full-screen editor for my custom resources. When hitting CTRL+S, the `_ApplyChanges` method gets called, but the changes introduced to the resource inside its code aren't saved, instead they are only visible in the resource's inspector. Hitting ENTER key while focused on the inspector's field and then CTRL+S applies the new value. This extra step is not needed for GDScript-based editor plugins. For reference, I'm attaching both GDScript and CSharp version which does the exactly same thing. If the problem is unsolvable, perhaps it would be feasible to expose `EditorNode::save_resource()` method in `EditorInterface` to be able to do the save manually inside `_ApplyChanges` method. Note that on 4.3, it's even more broken than on 4.4.dev4 ### Steps to reproduce 1. Load the MRP 2. Enter script editor 3. Inspect GDScript-based extension principle of operation: 3.1. Right click the empty space in file explorer and create MyResource resource, name it myres.tres 3.2. Observe that resource file contains `my_str = "default edited"` 3.3. Hit CTRL+S 3 times 3.4. Observe the "scene has no root" error triggering 3 times, and that resource file contains `my_str = "default edited edited edited edited"` 4. Inspect C#-based extension's principle of operation: 4.1. Right click the empty space in file explorer and create MyResourceCs resource, name it mycs.tres 4.2. Observe that resource file contains `_my_str = "default edited"` 4.3. Hit CTRL+S 3 times 4.4. Observe that "scene has no root" error doesn't trigger at all, and that resource file still contains `my_str = "default edited"` 4.5. Observe that resource inspector contains value `default edited edited edited edited` 4.6. Observe that hitting ENTER while focused on it and pressing CTRL+S triggers the "scene has no root" error and that the resource file contains `_my_str = "default edited edited edited edited edited"` ### Minimal reproduction project (MRP) [res_editor_save_repro.zip](https://github.com/user-attachments/files/17737307/res_editor_save_repro.zip)
bug,topic:editor,topic:dotnet
low
Critical
2,656,373,015
flutter
[flutter_svg] [Bug] Rendering regressions when upgrading from flutter_svg 1.1.6 to 2.0.7
_Imported from https://github.com/dnfield/flutter_svg/issues/994_ Original report by @androidseb on Oct 7, 2023 I use a large collection of icons in my product, mostly icons listed [here](https://github.com/androidseb/openmoji/tree/map_marker_monochrome_icons/map_marker_monochrome). I have some golden tests to check for regressions, and when upgrading flutter_svg from 1.1.6 to 2.0.7, I noticed a few regressions that I thought might be helpful to report here. I consider these regressions bugs because the rendering elsewhere (e.g. Chrome browser, Inkscape) seems to be correct. ## Regression 1 ### SVG file ![openmoji_curly_hair](https://github.com/dnfield/flutter_svg/assets/5169269/9852ef21-b388-4649-851e-9e91ce662a44) ### Rendering on 1.1.6 (PNG) ![openmoji_curly_hair_before](https://github.com/dnfield/flutter_svg/assets/5169269/e3c3c324-4bd1-4b8d-873e-ff3e4c8066c5) ### Rendering on 2.0.7 (PNG) ![openmoji_curly_hair_after](https://github.com/dnfield/flutter_svg/assets/5169269/48ffaae7-1225-4029-924b-e14f5c86432f) ## Regression 2 ### SVG file ![openmoji_prayer_beads](https://github.com/dnfield/flutter_svg/assets/5169269/761031b4-4678-4e38-9c8c-a181e9512750) ### Rendering on 1.1.6 (PNG) ![openmoji_prayer_beads_before](https://github.com/dnfield/flutter_svg/assets/5169269/332d37aa-1afb-438e-87a0-4240d8d47da2) ### Rendering on 2.0.7 (PNG) ![openmoji_prayer_beads_after](https://github.com/dnfield/flutter_svg/assets/5169269/bfa4cd3e-8e54-401f-b522-2aa73a9b808d) ## Regression 3 ### SVG file ![openmoji_woman_gesturing_ok](https://github.com/dnfield/flutter_svg/assets/5169269/37b5c821-d83b-46de-bc5e-19b391296f83) ### Rendering on 1.1.6 (PNG) ![openmoji_woman_gesturing_before](https://github.com/dnfield/flutter_svg/assets/5169269/900cda37-ae15-4eaf-a16e-7e59d1f1dc5c) ### Rendering on 2.0.7 (PNG) ![openmoji_woman_gesturing_ok_after](https://github.com/dnfield/flutter_svg/assets/5169269/e52cedc7-e60b-4807-9a98-9e2e62228b5d) ## Additional notes It appears to be a bug in the library, but in case I'm misusing anything, here is the code I use to produce those PNG images: ```dart static Future<Uint8List> _svgStringToPngBytes( String svgStringContent, ) async { const double targetWidth = 32; const double targetHeight= 32; const double devicePixelRatio = 3; const double scaledTargetWidth = targetWidth * devicePixelRatio; const double scaledTargetHeight = targetHeight * devicePixelRatio; final SvgStringLoader svgStringLoader = SvgStringLoader(svgStringContent); final PictureInfo pictureInfo = await vg.loadPicture(svgStringLoader, null); final double svgWidth = pictureInfo.size.width; final double svgHeight = pictureInfo.size.height; final ui.Picture picture = pictureInfo.picture; final ui.PictureRecorder recorder = ui.PictureRecorder(); final ui.Canvas canvas = Canvas(recorder, Rect.fromPoints(Offset.zero, Offset(svgWidth, svgHeight))); final double scaleFactor = math.min( scaledTargetWidth / svgWidth, scaledTargetHeight / svgHeight, ); final double scaledSvgWidth = svgWidth * scaleFactor; final double scaledSvgHeight = svgHeight * scaleFactor; canvas.translate( (scaledTargetWidth - scaledSvgWidth) / 2, (scaledTargetHeight - scaledSvgHeight) / 2, ); canvas.scale(scaleFactor, scaleFactor); canvas.drawPicture(picture); final ui.Image imgByteData = await recorder.endRecording().toImage( scaledTargetWidth.ceil(), scaledTargetHeight.ceil(), ); final ByteData? bytesData = await imgByteData.toByteData(format: ui.ImageByteFormat.png); final Uint8List imageData = bytesData?.buffer.asUint8List() ?? Uint8List(0); pictureInfo.picture.dispose(); return imageData; } ``` --- Comment by @fisforfaheem on Oct 17, 2023 sME ISSUE --- Comment by @dnfield on Oct 17, 2023 Is this code run via `flutter test` or some other method? --- Comment by @androidseb on Oct 18, 2023 @dnfield this code that produced these PNG images supplied in this issue's description was run via `flutter test`, but I can also confirm that the same behavior occurs on real devices, running on Android, iOS or Web. --- Comment by @androidseb on Apr 4, 2024 Just adding a quick update here, this is still an issue on the latest version of Flutter today (Flutter 3.19.5).
package,P3,p: flutter_svg
low
Critical