Repository navigation
Closed
flutter/packages
#11962Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: crashStack traces logged to the consoleStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Description
Steps to reproduce
Create an SvgPicture with a semanticsLabel, but no directionality?
I'm only creating this issue because the stacktrace suggested it, and I couldn't find any existing issues related to this.
Expected results
Expected not to get a stacktrace in the console
Actual results
Got an exception.
Code sample
Code sample
return SvgPicture.asset(
assetPath,
width: width,
height: height,
colorFilter: ColorFilter.mode(color ?? Colors.black, BlendMode.srcIn),
semanticsLabel: 'My Label',
);Resolution
return Directionality(
textDirection: TextDirection.ltr,
child: SvgPicture.asset(
assetPath,
width: width,
height: height,
colorFilter: ColorFilter.mode(color ?? Colors.black, BlendMode.srcIn),
semanticsLabel: 'My Label',
),
);Screenshots or Video
Screenshots / Video demonstration
N/A
Logs
Logs
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
A SemanticsData object with label "TRACER Logo" had a null textDirection.
'package:flutter/src/semantics/semantics.dart':
Failed assertion: line 959 pos 10: 'attributedLabel.string == '' || textDirection != null'
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=02_bug.yml
When the exception was thrown, this was the stack:
#2 new SemanticsData (package:flutter/src/semantics/semantics.dart:959:10)
#3 SemanticsNode.getSemanticsData (package:flutter/src/semantics/semantics.dart:3537:12)
#4 SemanticsNode._addToUpdate (package:flutter/src/semantics/semantics.dart:3581:32)
#5 SemanticsOwner.sendSemanticsUpdate (package:flutter/src/semantics/semantics.dart:4345:14)
#6 PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1499:24)
#7 PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1501:15)
#8 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:636:25)
#9 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1261:13)
#10 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
#11 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1434:15)
#12 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1347:9)
#13 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1200:5)
#14 _invoke (dart:ui/hooks.dart:330:13)
#15 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
#16 _drawFrame (dart:ui/hooks.dart:302:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: unhandled element <style/>; Picture key: Svg loaderFlutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.4, on macOS 15.6.1 24G90 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2025.1.5.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: crashStack traces logged to the consoleStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Activity
darshankawar commentedon Sep 18, 2025
@jtanium
I tried with complete runnable code including your code snippet which worked properly without throwing the reported error.
code
Please check this code and see if using it you still get same error or not. If not, please provide us complete runnable code including the asset you are using.
jtanium commentedon Sep 18, 2025
@darshankawar I don't think this is a problem worth spending a lot of time on. I was getting the stacktrace in the console, but it didn't really seem to affect my app. The stacktrace message just asked to file an issue, so I thought I would put it out here, along with my fix to help someone in the future; and maybe someone would recognize the problem easily.
darshankawar commentedon Sep 19, 2025
Thanks for the feedback. I tried again by using
attributedLabeland wrapping the code withSemanticsbut couldn't replicate the reported behavior. Based on the stacktrace though, I'll keep the issue open for team's tracking.jtanium commentedon Sep 19, 2025
mbcorona commentedon Jun 23, 2026
Adding code sample that reproduces this issue
[vector_graphics] Provide textDirection for semantics label to avoid …
github-actions commentedon Aug 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.