Skip to content

Commit 9ed650a

Browse files
authored
1 parent abebd34 commit 9ed650a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

packages/flutter/lib/src/widgets/semantics_debugger.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class _SemanticsDebuggerPainter extends CustomPainter {
318318
} else {
319319
switch (data.textDirection!) {
320320
case TextDirection.rtl:
321-
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDF}';
321+
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDI}';
322322
case TextDirection.ltr:
323323
effectivelabel = tooltipAndLabel;
324324
}

packages/flutter/test/widgets/semantics_debugger_test.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,27 @@ void main() {
524524
// ignore: avoid_dynamic_calls
525525
expect(_getSemanticsDebuggerPainter(debuggerKey: debugger, tester: tester).labelStyle, labelStyle);
526526
});
527+
528+
testWidgets('SemanticsDebugger label for rtl.', (WidgetTester tester) async {
529+
final UniqueKey debugger = UniqueKey();
530+
final Key label = UniqueKey();
531+
532+
await tester.pumpWidget(
533+
Directionality(
534+
textDirection: TextDirection.rtl,
535+
child: SemanticsDebugger(
536+
key: debugger,
537+
child: Semantics(
538+
label: 'ملصق',
539+
textDirection: TextDirection.rtl,
540+
key: label,
541+
),
542+
),
543+
),
544+
);
545+
546+
expect(_getMessageShownInSemanticsDebugger(widgetKey: label, debuggerKey: debugger, tester: tester), '\u2067ملصق\u2069');
547+
});
527548
}
528549

529550
String _getMessageShownInSemanticsDebugger({

0 commit comments

Comments
 (0)