Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/vector_graphics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 1.2.3

* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
* Fixes a crash when a `semanticsLabel` is provided without an ambient `Directionality` (flutter/flutter#175532).

## 1.2.2

Expand Down
1 change: 1 addition & 0 deletions packages/vector_graphics/lib/src/vector_graphics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ class _VectorGraphicWidgetState extends State<VectorGraphic> {
container: widget.semanticsLabel != null,
image: true,
label: widget.semanticsLabel ?? '',
textDirection: Directionality.maybeOf(context) ?? TextDirection.ltr,
child: child,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vector_graphics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: vector_graphics
description: A vector graphics rendering package for Flutter using a binary encoding.
repository: https://github.com/flutter/packages/tree/main/packages/vector_graphics
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+vector_graphics%22
version: 1.2.2
version: 1.2.3

environment:
sdk: ^3.10.0
Expand Down
17 changes: 17 additions & 0 deletions packages/vector_graphics/test/vector_graphics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,23 @@ void main() {
);
});

testWidgets('Semantic label works without an ambient Directionality (flutter/flutter#175532)', (
WidgetTester tester,
) async {
final testBundle = TestAssetBundle();

await tester.pumpWidget(
DefaultAssetBundle(
bundle: testBundle,
child: const VectorGraphic(loader: AssetBytesLoader('foo.svg'), semanticsLabel: 'Foo'),
),
);
await tester.pumpAndSettle();

expect(tester.takeException(), isNull);
expect(find.bySemanticsLabel('Foo'), findsOneWidget);
});

testWidgets('Default placeholder builder', (WidgetTester tester) async {
final testBundle = TestAssetBundle();

Expand Down
Loading